Skip to content

Commit

Permalink
🎨 Update md2BlockDOM
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Jan 11, 2024
1 parent e9840a3 commit 7e08327
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion 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.

4 changes: 2 additions & 2 deletions protyle.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ func (lute *Lute) BlockDOM2InlineBlockDOM(vHTML string) (vIHTML string) {
return
}

func (lute *Lute) Md2BlockDOM(markdown string, reserveEmptyParagraph bool) (vHTML string) {
tree := parse.Parse("", []byte(markdown), lute.ParseOptions)
func (lute *Lute) Md2BlockDOM(markdown string, reserveEmptyParagraph bool) (vHTML string, tree *parse.Tree) {
tree = parse.Parse("", []byte(markdown), lute.ParseOptions)
parse.NestedInlines2FlattedSpansHybrid(tree, false)
if reserveEmptyParagraph {
ast.Walk(tree.Root, func(n *ast.Node, entering bool) ast.WalkStatus {
Expand Down
2 changes: 1 addition & 1 deletion test/m2p_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func TestMd2BlockDOM(t *testing.T) {

ast.Testing = true
for _, test := range md2BlockDOMTests {
result := luteEngine.Md2BlockDOM(test.from, true)
result, _ := luteEngine.Md2BlockDOM(test.from, true)
if test.to != result {
t.Fatalf("test case [%s] failed\nexpected\n\t%q\ngot\n\t%q\noriginal html\n\t%q", test.name, test.to, result, test.from)
}
Expand Down

0 comments on commit 7e08327

Please sign in to comment.