Skip to content

Commit

Permalink
🎨 跟进 CommonMark 0.31 #202
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Jan 29, 2024
1 parent b1f7b99 commit d56503d
Show file tree
Hide file tree
Showing 6 changed files with 1,671 additions and 1,683 deletions.
4 changes: 2 additions & 2 deletions javascript/lute.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion javascript/lute.min.js.map

Large diffs are not rendered by default.

20 changes: 2 additions & 18 deletions parse/inline_html.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,27 +307,11 @@ func (t *Tree) parseHTMLComment(tokens []byte) (valid bool, remains, comment []b
return
}

comment = append(comment, tokens[0], tokens[1], tokens[2])
tokens = tokens[3:]
length := len(tokens)
if 2 > length {
return
}
if lex.ItemGreater == tokens[0] {
return
}
if lex.ItemHyphen == tokens[0] && lex.ItemGreater == tokens[1] {
return
}
var token byte
var i int
for ; i < length; i++ {
token = tokens[i]
comment = append(comment, token)
if i <= length-2 && lex.ItemHyphen == token && lex.ItemHyphen == tokens[i+1] {
break
}
if i <= length-3 && lex.ItemHyphen == token && lex.ItemHyphen == tokens[i+1] && lex.ItemGreater == tokens[i+2] {
comment = append(comment, tokens[i])
if i <= length-3 && lex.ItemHyphen == tokens[i] && lex.ItemHyphen == tokens[i+1] && lex.ItemGreater == tokens[i+2] {
break
}
}
Expand Down
Loading

0 comments on commit d56503d

Please sign in to comment.