Skip to content

Commit 2a88e96

Browse files
committed
🎨 Improve browser clipping extension siyuan-note/siyuan#14431
1 parent 25a9720 commit 2a88e96

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

h2m.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,7 @@ func (lute *Lute) genASTByDOM(n *html.Node, tree *parse.Tree) {
11321132
}
11331133
}
11341134

1135-
if title := strings.TrimSpace(util.DomAttrValue(n, "title")); "" != title {
1135+
if title := strings.TrimSpace(util.DomAttrValue(n, "title")); "" != title && tree.Context.Tip.IsBlock() {
11361136
// 转换为行级备注 https://github.com/siyuan-note/siyuan/issues/13998
11371137
node.Type = ast.NodeTextMark
11381138
node.TextMarkType = "inline-memo"

javascript/lute.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

javascript/lute.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/h2m_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818

1919
var html2MdTests = []parseTest{
2020

21+
{"221", "<a href=\"https://github.com/Siunami/Latticework\">Latticework <span class=\"badge badge-notification clicks\" title=\"2 次点击\">2</span></a>", "[Latticework 2](https://github.com/Siunami/Latticework)\n"},
2122
{"220", "<p><strong>foo </strong>bar</p>", "**foo \u200b**bar\n"},
2223
{"219", "<ul><li>Via a distributed file system such as a<span>&nbsp;</span><a href=\"https://en.wikipedia.org/wiki/Network-attached_storage\">NAS server</a>,<span>&nbsp;</span><a href=\"https://en.wikipedia.org/wiki/Network_File_System\">NFS</a>,<span>&nbsp;</span><a href=\"https://en.wikipedia.org/wiki/File_Transfer_Protocol\">FTP</a>, or<span>&nbsp;</span><a href=\"https://linux.die.net/man/1/rsync\">rsync</a>;</li></ul>", "* Via a distributed file system such as a [NAS server](https://en.wikipedia.org/wiki/Network-attached_storage), [NFS](https://en.wikipedia.org/wiki/Network_File_System), [FTP](https://en.wikipedia.org/wiki/File_Transfer_Protocol), or [rsync](https://linux.die.net/man/1/rsync);\n"},
2324
{"218", "<p>好的,我这里有一个比较复杂的数学公式:</p>\n<p>$$\\oint_C \\left( \\nabla \\times \\mathbf{F} \\right) \\cdot d\\mathbf{r} = \\iint_S \\left( \\nabla \\times \\mathbf{F} \\right) \\cdot \\mathbf{n} , dS = \\iint_S \\mathbf{curl}(\\mathbf{F}) \\cdot \\mathbf{n} , dS$$</p>\n<p>这是斯托克斯定理(Stokes' Theorem)的表达式,它表明闭合曲线C的线积分等于以该曲线为边界的曲面S上旋度的面积分。这在电磁学、流体动力学和矢量场理论中有广泛应用。</p>", "好的,我这里有一个比较复杂的数学公式:\n\n$$\n\\oint_C \\left( \\nabla \\times \\mathbf{F} \\right) \\cdot d\\mathbf{r} = \\iint_S \\left( \\nabla \\times \\mathbf{F} \\right) \\cdot \\mathbf{n} , dS = \\iint_S \\mathbf{curl}(\\mathbf{F}) \\cdot \\mathbf{n} , dS\n$$\n\n这是斯托克斯定理(Stokes' Theorem)的表达式,它表明闭合曲线 C 的线积分等于以该曲线为边界的曲面 S 上旋度的面积分。这在电磁学、流体动力学和矢量场理论中有广泛应用。\n"},

0 commit comments

Comments
 (0)