I'm using the 'SyntaxHighlighter Evolved' plugin on Wordpress and when I create a code block, it keeps inserting a <br/>
. If I put everything on one line, of course, it would not insert them. I want to be able to have a code block with multiple lines without the <br/>
.
Here is what I'm typing:
Here is what the preview displays:
How do I remove the <br />
while keeping the new lines?
I'm using the 'SyntaxHighlighter Evolved' plugin on Wordpress and when I create a code block, it keeps inserting a <br/>
. If I put everything on one line, of course, it would not insert them. I want to be able to have a code block with multiple lines without the <br/>
.
Here is what I'm typing:
Here is what the preview displays:
How do I remove the <br />
while keeping the new lines?
Try putting the 2nd line (the first code line) just after the shortcode, as in
[sourcecode language = python]a+b=c
f = 1 + 3
c = 12 + 13
(not actually code, but you see what I did.) You put a blank line after the shortcode, which was interpreted as a
Just guessing here; you might want to ask the plugin support forum.
<br />
to be automatically added because the block's render callback applieswpautop()
on the shortcode (or block content). It's easy to override the block, but why not use the Code block for multi-line shortcodes? – Sally CJ Commented Nov 23, 2018 at 7:46+
("Add Block") button and choose the "Code" block, then just put your shortcode into the block content. (And you can use the short version of the shortcode -[python]code here[/python]
) – Sally CJ Commented Nov 23, 2018 at 15:42