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

Literal ampersand always expanding to & even when using --fverbatim-entities #118

Closed
evil-rob opened this issue Jun 27, 2020 · 2 comments
Labels

Comments

@evil-rob
Copy link

evil-rob commented Jun 27, 2020

Standard behavior without any flags seems to be to expand literal ampersands in the markdown input to produce & in the html output and to interpret other character entities in the input to produce unicode characters in the output. For example: # in the input produces # in the output.

$ echo -n 'entity: &' | md2html
<p>entity: &amp;</p>
$ echo -n 'entity: &amp;' | md2html
<p>entity: &amp;</p>
$ echo -n 'entity: &num;' | md2html
<p>entity: #</p>

This is fine, but when --fverbatim-entities is used, the literal ampersand in the character entity in the mardown input is still expanded to &amp;

$ echo -n 'entity: &' | md2html --fverbatim-entities
<p>entity: &amp;</p>
$ echo -n 'entity: &amp;' | md2html --fverbatim-entities
<p>entity: &amp;amp;</p>
$ echo -n 'entity: &num;' | md2html --fverbatim-entities
<p>entity: &amp;num;</p>

When --fverbatim-entities is given, I would expect that entities are not interpreted in any way, and instead passed through the markdown interpreter to produce the same entity in the html output.

I am using the current version installed from Manjaro's repositories.

$ md2html --version
0.4.4
$ cat /etc/*release
Manjaro Linux
DISTRIB_ID=ManjaroLinux
DISTRIB_RELEASE=20.0.3
DISTRIB_CODENAME=Lysia
DISTRIB_DESCRIPTION="Manjaro Linux"
Manjaro Linux
NAME="Manjaro Linux"
ID=manjaro
ID_LIKE=arch
BUILD_ID=rolling
PRETTY_NAME="Manjaro Linux"
ANSI_COLOR="32;2;24;144;200"
HOME_URL="https://manjaro.org/"
DOCUMENTATION_URL="https://wiki.manjaro.org/"
SUPPORT_URL="https://manjaro.org/"
BUG_REPORT_URL="https://bugs.manjaro.org/"
LOGO=manjarolinux
@mity mity added the bug label Jun 27, 2020
@mity
Copy link
Owner

mity commented Jun 27, 2020

Ack. Thanks for reporting it.

@mity mity closed this as completed in dec6e22 Jun 27, 2020
@evil-rob
Copy link
Author

Thanks for fixing. Works great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants