Skip to content
This repository has been archived by the owner on Aug 16, 2021. It is now read-only.

Fixes full-pathing links and being able to linkify links #40

Merged
merged 1 commit into from
Aug 14, 2021

Conversation

eric-hansen
Copy link
Contributor

@eric-hansen eric-hansen commented Aug 12, 2021

Resolves #39 and possibly #25

I don't think the regex considered WikiLinks (which is what I use) so this resolves that for the cases where [[SomeID.md|someText]] is trying to be linkified again. Not foolproof but at least is a start. Might be worth it honestly to wildcard before and after str.

@eric-hansen
Copy link
Contributor Author

I'm not familiar with Markdown, but I did some testing in Lua REPL for the regex I have here:

 > lua
Lua 5.3.3  Copyright (C) 1994-2016 Lua.org, PUC-Rio
> line_wiki = "[[bz1l.md|test]]"
> line_wiki_ = "[[bz1l.md]]"
> line_wiki__ = "[[bz1l]]"
> line_md = "[bz1l.md](test)"
> line_md_ = "[bz1l](test)"
> print(line_wiki:match("%[bz1l.*%|?%]"))
[bz1l.md|test]]
> print(line_wiki_:match("%[bz1l.*%|?%]"))
[bz1l.md]]
> print(line_wiki__:match("%[bz1l.*%|?%]"))
[bz1l]]
> print(line_md:match("%[bz1l.*%|?%]"))
[bz1l.md]
> print(line_md_:match("%[bz1l.*%|?%]"))
[bz1l]

So far it seems to work fine.

@mickael-menu mickael-menu merged commit 634d874 into megalithic:main Aug 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Creating wikilinks are broken
2 participants