mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-02 04:12:15 +08:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
217a4e2a0a
@ -1111,6 +1111,8 @@
|
||||
"export28": "نص العلامة المائية المخصصة أو مسار ملف العلامة المائية",
|
||||
"export29": "موقع العلامة المائية، حجمها وأسلوبها، إلخ",
|
||||
"export30": "صورة العلامة المائية للملف المصدّر",
|
||||
"export31": "تصدير تعليقات السطر",
|
||||
"export32": "عند التمكين، سيتم تصدير تعليقات السطر كحروف مرتفعة",
|
||||
"theme11": "استخدام السمة في الوضع الفاتح",
|
||||
"theme12": "استخدام السمة في الوضع الداكن",
|
||||
"theme2": "تحديد الرموز المستخدمة في واجهة المستخدم",
|
||||
|
@ -1111,6 +1111,8 @@
|
||||
"export28": "Wasserzeichentext oder Wasserzeichen-Dateipfad",
|
||||
"export29": "Wasserzeichenposition, Größe und Stil usw.",
|
||||
"export30": "Exportieren Sie Bildwasserzeichen",
|
||||
"export31": "Zeilenkommentare exportieren",
|
||||
"export32": "Wenn aktiviert, werden Zeilenkommentare als Hochgestellt exportiert",
|
||||
"theme11": "Verwenden Sie das Thema im Hellmodus",
|
||||
"theme12": "Verwenden Sie das Thema im Dunkelmodus",
|
||||
"theme2": "Wählen Sie die in der Benutzeroberfläche verwendeten Icons aus",
|
||||
|
@ -1111,6 +1111,8 @@
|
||||
"export28": "Watermark text or watermark file path",
|
||||
"export29": "Watermark position, size and style, etc.",
|
||||
"export30": "Export image watermark",
|
||||
"export31": "Export inline memos",
|
||||
"export32": "When enabled, inline memos will be exported as superscript",
|
||||
"theme11": "Use theme in light mode",
|
||||
"theme12": "Use theme in dark mode",
|
||||
"theme2": "Select the icons used in the user interface",
|
||||
|
@ -1111,6 +1111,8 @@
|
||||
"export28": "Texto de marca de agua o ruta del archivo de marca de agua",
|
||||
"export29": "Posición, tamaño y estilo de la marca de agua, etc.",
|
||||
"export30": "Exportar marca de agua de imagen",
|
||||
"export31": "Exportar anotaciones de línea",
|
||||
"export32": "Cuando esté habilitado, las anotaciones de línea se exportarán como superíndice",
|
||||
"theme11": "Usar tema en modo claro",
|
||||
"theme12": "Usar tema en modo oscuro",
|
||||
"theme2": "Selecciona los iconos utilizados en la interfaz de usuario",
|
||||
|
@ -1111,6 +1111,8 @@
|
||||
"export28": "Texte du filigrane ou chemin du fichier de filigrane",
|
||||
"export29": "Position, taille et style du filigrane, etc.",
|
||||
"export30": "Exporter le filigrane de l'image",
|
||||
"export31": "Exporter les annotations de ligne",
|
||||
"export32": "Une fois activé, les annotations de ligne seront exportées en exposant",
|
||||
"theme11": "Utiliser le thème en mode Clair",
|
||||
"theme12": "Utiliser le thème en mode sombre",
|
||||
"theme2": "Sélectionnez les icônes utilisées dans l'interface utilisateur",
|
||||
|
@ -1111,6 +1111,8 @@
|
||||
"export28": "טקסט סימן מים או נתיב קובץ סימן מים",
|
||||
"export29": "מיקום סימן מים, גודל וסגנון, וכו'",
|
||||
"export30": "ייצוא סימן מים לתמונה",
|
||||
"export31": "ייצוא הערות שורה",
|
||||
"export32": "כאשר מופעל, הערות השורה ייוצאו ככתב עילי",
|
||||
"theme11": "שימוש בנושא במצב בהיר",
|
||||
"theme12": "שימוש בנושא במצב כהה",
|
||||
"theme2": "בחר את האייקונים בשימוש בממשק המשתמש",
|
||||
|
@ -1111,6 +1111,8 @@
|
||||
"export28": "Testo della filigrana o percorso del file della filigrana",
|
||||
"export29": "Posizione, dimensione e stile della filigrana",
|
||||
"export30": "Esporta filigrana immagine",
|
||||
"export31": "Esporta annotazioni di riga",
|
||||
"export32": "Quando abilitato, le annotazioni di riga verranno esportate come apice",
|
||||
"theme11": "Usa il tema in modalità chiara",
|
||||
"theme12": "Usa il tema in modalità scura",
|
||||
"theme2": "Seleziona le icone utilizzate nell'interfaccia utente",
|
||||
|
@ -1111,6 +1111,8 @@
|
||||
"export28": "透かしテキストまたは透かし画像ファイルのパス",
|
||||
"export29": "透かしの位置、サイズ、スタイルなど",
|
||||
"export30": "画像に透かしを書き出す",
|
||||
"export31": "行レベルの注釈をエクスポート",
|
||||
"export32": "有効化すると、行レベルの注釈が上付き文字としてエクスポートされます",
|
||||
"theme11": "ライトモードで使われるテーマ",
|
||||
"theme12": "ダークモードで使われるテーマ",
|
||||
"theme2": "ユーザーインターフェースで使用するアイコン",
|
||||
|
@ -1111,6 +1111,8 @@
|
||||
"export28": "Tekst znaku wodnego lub ścieżka pliku znaku wodnego",
|
||||
"export29": "Pozycja znaku wodnego, rozmiar i styl itp.",
|
||||
"export30": "Eksportuj obraz znak wodny",
|
||||
"export31": "Eksportuj przypisy wierszowe",
|
||||
"export32": "Po włączeniu przypisy wierszowe będą eksportowane jako indeks górny",
|
||||
"theme11": "Użyj motywu w trybie jasnym",
|
||||
"theme12": "Użyj motywu w trybie ciemnym",
|
||||
"theme2": "Wybierz ikony używane w interfejsie użytkownika",
|
||||
|
@ -1111,6 +1111,8 @@
|
||||
"export28": "Текст водяного знака или путь к файлу водяного знака",
|
||||
"export29": "Положение, размер и стиль водяного знака и т. д.",
|
||||
"export30": "Экспорт изображения водяного знака",
|
||||
"export31": "Экспорт строковых примечаний",
|
||||
"export32": "После включения строковые примечания будут экспортироваться в виде верхнего индекса",
|
||||
"theme11": "Использовать тему в светлом режиме",
|
||||
"theme12": "Использовать тему в темном режиме",
|
||||
"theme2": "Выберите значки, используемые в интерфейсе",
|
||||
|
@ -1111,6 +1111,8 @@
|
||||
"export28": "浮水印文字或浮水印檔案路徑",
|
||||
"export29": "浮水印位置、大小和樣式等",
|
||||
"export30": "匯出圖片浮水印",
|
||||
"export31": "導出行級備註",
|
||||
"export32": "啟用後行級備註將會導出為上標內容",
|
||||
"theme11": "淺色模式下使用主題",
|
||||
"theme12": "深色模式下使用主題",
|
||||
"theme2": "選擇外觀使用的圖示",
|
||||
|
@ -1111,6 +1111,8 @@
|
||||
"export28": "水印文本或水印文件路径",
|
||||
"export29": "水印位置、大小和样式等",
|
||||
"export30": "导出图片水印",
|
||||
"export31": "导出行级备注",
|
||||
"export32": "启用后行级备注将会导出为上标内容",
|
||||
"theme11": "明亮模式下使用主题",
|
||||
"theme12": "暗黑模式下使用主题",
|
||||
"theme2": "选择外观使用的图标",
|
||||
|
@ -39,6 +39,14 @@ export const exportConfig = {
|
||||
<span class="fn__space"></span>
|
||||
<input class="b3-switch fn__flex-center" id="markdownYFM" type="checkbox"${window.siyuan.config.export.markdownYFM ? " checked" : ""}/>
|
||||
</label>
|
||||
<label class="fn__flex b3-label">
|
||||
<div class="fn__flex-1">
|
||||
${window.siyuan.languages.export31}
|
||||
<div class="b3-label__text">${window.siyuan.languages.export32}</div>
|
||||
</div>
|
||||
<span class="fn__space"></span>
|
||||
<input class="b3-switch fn__flex-center" id="inlineMemo" type="checkbox"${window.siyuan.config.export.inlineMemo ? " checked" : ""}/>
|
||||
</label>
|
||||
<div class="fn__flex b3-label config__item">
|
||||
<div class="fn__flex-1">
|
||||
${window.siyuan.languages.ref}
|
||||
@ -200,6 +208,7 @@ export const exportConfig = {
|
||||
paragraphBeginningSpace: (exportConfig.element.querySelector("#paragraphBeginningSpace") as HTMLInputElement).checked,
|
||||
addTitle: (exportConfig.element.querySelector("#addTitle") as HTMLInputElement).checked,
|
||||
markdownYFM: (exportConfig.element.querySelector("#markdownYFM") as HTMLInputElement).checked,
|
||||
inlineMemo: (exportConfig.element.querySelector("#inlineMemo") as HTMLInputElement).checked,
|
||||
blockRefMode: parseInt((exportConfig.element.querySelector("#blockRefMode") as HTMLSelectElement).value, 10),
|
||||
blockEmbedMode: parseInt((exportConfig.element.querySelector("#blockEmbedMode") as HTMLSelectElement).value, 10),
|
||||
fileAnnotationRefMode: parseInt((exportConfig.element.querySelector("#fileAnnotationRefMode") as HTMLSelectElement).value, 10),
|
||||
|
@ -121,6 +121,8 @@ const genUploadedLabel = (responseText: string, protyle: IProtyle) => {
|
||||
}
|
||||
let successFileText = "";
|
||||
const keys = Object.keys(response.data.succMap);
|
||||
// 插入多个资源文件时按文件名自然升序排列 Use natural ascending order when inserting multiple assets https://github.com/siyuan-note/siyuan/issues/14643
|
||||
keys.sort((a, b) => a.localeCompare(b, undefined, { numeric: true }));
|
||||
const avAssets: IAVCellAssetValue[] = [];
|
||||
let hasImage = false;
|
||||
keys.forEach((key, index) => {
|
||||
|
4
app/src/types/config.d.ts
vendored
4
app/src/types/config.d.ts
vendored
@ -539,6 +539,10 @@ declare namespace Config {
|
||||
* Whether to add YAML Front Matter when exporting to Markdown
|
||||
*/
|
||||
markdownYFM: boolean;
|
||||
/**
|
||||
* Whether to export the inline memo
|
||||
*/
|
||||
inlineMemo: boolean;
|
||||
/**
|
||||
* Pandoc executable file path
|
||||
*/
|
||||
|
2
app/stage/protyle/js/lute/lute.min.js
vendored
2
app/stage/protyle/js/lute/lute.min.js
vendored
File diff suppressed because one or more lines are too long
@ -34,6 +34,7 @@ type Export struct {
|
||||
FileAnnotationRefMode int `json:"fileAnnotationRefMode"` // 文件标注引用导出模式,0:文件名 - 页码 - 锚文本,1:仅锚文本
|
||||
PandocBin string `json:"pandocBin"` // Pandoc 可执行文件路径
|
||||
MarkdownYFM bool `json:"markdownYFM"` // Markdown 导出时是否添加 YAML Front Matter https://github.com/siyuan-note/siyuan/issues/7727
|
||||
InlineMemo bool `json:"inlineMemo"` // 是否导出行级备忘录 https://github.com/siyuan-note/siyuan/issues/14605
|
||||
PDFFooter string `json:"pdfFooter"` // PDF 导出时页脚内容
|
||||
DocxTemplate string `json:"docxTemplate"` // Docx 导出时模板文件路径
|
||||
PDFWatermarkStr string `json:"pdfWatermarkStr"` // PDF 导出时水印文本或水印文件路径
|
||||
@ -55,6 +56,7 @@ func NewExport() *Export {
|
||||
FileAnnotationRefMode: 0,
|
||||
PandocBin: "",
|
||||
MarkdownYFM: false,
|
||||
InlineMemo: false,
|
||||
PDFFooter: "%page / %pages",
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ require (
|
||||
github.com/88250/epub v0.0.0-20230830085737-c19055cd1f48
|
||||
github.com/88250/go-humanize v0.0.0-20240424102817-4f78fac47ea7
|
||||
github.com/88250/gulu v1.2.3-0.20250227144607-7f4570b0d689
|
||||
github.com/88250/lute v1.7.7-0.20250412031715-89bcc49cf941
|
||||
github.com/88250/lute v1.7.7-0.20250420164316-7205b90d8833
|
||||
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1
|
||||
github.com/ClarkThan/ahocorasick v0.0.0-20231011042242-30d1ef1347f4
|
||||
github.com/ConradIrwin/font v0.2.1
|
||||
|
@ -14,8 +14,8 @@ github.com/88250/go-sqlite3 v1.14.13-0.20231214121541-e7f54c482950 h1:Pa5hMiBceT
|
||||
github.com/88250/go-sqlite3 v1.14.13-0.20231214121541-e7f54c482950/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
|
||||
github.com/88250/gulu v1.2.3-0.20250227144607-7f4570b0d689 h1:39y5g7vnFAIcXhTN3IXPk7h2xBhC4a9hBTykDhHJqRY=
|
||||
github.com/88250/gulu v1.2.3-0.20250227144607-7f4570b0d689/go.mod h1:c8uVw25vW2W4dhJ/j4iYsX5H1hc19spim266jO5x2hU=
|
||||
github.com/88250/lute v1.7.7-0.20250412031715-89bcc49cf941 h1:ocZf/jbzpbT2s3cKl00Z2h6iEz+OirD7+NYd2Gdzmjo=
|
||||
github.com/88250/lute v1.7.7-0.20250412031715-89bcc49cf941/go.mod h1:WYyUw//5yVw9BJnoVjx7rI/3szsISxNZCYGOqTIrV0o=
|
||||
github.com/88250/lute v1.7.7-0.20250420164316-7205b90d8833 h1:RbVRyYKUlky2hTAE9iI++uSt0p4VFeHSiQqds8qrEYY=
|
||||
github.com/88250/lute v1.7.7-0.20250420164316-7205b90d8833/go.mod h1:WYyUw//5yVw9BJnoVjx7rI/3szsISxNZCYGOqTIrV0o=
|
||||
github.com/88250/pdfcpu v0.3.14-0.20241201033812-5a93b7586a01 h1:AcFe63RXjIh1XtX/dc4Es3U8bYKjlEkvavHd1nFBOHM=
|
||||
github.com/88250/pdfcpu v0.3.14-0.20241201033812-5a93b7586a01/go.mod h1:fVfOloBzs2+W2VJCCbq60XIxc3yJHAZ0Gahv1oO0gyI=
|
||||
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1 h1:48T899JQDwyyRu9yXHePYlPdHtpJfrJEUGBMH3SMBWY=
|
||||
|
@ -272,7 +272,7 @@ func Export2Liandi(id string) (err error) {
|
||||
".md", 3, 1, 1,
|
||||
"#", "#",
|
||||
"", "",
|
||||
false, nil, true, &map[string]*parse.Tree{})
|
||||
false, false, nil, true, &map[string]*parse.Tree{})
|
||||
result := gulu.Ret.NewResult()
|
||||
request := httpclient.NewCloudRequest30s()
|
||||
request = request.
|
||||
@ -578,7 +578,7 @@ func Preview(id string) (retStdHTML string) {
|
||||
blockRefMode, Conf.Export.BlockEmbedMode, Conf.Export.FileAnnotationRefMode,
|
||||
"#", "#", // 这里固定使用 # 包裹标签,否则无法正确解析标签 https://github.com/siyuan-note/siyuan/issues/13857
|
||||
Conf.Export.BlockRefTextLeft, Conf.Export.BlockRefTextRight,
|
||||
Conf.Export.AddTitle, true, true, &map[string]*parse.Tree{})
|
||||
Conf.Export.AddTitle, Conf.Export.InlineMemo, true, true, &map[string]*parse.Tree{})
|
||||
luteEngine := NewLute()
|
||||
enableLuteInlineSyntax(luteEngine)
|
||||
luteEngine.SetFootnotes(true)
|
||||
@ -697,7 +697,7 @@ func ExportMarkdownHTML(id, savePath string, docx, merge bool) (name, dom string
|
||||
blockRefMode, Conf.Export.BlockEmbedMode, Conf.Export.FileAnnotationRefMode,
|
||||
Conf.Export.TagOpenMarker, Conf.Export.TagCloseMarker,
|
||||
Conf.Export.BlockRefTextLeft, Conf.Export.BlockRefTextRight,
|
||||
Conf.Export.AddTitle, true, true, &map[string]*parse.Tree{})
|
||||
Conf.Export.AddTitle, Conf.Export.InlineMemo, true, true, &map[string]*parse.Tree{})
|
||||
name = path.Base(tree.HPath)
|
||||
name = util.FilterFileName(name) // 导出 PDF、HTML 和 Word 时未移除不支持的文件名符号 https://github.com/siyuan-note/siyuan/issues/5614
|
||||
savePath = strings.TrimSpace(savePath)
|
||||
@ -854,7 +854,7 @@ func ExportHTML(id, savePath string, pdf, image, keepFold, merge bool) (name, do
|
||||
blockRefMode, Conf.Export.BlockEmbedMode, Conf.Export.FileAnnotationRefMode,
|
||||
Conf.Export.TagOpenMarker, Conf.Export.TagCloseMarker,
|
||||
Conf.Export.BlockRefTextLeft, Conf.Export.BlockRefTextRight,
|
||||
Conf.Export.AddTitle, true, true, &map[string]*parse.Tree{})
|
||||
Conf.Export.AddTitle, Conf.Export.InlineMemo, true, true, &map[string]*parse.Tree{})
|
||||
name = path.Base(tree.HPath)
|
||||
name = util.FilterFileName(name) // 导出 PDF、HTML 和 Word 时未移除不支持的文件名符号 https://github.com/siyuan-note/siyuan/issues/5614
|
||||
|
||||
@ -1452,7 +1452,7 @@ func ExportStdMarkdown(id string) string {
|
||||
".md", Conf.Export.BlockRefMode, Conf.Export.BlockEmbedMode, Conf.Export.FileAnnotationRefMode,
|
||||
Conf.Export.TagOpenMarker, Conf.Export.TagCloseMarker,
|
||||
Conf.Export.BlockRefTextLeft, Conf.Export.BlockRefTextRight,
|
||||
Conf.Export.AddTitle, defBlockIDs, true, &map[string]*parse.Tree{})
|
||||
Conf.Export.AddTitle, Conf.Export.InlineMemo, defBlockIDs, true, &map[string]*parse.Tree{})
|
||||
}
|
||||
|
||||
func ExportPandocConvertZip(ids []string, pandocTo, ext string) (name, zipPath string) {
|
||||
@ -1946,7 +1946,7 @@ func ExportMarkdownContent(id string, refMode, embedMode int, addYfm bool) (hPat
|
||||
".md", refMode, embedMode, Conf.Export.FileAnnotationRefMode,
|
||||
Conf.Export.TagOpenMarker, Conf.Export.TagCloseMarker,
|
||||
Conf.Export.BlockRefTextLeft, Conf.Export.BlockRefTextRight,
|
||||
Conf.Export.AddTitle, nil, true, &map[string]*parse.Tree{})
|
||||
Conf.Export.AddTitle, Conf.Export.InlineMemo, nil, true, &map[string]*parse.Tree{})
|
||||
docIAL := parse.IAL2Map(tree.Root.KramdownIAL)
|
||||
if addYfm {
|
||||
exportedMd = yfm(docIAL) + exportedMd
|
||||
@ -1965,7 +1965,7 @@ func exportMarkdownContent(id, ext string, exportRefMode int, defBlockIDs []stri
|
||||
ext, exportRefMode, Conf.Export.BlockEmbedMode, Conf.Export.FileAnnotationRefMode,
|
||||
Conf.Export.TagOpenMarker, Conf.Export.TagCloseMarker,
|
||||
Conf.Export.BlockRefTextLeft, Conf.Export.BlockRefTextRight,
|
||||
Conf.Export.AddTitle, defBlockIDs, singleFile, treeCache)
|
||||
Conf.Export.AddTitle, Conf.Export.InlineMemo, defBlockIDs, singleFile, treeCache)
|
||||
docIAL := parse.IAL2Map(tree.Root.KramdownIAL)
|
||||
if Conf.Export.MarkdownYFM {
|
||||
// 导出 Markdown 时在文档头添加 YFM 开关 https://github.com/siyuan-note/siyuan/issues/7727
|
||||
@ -1977,12 +1977,12 @@ func exportMarkdownContent(id, ext string, exportRefMode int, defBlockIDs []stri
|
||||
func exportMarkdownContent0(tree *parse.Tree, cloudAssetsBase string, assetsDestSpace2Underscore bool,
|
||||
ext string, blockRefMode, blockEmbedMode, fileAnnotationRefMode int,
|
||||
tagOpenMarker, tagCloseMarker string, blockRefTextLeft, blockRefTextRight string,
|
||||
addTitle bool, defBlockIDs []string, singleFile bool, treeCache *map[string]*parse.Tree) (ret string) {
|
||||
addTitle, inlineMemo bool, defBlockIDs []string, singleFile bool, treeCache *map[string]*parse.Tree) (ret string) {
|
||||
tree = exportTree(tree, false, false, false,
|
||||
blockRefMode, blockEmbedMode, fileAnnotationRefMode,
|
||||
tagOpenMarker, tagCloseMarker,
|
||||
blockRefTextLeft, blockRefTextRight,
|
||||
addTitle, 0 < len(defBlockIDs), singleFile, treeCache)
|
||||
addTitle, inlineMemo, 0 < len(defBlockIDs), singleFile, treeCache)
|
||||
luteEngine := NewLute()
|
||||
luteEngine.SetFootnotes(true)
|
||||
luteEngine.SetKramdownIAL(false)
|
||||
@ -2093,7 +2093,7 @@ func exportTree(tree *parse.Tree, wysiwyg, keepFold, avHiddenCol bool,
|
||||
blockRefMode, blockEmbedMode, fileAnnotationRefMode int,
|
||||
tagOpenMarker, tagCloseMarker string,
|
||||
blockRefTextLeft, blockRefTextRight string,
|
||||
addTitle, addDocAnchorSpan, singleFile bool, treeCache *map[string]*parse.Tree) (ret *parse.Tree) {
|
||||
addTitle, inlineMemo, addDocAnchorSpan, singleFile bool, treeCache *map[string]*parse.Tree) (ret *parse.Tree) {
|
||||
luteEngine := NewLute()
|
||||
ret = tree
|
||||
id := tree.Root.ID
|
||||
@ -2144,6 +2144,12 @@ func exportTree(tree *parse.Tree, wysiwyg, keepFold, avHiddenCol bool,
|
||||
n.Tokens = bytes.TrimSpace(n.Tokens) // 导出 Markdown 时去除公式内容中的首尾空格 https://github.com/siyuan-note/siyuan/issues/4666
|
||||
return ast.WalkContinue
|
||||
case ast.NodeTextMark:
|
||||
if n.IsTextMarkType("inline-memo") {
|
||||
if !inlineMemo {
|
||||
n.TextMarkInlineMemoContent = ""
|
||||
}
|
||||
}
|
||||
|
||||
if n.IsTextMarkType("inline-math") {
|
||||
n.TextMarkInlineMathContent = strings.TrimSpace(n.TextMarkInlineMathContent)
|
||||
return ast.WalkContinue
|
||||
@ -2176,6 +2182,10 @@ func exportTree(tree *parse.Tree, wysiwyg, keepFold, avHiddenCol bool,
|
||||
case 2: // 锚文本块链
|
||||
blockRefLink := &ast.Node{Type: ast.NodeTextMark, TextMarkType: "a", TextMarkTextContent: linkText, TextMarkAHref: "siyuan://blocks/" + defID}
|
||||
blockRefLink.KramdownIAL = n.KramdownIAL
|
||||
if n.IsTextMarkType("inline-memo") {
|
||||
blockRefLink.TextMarkInlineMemoContent = n.TextMarkInlineMemoContent
|
||||
blockRefLink.TextMarkType = "a inline-memo"
|
||||
}
|
||||
n.InsertBefore(blockRefLink)
|
||||
unlinks = append(unlinks, n)
|
||||
case 3: // 仅锚文本
|
||||
@ -2183,8 +2193,19 @@ func exportTree(tree *parse.Tree, wysiwyg, keepFold, avHiddenCol bool,
|
||||
if 0 < len(n.KramdownIAL) {
|
||||
blockRefLink = &ast.Node{Type: ast.NodeTextMark, TextMarkType: "text", TextMarkTextContent: linkText}
|
||||
blockRefLink.KramdownIAL = n.KramdownIAL
|
||||
|
||||
if n.IsTextMarkType("inline-memo") {
|
||||
blockRefLink.TextMarkInlineMemoContent = n.TextMarkInlineMemoContent
|
||||
blockRefLink.TextMarkType = "text inline-memo"
|
||||
}
|
||||
} else {
|
||||
blockRefLink = &ast.Node{Type: ast.NodeText, Tokens: []byte(linkText)}
|
||||
if n.IsTextMarkType("inline-memo") {
|
||||
blockRefLink.Type = ast.NodeTextMark
|
||||
blockRefLink.TextMarkInlineMemoContent = n.TextMarkInlineMemoContent
|
||||
blockRefLink.TextMarkType = "inline-memo"
|
||||
blockRefLink.TextMarkTextContent = linkText
|
||||
}
|
||||
}
|
||||
n.InsertBefore(blockRefLink)
|
||||
unlinks = append(unlinks, n)
|
||||
@ -2202,7 +2223,13 @@ func exportTree(tree *parse.Tree, wysiwyg, keepFold, avHiddenCol bool,
|
||||
return ast.WalkContinue
|
||||
}
|
||||
|
||||
n.InsertBefore(&ast.Node{Type: ast.NodeText, Tokens: []byte(linkText)})
|
||||
text := &ast.Node{Type: ast.NodeText, Tokens: []byte(linkText)}
|
||||
n.InsertBefore(text)
|
||||
if n.IsTextMarkType("inline-memo") {
|
||||
text.Type = ast.NodeTextMark
|
||||
text.TextMarkType = "inline-memo"
|
||||
text.TextMarkInlineMemoContent = n.TextMarkInlineMemoContent
|
||||
}
|
||||
n.InsertBefore(&ast.Node{Type: ast.NodeFootnotesRef, Tokens: []byte("^" + refFoot.refNum), FootnotesRefId: refFoot.refNum, FootnotesRefLabel: []byte("^" + refFoot.refNum)})
|
||||
unlinks = append(unlinks, n)
|
||||
}
|
||||
@ -3084,9 +3111,9 @@ func exportPandocConvertZip(baseFolderName string, docPaths, defBlockIDs []strin
|
||||
}
|
||||
|
||||
// 调用 Pandoc 进行格式转换
|
||||
err := util.Pandoc(pandocFrom, pandocTo, writePath, md)
|
||||
if err != nil {
|
||||
logging.LogErrorf("pandoc failed: %s", err)
|
||||
pandocErr := util.Pandoc(pandocFrom, pandocTo, writePath, md)
|
||||
if pandocErr != nil {
|
||||
logging.LogErrorf("pandoc failed: %s", pandocErr)
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,6 @@ var (
|
||||
)
|
||||
|
||||
func TrimSpaceInPath(p string) string {
|
||||
p = strings.ReplaceAll(p, "\\", "/")
|
||||
parts := strings.Split(p, "/")
|
||||
for i, part := range parts {
|
||||
parts[i] = strings.TrimSpace(part)
|
||||
|
Loading…
Reference in New Issue
Block a user