WordPress adds br in between my shortcode

Question

I am having a problem where my markup is rendered incorrectly (more space because of <br />) as WordPress adds <br /> everywhere theres a line break

eg.

[x]
  [y]Hello world[/y]
  [y]A test[/y]
[/x]

In the handler for x the $content looks like

<br />
[y]Hello world[/y]
<br />
[y]A test[/y]
<br />

Am I suppose to strip out all the line breaks?

UPDATE

I notice that no line breaks

[x][y]Photoshop[/y][y]Notepad++[/y][/x]

[y]Notepad++[/y] will not be rendered as a shortcode. I must have a space like

[x][y]Photoshop[/y] [y]Notepad++[/y][/x]
                   ^

Isit?

0
JM at Work 2 years 2020-12-31T15:10:26-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse