[Bug] Internal links with extensions are not rendered correctly
RyotaUshio opened this issue · 1 comments
This seems to be a minor issue since most users would prefer links without extensions, but mathLink is not correctly rendered in reading view when a link path has an extension.
I've noticed the problem is that the condition checks in setMathLinkGetter
is not going as expected.
obsidian-mathlinks/src/links/reading.ts
Lines 46 to 59 in 32356cd
Probably the following lines have something to do with it. To be honest, I don't fully understand the intention behind them...
-
obsidian-mathlinks/src/links/reading.ts
Line 86 in 32356cd
-
obsidian-mathlinks/src/links/reading.ts
Line 52 in 32356cd
Here's some test I've done with v0.4.4 (32356cd):
When both mathLink
& mathLink-blocks
are set
Live preview
Reading view
When mathLink
is absent
Live preview
Reading view
Hi, thanks for pointing it out!
Probably the following lines have something to do with it. To be honest, I don't fully understand the intention behind them...
obsidian-mathlinks/src/links/reading.ts
Line 86 in 32356cd
The replace(/\.md/, "")
was added to render links like [Main](Main.md)
with Main.md having mathLink: $\alpha$
as Main
.
obsidian-mathlinks/src/links/reading.ts
Line 52 in 32356cd
I'm not sure why I specifically picked out the basename either...
I will address your solution in the PR.