-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Long-term code block (address line break issues) #62
Comments
It seems that the latest version of Code Syntax Block |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, we are using the Code Syntax Block for the Developer Blog, which extends the Core Code block. When setting a "Language" for this block in the editor, it adds
<br>
tags instead of\n
within the code.<br>
tags are perfectly fine within<pre><code>
. Nested HTML is valid here.However, the plugin uses Prism.js, which strips HTML within code elements. And because the plugin is using
<br>
instead of\n
, it behaves as there are no line breaks at all. So, on the front end, all the code is formatted into a single line.There is a "Keep Markup" JS extension that may also be a front-end fix for the plugin: https://prismjs.com/plugins/keep-markup/
What we've been doing:
We've had to manually search/replace
<br>
tags in the editor and replace them with\n
.Short-term fix:
We have a temporary solution for the plugin here: #61
Longer term:
We need a more robust solution that:
This could be forking the current plugin, submitting a patch to it, or picking another plugin (potentially needing to fix too).
Related history:
This initially became an issue when Gutenberg started adding
<br>
tags. However, this has now been addressed in Gutenberg: WordPress/gutenberg#59627The text was updated successfully, but these errors were encountered: