Inline code after latest update inserts newlines before and after the inline code. #363
Labels
No labels
3rd Party Issue
BETA
Bug
duplicate
Edition/CE
Edition/Enterprise
Edition/Pro
enhancement
Enlighter Plugin v4
EnlighterJS v2
EnlighterJS v3
EnlighterJS.Gutenberg
EnlighterJS.TinyMCE
env/hosting
Environment/Usage
FeatureRequest
fixed
invalid
MooTools
mysterious
NOTIFICATION
qa/improvement-needed
qa/validated
question
status/information-needed
status/validated
status/validation-pending
TinyMCE
wontfix
WordPress Core
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
EnlighterJS/Plugin.WordPress#363
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Describe the bug
Inline code after latest update inserts newlines before and after the inline code.
See https://www.r4photobiology.info/2023/01/ggspectra-0-3-10/
WordPress Editing Mode
Which WordPress editing mode you're using ?
Advanced Editor Tools (previously TinyMCE Advanced)
Should be irrelevant, as preexisting pages in the whole site were broken. I haven't edited anything since the automatic plugin update.
Frontend or Backend Issue
frontend: page rendering
To Reproduce
Steps to reproduce the behavior:
See for example https://www.r4photobiology.info/2023/01/ggspectra-0-3-10/ and almost every other post at https://www.r4photobiology.info
Expected behavior
Inline code to the displayed in line.
Screenshots
If applicable, add screenshots to help explain your problem.
This should be a single paragraph with no line breaks.

Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Plugin configuration
I also check with the Twenty-Twenty-Three theme and the problem persists.
Have the same behaviour on the fresh installed plugin. 'this text' arose closing the paragraph </p> or adding two paragraph tags <p></p>
thanks for your reports! it's a side effect of a required bugfix regarding the wpautop filter and the internal "placeholder" workaround to keep the code immutable. your html code is changed by wpauto and not Enlighter :(
Generally this issue only affects the compatibility mode, inline shortcodes and markdown style inline blocks - you can easily downgrade to v4.5.0 or revert the following commit:
github.com/EnlighterJS/Plugin.WordPress@6ed5d71032This commit adds a "pre" wrapper tag around the placeholders, which allows wpautop to recognize the content as pre-codeblock. And yes this causes your issues because now a "block" element is assumed by wpautop.
Technically the solution will take some time because it doesn't make sense to revert the commit which previously breaks all block codeblocks (much more needed..) within the mentioned modes. I've to "split" all filters for specific block+inline wrappers.
Gutenberg and TinyMCE should work as expected.
sry guys
@aphalo @SuperBoss9 can you confirm that only the mentioned editing modes are affected ?
I didn't manage to find other issues with the inline code. Is it possible to add something like a feature that will change
this type of quotesto something like <code>this type of tags</code>? That may be a solution.it much more complicated under the hood... technically the filters are extracting the codeblocks with a low wp_filter priority and restoring the content (converted to EnlighterJS codeblocks) with a high wp_filter priority. the extraction (placeholders are inserted) needs to be modified to detect inline content and wrap the placeholders selectively in code/pre tags temporarily to avoid wpautop issues.
in previous versions (without a pre wrapper) all codeblocks were assumed as inline by wpautop - therefore you didn't experienced any issues but the markup was broken in case of block content
@AndiDittrich I am not sure how the editor in use matters in this, except when writing a new post or page. At the moment this bug affects a couple of hundred existing posts in my website from the last several years. The html includes the backquotes as & scapes, as I made sure my settings would stop the editor from converting backquotes into
<code> </code>fences so as to let Enlighter do the highlighting. For the time being, I deactivated Enlighter and will think how to proceed. I can live with this. I am not using Guthember or blocks at all, at least not explicitly. I guess, I should downgrade to the previous version unril you have the time to correct the problem. I had not even noticed that a problem existed with blocks... Thanks, for the great plugin!see https://github.com/EnlighterJS/Plugin.WordPress/issues/351 for details why the "legacy" compatibility modes have changed.
you can easily force the old (invalid) behaviour by reverting the commit mentioned above (replace one file)
github.com/EnlighterJS/Plugin.WordPress@da0d8ea554should fix the issue for gfm(markdown) and shortcodes - maybe someone give it a trychanging the compatibility modes takes longer
I just upgraded to 4.6.1. Is there some easy way to identify where on my site I used inline code?Maybe with the Search field on my posts list? This way I can confirm it looks OK for you. I don't remember when I last used inline you see.
Just search via WP Editor search. Use symbols that are used in the
declarations of the code blocks. Like apostrophes or HTML tags like pre etc.
--
Best wishes,
Vladislav Kravchenko
сб, 21 янв. 2023 г. в 11:04, ajtruckle @.***>:
I've just checked 4.6.1 with my notes. Inline code alone works pretty good. But if I have these fancy back-quotes (I don't know how to name them properly) inside a <pre> block - they also englighted. From my point of view this is a wrong behaviour. Nothing inside <pre> should be changed:
I think I have inline code on here in two places and it seems OK:
https://www.publictalksoftware.co.uk/2018/05/s-89-slips-highlight-when-study-point-not-assigned/
@SuperBoss9
in case your not using an Enlighter codeblock this is the expected behaviour of using markdown fenced codeblocks or shortcodes.
Then it works :)