3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-19 14:45:44 +01:00

Write an external image a link marks as [![alt](url)](href) in both writers

This commit is contained in:
2026-10-11 12:19:15 +02:00
committed by Lillem4n
parent cc40fb95f2
commit 580bc862f2
15 changed files with 86 additions and 39 deletions
+1 -1
View File
@@ -146,7 +146,7 @@ function portableMarks(marks: readonly AdfMark[], container: LineContainer, text
return kept.filter((mark) => !code || mark.type !== highlight).sort((first, second) => rank(first) - rank(second))
}
function portableLink(mark: AdfMark, container: LineContainer): AdfMark | undefined {
export function portableLink(mark: AdfMark, container: LineContainer): AdfMark | undefined {
const attrs = nodeAttrs(mark)
const held = attrs['href']
const title = typeof attrs['title'] === 'string' ? attrs['title'].replace(/[\r\0]/g, '').replace(/\n/g, ' ') : undefined