harbor run -t datacurve/obsidian-linter-link-format-conversionharbor download datacurve/obsidian-linter-link-format-conversionAdd a Content rule Link Style (alias: link-style) to convert between Obsidian wiki links/embeds and markdown links/images.
Default-export LinkStyle from src/rules/link-style.ts.
linkStyle: no-change | markdown | wikiimageStyle: no-change | markdown | wikiDefaults: no-change.
Wiki to markdown:
[[t]] -> [t](t)[[t|d]] -> [d](t)[[p#h]] -> [p > h](p#h), [[#h]] -> [h](#h)![[f.png]] -> ; drop embed display when it is 300 or 300x200.Markdown to wiki (only inline [d](t) and ):
://).[] in the link label, and treat backslash escapes in the label as literal characters.<...> (for spaces). Optional whitespace around the <...> inside the parentheses is allowed (for example ( <My Page> )).\(, \), \<, \>, and escaped spaces \ ) as literal characters in the wiki target.[d](t "title")), do not convert it.[t](t) -> [[t]], otherwise [d](t) -> [[t|d]]. -> ![[f.png|alt]]; omit |alt if alt is empty or equals f.png.No conversions inside: YAML frontmatter, code blocks or inline code, math blocks or inline math, HTML blocks, Templater commands (<% ... %>), Obsidian comments (%% ... %%), tables, or custom ignore blocks (<!-- linter-disable --> ... <!-- linter-enable -->, and equivalent supported forms).
Deterministic behavior. Conversions are limited to the syntaxes above; anything else must be left unchanged.