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

Only replace ampersands if they don't belong to another HTML entity #464

Merged
merged 1 commit into from
Mar 26, 2018
Merged

Only replace ampersands if they don't belong to another HTML entity #464

merged 1 commit into from
Mar 26, 2018

Conversation

stroborobo
Copy link
Contributor

Inline ampersands were previously replaced by &, even if they already belonged to another entity.

For example this:

Type: **'T -> 'U**

Became this:

<p>Type: <strong>'T -&amp;gt; 'U</strong></p>

But it should have been this:

<p>Type: <strong>'T -&gt; 'U</strong></p>

I'm fairly new to F#, so I hope this is PR is ok.

Copy link
Member

@wallymathieu wallymathieu left a comment

Choose a reason for hiding this comment

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

Looks like an improvement. I like that there are added tests 👍

@wallymathieu
Copy link
Member

What do you think @matthid ?

@matthid
Copy link
Member

matthid commented Mar 25, 2018

I'm not sure, what does the markdown spec say to this?

@stroborobo
Copy link
Contributor Author

stroborobo commented Mar 25, 2018

@matthid

All valid HTML entity references and numeric character references, except those occuring in code blocks and code spans, are recognized as such and treated as equivalent to the corresponding Unicode characters. Conforming CommonMark parsers need not store information about whether a particular character was represented in the source using a Unicode character or an entity reference.

https://spec.commonmark.org/0.28/#entity-and-numeric-character-references

@wallymathieu wallymathieu merged commit fb72e49 into fsprojects:master Mar 26, 2018
@stroborobo
Copy link
Contributor Author

Nice, thanks for merging, guys!

@wallymathieu
Copy link
Member

Thanks for the contribution @stroborobo ! 👍

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