-
-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
66 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Lute - 一款对中文语境优化的 Markdown 引擎,支持 Go 和 JavaScript | ||
// Copyright (c) 2019-present, b3log.org | ||
// | ||
// Lute is licensed under Mulan PSL v2. | ||
// You can use this software according to the terms and conditions of the Mulan PSL v2. | ||
// You may obtain a copy of Mulan PSL v2 at: | ||
// http://license.coscl.org.cn/MulanPSL2 | ||
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | ||
// See the Mulan PSL v2 for more details. | ||
|
||
package test | ||
|
||
import ( | ||
"github.com/88250/lute" | ||
"testing" | ||
) | ||
|
||
var markTests = []parseTest{ | ||
|
||
{"0", "==foo==\n", "<h2 id=\"foo\">foo</h2>\n"}, | ||
} | ||
|
||
func TestMark(t *testing.T) { | ||
luteEngine := lute.New() | ||
luteEngine.Mark = true | ||
|
||
for _, test := range markTests { | ||
html := luteEngine.MarkdownStr(test.name, test.from) | ||
if test.to != html { | ||
t.Fatalf("test case [%s] failed\nexpected\n\t%q\ngot\n\t%q\noriginal markdown text\n\t%q", test.name, test.to, html, test.from) | ||
} | ||
} | ||
} |