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 code tags including styles from block elements #916

Merged
merged 3 commits into from
Feb 1, 2023
Merged

Conversation

samclarke
Copy link
Owner

@samclarke samclarke commented Jan 27, 2023

Improves the special case handling for code tags so they only include text content. Also fixes BBCode formats paste handling to not convert styles if parent is a code tag.

Fixes #915

@samclarke samclarke added this to the v3.2.0 milestone Jan 27, 2023
@github-actions github-actions bot added the fix label Jan 27, 2023
Improves the special case handling for code tags so they only include
text content.

Fixes #915
Emoticons should still be converted if they find their way into a code
tag as this is the current behaviour.

vChildren will either be an array or undefined so no need to check type.

hasCodeParent is now always passed so make that second argument.

Adding text node check to if statement removes need for early return
nodeType check.
Copy link
Collaborator

@live627 live627 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@samclarke samclarke merged commit e4c47d0 into master Feb 1, 2023
@samclarke samclarke deleted the fix-915 branch February 1, 2023 15:53
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.

Formatting retained when pasting into code blocks
2 participants