evilstreak / markdown-js

A Markdown parser for javascript
7.7k stars 860 forks source link

Inline HTML is escaped? #314

Open oleersoy opened 5 years ago

oleersoy commented 5 years ago

Hi - Thanks for this awesome NPM package. I'm trying to use it in conjunction with AlanWalks TOC Generator.

I created a sample markdown file with HTML anchors:

TEST OUTLINE

- [Header 1](#header-1)
- [Header 2](#header-2)

<a id="markdown-header-1" name="header-1"></a>
## Header 1 
foo boo
<a id="markdown-header-2" name="header-2"></a>
## Header 2
zoo

When I run this through md2html the anchors are espaced:

ole@mki:~/component-site/src/test/md$ md2html test.md test2.html
<p>TEST OUTLINE</p>

<ul><li><a href="#header-1">Header 1</a></li><li><a href="#header-2">Header 2</a></li></ul>

<p>&lt;a id=&quot;markdown-header-1&quot; name=&quot;header-1&quot;&gt;&lt;/a&gt;</p>

<h2>Header 1</h2>

<p>flsdjfalsdjf</p>

<p>&lt;a id=&quot;markdown-header-2&quot; name=&quot;header-2&quot;&gt;&lt;/a&gt;</p>

<h2>Header 2</h2>

Is the a way to turn the escaping off?

TIA, Ole

gaecoli commented 2 years ago

+1

clz619 commented 2 years ago

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。