🎨 Improve av export md asset rendering

This commit is contained in:
Daniel 2023-11-30 12:03:16 +08:00
parent f0c8e08972
commit bd515efcf1
No known key found for this signature in database
GPG Key ID: 86211BA83DF03017

View File

@ -1956,6 +1956,18 @@ func exportTree(tree *parse.Tree, wysiwyg, expandKaTexMacros, keepFold bool,
if nil != cell.Value.Updated {
cell.Value.Updated = av.NewFormattedValueUpdated(cell.Value.Updated.Content, 0, av.UpdatedFormatNone)
}
} else if av.KeyTypeMAsset == cell.Value.Type {
if nil != cell.Value.MAsset {
buf := &bytes.Buffer{}
for _, a := range cell.Value.MAsset {
buf.WriteString("![](")
buf.WriteString(a.Content)
buf.WriteString(") ")
}
val = strings.TrimSpace(buf.String())
mdTableCell.AppendChild(&ast.Node{Type: ast.NodeText, Tokens: []byte(val)})
continue
}
}
val = cell.Value.String()