A <p> </p> is added after each line that contains a matched protect (regex) value
What is the current behavior? Describe the bug A protect was added to ignore the in tinymce. The protect works but after each line it adds a
when switching to source code view again.
protect: [/.(<![\s\S]?-->)/g]
<!-- comment -->
<!-- comment2 -->
<!-- comment3 -->
becomes
<!-- comment -->
<p> </p>
<!-- comment2 -->
<p> </p>
<!-- comment3 -->
Please provide the steps to reproduce and if possible a minimal demo of the problem via fiddle.tiny.cloud or similar.
https://fiddle.tiny.cloud/NThaab
- add the following in the source code view
<!-- comment -->
<!-- comment2 -->
<!-- comment3 -->
- close the source code view
- open the source code view
What is the expected behavior?
<!-- comment -->
<!-- comment2 -->
<!-- comment3 -->
stays
<!-- comment -->
<!-- comment2 -->
<!-- comment3 -->
Which versions of TinyMCE, and which browser / OS are affected by this issue? Did this work in previous versions of TinyMCE?
Im using 5.10.2 and tested this in chrome Version 97.0.4692.71 (Official Build) (64-bit). I don't know if this worked in previous versions
Same thing happening for me on 5.10.3.
Hello @JeroenKurvink
Thank you for the report. This appears to be a bug. There is a workaround however if you use /.*<!([\s\S]*?)-->\n?/g in the protect field then you will get the behavior you want.
This issue is stale because it has been open 365 days with no activity. Please comment if you wish to keep this issue open or it will be closed in 30 days.
This is still happening. The protect is unrelated/doesn't work, the paragraph tags are still being inserted between comments in TinyMCE 7.x.
The only way to avoid it is to have the comments on the same line.
This issue is stale because it has been open 365 days with no activity. Please comment if you wish to keep this issue open or it will be closed in 30 days.
This issue was closed because it has been stalled for 30 days with no activity.