Skip to content
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

A <p>&nbsp;</p> is added after each line that contains a matched protect (regex) value #7522

Open
JeroenKurvink opened this issue Jan 17, 2022 · 4 comments

Comments

@JeroenKurvink
Copy link

JeroenKurvink commented Jan 17, 2022

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>&nbsp;</p>
<!-- comment2 -->
<p>&nbsp;</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

  1. add the following in the source code view
<!-- comment -->
<!-- comment2 -->
<!-- comment3 -->
  1. close the source code view
  2. 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

@Yuzmi
Copy link

Yuzmi commented Feb 10, 2022

Same thing happening for me on 5.10.3.

@hamza0867
Copy link
Contributor

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.

@tiny-stale-bot
Copy link
Collaborator

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.

@Petercopter
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants