agathauy / wikilinks-to-mdlinks-obsidian

An Obsidian md plugin which allows for the conversion of individually selected wikilinks to markdown links, and vice versa.
105 stars 13 forks source link

An extended syntax feature #5

Open YJ2CS opened 3 years ago

YJ2CS commented 3 years ago

1

This is not a bug, but I think a feature needs to be supported,

It is the following syntax:

[[Wiki Links|click here]] -> [click here](Wiki%20Links.md)

This is a feature supported by Obisdian. Below is a screenshot of its effect

Source code

image

Preview

image

example

Below I give a regular expression example, but I am not sure whether it is useful to you, because I did not look at the source code carefully.

There are still some problems. Normally, it should trim the spaces on both sides of the string.

/\[\[([^\x00-\x1f|]+?)(\|)+?(([\s\S]+?)?)\]\]/g

to

($3)[$1.md]

image

agathauy commented 3 years ago

Oh I see! Will get back to a next update to this soon I think. Didn't know that was how it's being done with Obsidian these days (have yet to even try aliases haha). Thanks for mentioning this!