Skip to content

Commit

Permalink
🎨 Protyle Markdown syntax switch no longer affects clip/paste HTML pa…
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Oct 29, 2024
1 parent 982dbd9 commit 435765a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions h2m.go
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ func (lute *Lute) genASTByDOM(n *html.Node, tree *parse.Tree) {
tree.Context.Tip.AppendChild(&ast.Node{Type: ast.NodeText, Tokens: util.StrToBytes(editor.Zwsp)})
}

if !lute.ParseOptions.InlineAsterisk && !lute.ParseOptions.InlineUnderscore {
if !lute.ParseOptions.InlineAsterisk || !lute.ParseOptions.InlineUnderscore {
node.Type = ast.NodeHTMLTag
node.AppendChild(&ast.Node{Type: ast.NodeHTMLTagOpen, Tokens: util.StrToBytes("<em>")})
} else {
Expand All @@ -623,7 +623,7 @@ func (lute *Lute) genASTByDOM(n *html.Node, tree *parse.Tree) {
tree.Context.Tip.AppendChild(&ast.Node{Type: ast.NodeText, Tokens: util.StrToBytes(editor.Zwsp)})
}

if !lute.ParseOptions.InlineAsterisk && !lute.ParseOptions.InlineUnderscore {
if !lute.ParseOptions.InlineAsterisk || !lute.ParseOptions.InlineUnderscore {
node.Type = ast.NodeHTMLTag
node.AppendChild(&ast.Node{Type: ast.NodeHTMLTagOpen, Tokens: util.StrToBytes("<strong>")})
} else {
Expand Down Expand Up @@ -1246,15 +1246,15 @@ func (lute *Lute) genASTByDOM(n *html.Node, tree *parse.Tree) {

switch n.DataAtom {
case atom.Em, atom.I:
if !lute.ParseOptions.InlineAsterisk && !lute.ParseOptions.InlineUnderscore {
if !lute.ParseOptions.InlineAsterisk || !lute.ParseOptions.InlineUnderscore {
node.AppendChild(&ast.Node{Type: ast.NodeHTMLTagClose, Tokens: util.StrToBytes("</em>")})
} else {
node.Type = ast.NodeEmphasis
node.AppendChild(&ast.Node{Type: ast.NodeEmA6kCloseMarker, Tokens: util.StrToBytes("*")})
}
appendSpace(n, tree, lute)
case atom.Strong, atom.B:
if !lute.ParseOptions.InlineAsterisk && !lute.ParseOptions.InlineUnderscore {
if !lute.ParseOptions.InlineAsterisk || !lute.ParseOptions.InlineUnderscore {
node.AppendChild(&ast.Node{Type: ast.NodeHTMLTagClose, Tokens: util.StrToBytes("</strong>")})
} else {
node.AppendChild(&ast.Node{Type: ast.NodeStrongA6kCloseMarker, Tokens: util.StrToBytes("**")})
Expand Down
2 changes: 1 addition & 1 deletion javascript/lute.min.js

Large diffs are not rendered by default.

0 comments on commit 435765a

Please sign in to comment.