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

Add HTML Comment Tag Support #15

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Parser.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cli.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/Parser.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ class Parser
# release holder
releaseHolder: (text, clearHolders = yes) ->
deep = 0

while (text.indexOf "\r") >= 0 and deep < 10
text = str_replace (array_keys @holders), (array_values @holders), text
deep += 1
Expand Down Expand Up @@ -199,6 +198,10 @@ class Parser
else
htmlspecialchars matches[0]

# comment
text = text.replace /<!--.*-->/ig, (matches...) =>
@makeHolder matches[0]

text = str_replace ['<', '>'], ['&lt;', '&gt;'], text

# footnote
Expand Down Expand Up @@ -251,7 +254,6 @@ class Parser

text = @call 'afterParseInlineBeforeRelease', text
text = @releaseHolder text, clearHolders

text = @call 'afterParseInline', text

text
Expand Down