admin管理员组文章数量:1130349
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?
1 Answer
Reset to default 0Try 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.
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?
-
If you mean the Shortcode block in Gutenberg, then it's perfectly normal for the
<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 - What do you mean by "Code block for multi-line shortcodes"? How do I do that? (Sorry...I'm new to wordpress) – Rob Avery IV Commented Nov 23, 2018 at 13:30
-
1
Click on the
+("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
1 Answer
Reset to default 0Try 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.
本文标签: shortcodeWordpress keeps automatically inserts ltbrgt
版权声明:本文标题:shortcode - Wordpress keeps automatically inserts <br> 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749157820a2324892.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


<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