You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Normally when creating a new line by pressing enter, a new paragraph is created.
If you press enter twice after an unordered list to create a new line, Webkit browsers will insert a DIV element instead of a paragraph.
There is a fix for this in the formatNewLine function, however if the element that you transform into the editor (in my case a div) already has a class name, the function won't work because the class name no longer matches in this line:
if (parent.nodeName === 'DIV' && parent.className === 'redactor_editor')
Changing this line as below will fix this issue:
if (parent.nodeName === 'DIV' && parent.className.indexOf('redactor_editor') >= 0)
There is also another issue in that depending on the css that the editor is using, Webkit browsers may insert more than an empty DIV. In my case the line below is inserted after a closing UL instead:
Normally when creating a new line by pressing enter, a new paragraph is created.
If you press enter twice after an unordered list to create a new line, Webkit browsers will insert a DIV element instead of a paragraph.
There is a fix for this in the formatNewLine function, however if the element that you transform into the editor (in my case a div) already has a class name, the function won't work because the class name no longer matches in this line:
Changing this line as below will fix this issue:
There is also another issue in that depending on the css that the editor is using, Webkit browsers may insert more than an empty DIV. In my case the line below is inserted after a closing UL instead:
Therefore this line never matches and the cleanup fails:
I don't think it's really necessary to check the contents of the new line, so perhaps we can safely replace this line with the code below:
The text was updated successfully, but these errors were encountered: