Skip to content

Commit

Permalink
fix: escaping pipe if the link is Obsidian-style (#569)
Browse files Browse the repository at this point in the history
  • Loading branch information
akosbalasko authored Jan 6, 2024
1 parent 71b78ae commit bb4df9c
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 42 deletions.
4 changes: 2 additions & 2 deletions src/utils/turndown-rules/images-rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ export const imagesRule = {

return `![](${realValue}${sizeString})`;
} else if (yarleOptions.keepImageSize === OutputFormat.ObsidianMD) {
sizeString = (widthParam || heightParam) ? `|${widthParam || 0}x${heightParam || 0}` : '';
sizeString = (widthParam || heightParam) ? `${widthParam || 0}x${heightParam || 0}` : '';
if (realValue.startsWith('./') || realValue.startsWith('..')) {
return `![[${realValue}${sizeString}]]`;
return sizeString != '' ? `![[${realValue}\\|${sizeString}]]` : `![[${realValue}${sizeString}]]`;
} else {
return `![${sizeString}](${realValue})`;
}
Expand Down
Loading

0 comments on commit bb4df9c

Please sign in to comment.