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

The option forced_root_block_attrs not working when remove Numbered list / Bullet list #5167

Closed
laeeqwtb opened this issue Sep 18, 2019 · 2 comments

Comments

@laeeqwtb
Copy link

I have used forced_root_block_attrs option to apply data-editor=1 attribute to P tags like below:

forced_root_block : 'p',
forced_root_block_attrs: {
	'data-editor': '1'
},

The above code applying data-editor=1 correctly to P tag when added after Enter key press. But when created a Numbered list / Bullet list and then remove Numbered list / Bullet list by clicking Numbered list / Bullet list icon from editor tools. In that case P tag applied to content without applying data-editor attribute to P tag.

Steps to reproduce issue:

1- Create Numbered list / Bullet list in editor
2- Select all Numbered list / Bullet list content and remove Numbered list / Bullet list by clicking Numbered list / Bullet list icon from editor tools.

You can check this on TinyMCE fiddle:

http://fiddle.tinymce.com/SQgaab/

Expected behavior:

The data-editor attribute should be apply to P tag when remove Numbered list / Bullet list by clicking Numbered list / Bullet list icon from editor tools.

@lnewson
Copy link
Contributor

lnewson commented Oct 20, 2019

It looks like the cause is this line: https://github.com/tinymce/tinymce/blob/master/modules/tinymce/src/plugins/lists/main/ts/core/TextBlock.ts#L25 as it's not doing a case insensitive check, which then causes the attributes to never be set. So as a temporary workaround, if you change the fiddle to use an uppercase P that should largely work, eg: http://fiddle.tinymce.com/SQgaab/3

@lnewson
Copy link
Contributor

lnewson commented Feb 14, 2020

TinyMCE 5.2.0 was released to the community earlier this week, which contained a fix for this issue. Please let us know if you have any further issues.

@lnewson lnewson closed this as completed Feb 14, 2020
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

2 participants