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

Can unescaped heading text be used? #246

Closed
2-3-5-7 opened this issue May 24, 2023 · 1 comment · Fixed by #260
Closed

Can unescaped heading text be used? #246

2-3-5-7 opened this issue May 24, 2023 · 1 comment · Fixed by #260

Comments

@2-3-5-7
Copy link

2-3-5-7 commented May 24, 2023

I have a heading like this

## 1.1 aaa/bbb
after render it became
<h2 id="1-1-aaa-x2F-bbb"><a href="#1-1-aaa-x2F-bbb" class="headerlink" title="1.1 aaa/bbb"></a>1.1 aaa/bbb</h2>

it should be
<h2 id="1-1-aaa-bbb" ><a href="#1-1-aaa-bbb" class="headerlink" title="1.1 aaa/bbb"></a>1.1 aaa/bbb</h2>

fixed by modifying the renderer.js file

// use unescaped heading text
heading(escaped_text, level, text) {
const { anchorAlias, headerIds, modifyAnchors } = this.options;
const { _headingId } = this;
...
}

@stevenjoezhang
Copy link
Member

It's escaped here:

text = escape(isSmarty ? smartypants(cap[0], quotes) : cap[0]);

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 a pull request may close this issue.

2 participants