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

Fix CKEditor preview for content that is not wrapped in an HTML tag #782

Merged
merged 4 commits into from
Mar 7, 2019
Merged

Fix CKEditor preview for content that is not wrapped in an HTML tag #782

merged 4 commits into from
Mar 7, 2019

Conversation

YetiCGN
Copy link
Contributor

@YetiCGN YetiCGN commented Mar 4, 2019

The preview textarea for a property of type text_editor in Sulu breaks when the content is not wrapped in an HTML tag, e.g. just plain text without any HTML. This PR changes the code to fallback to the unmodified content in case it cannot be parsed as a DOM node by jQuery.

This occurs for example if a field is switched from text_area to text_editor and is not converted.

CKEditor will work just fine and will wrap the content in a new <p> tag when editing, but it doesn't get there if the preview errors out before. This change fixes the preview for plain text.

@YetiCGN
Copy link
Contributor Author

YetiCGN commented Mar 4, 2019

I think the npm version used in the tests is too old (v1.2.30) to support the caret version constraints. Current npm version is 6.8.

@YetiCGN
Copy link
Contributor Author

YetiCGN commented Mar 5, 2019

I give up trying to fix the Travis build. This setup is too old to fix in a few minutes. 😆

@alexander-schranz
Copy link
Member

@YetiCGN the karma build is broken since longer time, and can be ignored.

@wachterjohannes wachterjohannes merged commit f463544 into massiveart:master Mar 7, 2019
@YetiCGN YetiCGN deleted the hotfix/fix-rich-text-preview branch March 7, 2019 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants