Skip to content

Commit

Permalink
🎨 Improve HTML code element clipping siyuan-note/siyuan#11401
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed May 16, 2024
1 parent 8daf804 commit 3172f93
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions h2m.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,9 @@ func (lute *Lute) genASTByDOM(n *html.Node, tree *parse.Tree) {

allSpan := true
for c := n.FirstChild; nil != c; c = c.NextSibling {
if html.TextNode == c.Type {
continue
}
if atom.Span != c.DataAtom {
allSpan = false
break
Expand Down
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.

1 change: 1 addition & 0 deletions test/h2m_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (

var html2MdTests = []parseTest{

{"103", "<code class=\"docutils literal notranslate\"><span class=\"pre\">BeautifulSoup(markup,</span> <span class=\"pre\">\"lxml\")</span></code>", "`BeautifulSoup(markup, \"lxml\")`\n"},
{"102", "<code><code class=\"idl\"><a data-link-type=\"idl\" href=\"#node\" id=\"ref-for-node③⑧\" aria-expanded=\"false\">Node</a></code> . <code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-node-element_node\" id=\"ref-for-dom-node-element_node①\">ELEMENT_NODE</a></code></code>", "[`Node`](#node) . [`ELEMENT_NODE`](#dom-node-element_node)\n"},
{"101", "<p><code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-event-capturing_phase\" id=\"ref-for-dom-event-capturing_phase\" aria-expanded=\"false\">CAPTURING_PHASE</a></code> to <code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-event-bubbling_phase\" id=\"ref-for-dom-event-bubbling_phase\">BUBBLING_PHASE</a></code> </p>", "[`CAPTURING_PHASE`](#dom-event-capturing_phase) to [`BUBBLING_PHASE`](#dom-event-bubbling_phase)\n"},
{"100", "<h3 class=\"heading settled\" data-level=\"2.2\" id=\"interface-event\"><span class=\"secno\">2.2. </span><span class=\"content\">Interface <code class=\"idl\"><a data-link-type=\"idl\" href=\"#event\" id=\"ref-for-event①\">Event</a></code></span><a class=\"self-link\" href=\"#interface-event\"></a></h3>", "### 2.2. **Interface** [`Event`](#event)\n"},
Expand Down

0 comments on commit 3172f93

Please sign in to comment.