Unyson icon indicating copy to clipboard operation
Unyson copied to clipboard

wp-editor: html tags `<p><br>` are removed

Open khangdoan03121993 opened this issue 10 years ago • 10 comments

I built text block shortcode, I use ' type => "wp-editor" '. When I save text in a text content element, all breaks are removed. So everything gets condensed into one large paragraph. I have to put
tags to force the breaks, but once I save and go back into the content element to edit text, all of the
tags are gone.

*Before saving: screenshot *After saving: screenshot

How do I fix this issue. Thanks!

khangdoan03121993 avatar Sep 08 '16 04:09 khangdoan03121993

Maybe because you have <br> there? In post editor it is behaving differently?

andreiglingeanu avatar Sep 08 '16 07:09 andreiglingeanu

ghost avatar Sep 08 '16 14:09 ghost

this is Grammarly that helps me check grammar

khangdoan03121993 avatar Sep 08 '16 14:09 khangdoan03121993

Can you give me your options array or admin/ftp access (moldcraft[at]email.com) ?

ghost avatar Sep 08 '16 14:09 ghost

Test content:

<p>Hello</p><br/><p>World</p>

ghost avatar Sep 09 '16 09:09 ghost

Sorry, I don't understand, can you explain detail. Thanks

2016-09-09 16:36 GMT+07:00 moldcraft [email protected]:

Test content:

Hello


World

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ThemeFuse/Unyson/issues/1985#issuecomment-245867013, or mute the thread https://github.com/notifications/unsubscribe-auth/APDlYWOOk6T6ZKP10JolJaK4xeBfIUWrks5qoSijgaJpZM4J3mzA .

khangdoan03121993 avatar Sep 09 '16 09:09 khangdoan03121993

Never mind, I just posted the test text from your screenshot to be able to make copy/paste while tested. I haven't found the solution yet.

ghost avatar Sep 09 '16 09:09 ghost

Info for devs: I have added console.log(editor.getContent()); on init https://github.com/ThemeFuse/Unyson/blob/a072d728f6bb3ddb25012226c34d3939c98f9f07/framework/includes/option-types/wp-editor/static/scripts.js#L43-L87 and it shows <p>Hello</p><br/><p>World</p> so the removal happens somewhere deeper (in tinymce/js scripts)

ghost avatar Sep 09 '16 09:09 ghost

@khangdoan03121993 Thank you for admin/ftp details, I don't need them anymore. I can reproduce the problem on my localhost

ghost avatar Sep 09 '16 09:09 ghost

do I add the above code to the scripts file to remedy this issue? It is stripping out all my CSS/HTML. https://advancedroboticsgroup.com/available-arg-positions/ screen shot 2018-02-03 at 11 05 30 am

reverbunit avatar Feb 03 '18 17:02 reverbunit