Skip to content

Add an option to disable escapeHtmlEntities in codespan, etc. #3932

@roj234

Description

@roj234

Describe the feature
Add an option to disable escapeHtmlEntities, such as escapeHtml: false

Why is this feature necessary?
Currently, some render function like codespan will always call escapeHtmlEntities
If I provide a HTML-escaped markdown, it will be escaped again, and no normal way to prevent it.

Describe alternatives you've considered
This is a temporary solution without change dependency's code

const marked = new Marked(...);

markdown.render("");
const omg = markdown.defaults.renderer.options.tokenizer.rules.other;
omg.escapeTest = omg.escapeTestNoEncode = /^\\0/; // affect all instances

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions