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

Escape specific html tags in P elements when quoting to markdown #23

Merged
merged 2 commits into from
Aug 4, 2021

Conversation

akenneth
Copy link
Contributor

@akenneth akenneth commented Aug 4, 2021

This PR adds a small fix to support escaping html tags inside a P element when converting to markdown.
Before this change if a text contained an escaped html tag like:

<pre> Hello </pre>

It would be quoted as

 Hello 

See the before and after in this image, where the top comment is the one being quoted.
Notice how the middle comment (before this change) wrongfully converts <pre> nothing </pre> into a highlighted part with only the text nothing in it:
image

I decided to match for a specific list of tags pre|strong|weak|em for now in order to minimize the risk of this capturing some things it shouldn't.

Please let me know if any other tags should be added here.

@akenneth akenneth requested a review from a team as a code owner August 4, 2021 10:07
@akenneth akenneth changed the title Escape specific html tags in P elements Escape specific html tags in P elements when quoting to markdown Aug 4, 2021
@akenneth
Copy link
Contributor Author

akenneth commented Aug 4, 2021

I wasn't sure if I should bump the version in package.json
Happy to get some advice about it :)

(and if there are any other steps in order to publish this once it is accepted)

test/test.js Outdated Show resolved Hide resolved
Copy link

@anleac anleac left a comment

Choose a reason for hiding this comment

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

Looks good on my end - I think we will need to bump the version but lets see what @github/web-systems-reviewers says

Copy link
Contributor

@dgreif dgreif left a comment

Choose a reason for hiding this comment

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

🐛 🔨

@dgreif
Copy link
Contributor

dgreif commented Aug 4, 2021

No need to bump the version, I can do that when I release it.

@dgreif dgreif merged commit e205f02 into github:main Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants