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

Allow user to specify a function to escape the output #217

Merged
merged 3 commits into from
Mar 18, 2021
Merged

Allow user to specify a function to escape the output #217

merged 3 commits into from
Mar 18, 2021

Conversation

mmm111mmm
Copy link
Contributor

README.md says you can specify an esc function to customise escaping of the output.

However, this isn't the case. Your esc function argument is roundly ignored. I've changed this in the XML and HTML parsers so it's now taken into account.

The docs used to say the esc function takes two parameters, the string and whether it should be escaped, but this is not the case in the codebase, so I've changed the README.md

newfivefour added 3 commits March 16, 2021 12:09
The function doesn't take a second parameter.

And you can't specify this function, currently.
(See next commit)
This is useful if you don't want to escape a quotation mark into `&quot`, for example, because a later parser will parse `&` into `&amp` and mess up your output.

Besides, the docs claim you can do this, but you cannot currently.
This is useful if you don't want to escape a quotation mark into `&quot`, for example, because a later parser will parse `&` into `&amp` and mess up your output.

Besides, the docs claim you can do this, but you cannot currently.
@mmm111mmm mmm111mmm changed the title Allow use to specify a function to escape the output Allow user to specify a function to escape the output Mar 16, 2021
@jgm jgm merged commit 80f63d1 into commonmark:master Mar 18, 2021
@jgm
Copy link
Member

jgm commented Mar 18, 2021

Thanks!

taku0 added a commit to taku0/cmark-el that referenced this pull request Apr 3, 2021
(commonmark/commonmark.js#217)

* Correct `esc` function description.  The function doesn't take a
second parameter.
* HtmlRenderer: Allow user to specify a custom escape function, as the
docs say you can.

commonmark/commonmark.js@80f63d1
Author: newfivefour <newfivefour@users.noreply.github.com>
Date:   Thu Mar 18 04:05:23 2021 +0300
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.

2 participants