Skip to content

Commit

Permalink
✨ 支持 ==mark== 高亮语法 #84
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Aug 17, 2020
1 parent 03ce9a1 commit 98b8521
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ast/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ const (
NodeBlockRefSpace NodeType = 432 // 内容块 ID 和内容块文本之间的空格
NodeBlockRefText NodeType = 433 // 内容块文本

// 支持 ==mark== 高亮语法 https://github.com/88250/lute/issues/84
// 支持 ==Mark== 标记语法 https://github.com/88250/lute/issues/84
NodeMark NodeType = 450 // 标记
NodeMarkOpenMarker NodeType = 451 // 开始标记标记符 ==
NodeMarkCloseMarker NodeType = 452 // 结束标记标记符 ==
Expand Down
2 changes: 2 additions & 0 deletions test/mark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (

var markTests = []parseTest{

{"8", "==[*foo*](bar)==\n", "<p><mark><a href=\"bar\"><em>foo</em></a></mark></p>\n"},
{"7", "==*[foo](bar)*==\n", "<p><mark><em><a href=\"bar\">foo</a></em></mark></p>\n"},
{"6", "==*[foo](bar)==*\n", "<p><mark>*<a href=\"bar\">foo</a></mark>*</p>\n"},
{"5", "==[foo](bar)==\n", "<p><mark><a href=\"bar\">foo</a></mark></p>\n"},
Expand All @@ -43,6 +44,7 @@ func TestMark(t *testing.T) {

var markDisableTests = []parseTest{

{"5", "==[*foo*](bar)==\n", "<p>==<a href=\"bar\"><em>foo</em></a>==</p>\n"},
{"4", "==*[foo](bar)*==\n", "<p>==<em><a href=\"bar\">foo</a></em>==</p>\n"},
{"3", "[==foo==](bar)\n", "<p><a href=\"bar\">==foo==</a></p>\n"},
{"2", "*=foo*=\n", "<p><em>=foo</em>=</p>\n"},
Expand Down

0 comments on commit 98b8521

Please sign in to comment.