Closed kenlim closed 1 year ago
Hey there, I think there is a solution to this. The compareLinkName
method in the apiAdapter.tsx
file doesn't return true when the link is a Markdown link.
with some additional code, you can make it work with Markdown links.
Very quickly, here it is:
compareLinkName(link: LinkCache, basename: string) {
// format link name to be comparable with base names:
const path = link.link;
// grab only the filename from a multi-folder path
const filenameOnly = path.split("/").slice(-1)[0]
// strip any block references from the end and the ".md" extension
const linkname = filenameOnly.split("#^")[0].split(".md")[0]
if (linkname.toLowerCase() === basename.toLowerCase()) {
return true
}
return false
}
markdown links that used to fail and will now work:
With this, it works for me on my install:
Have raised pull request (https://github.com/jensmtg/influx/pull/51).
Implemented. Thanks!
Describe the bug When a document uses Markdown Links instead of the default "Shortest path when Possible" WikiLinks, Influx does not render the preview correctly.
To Reproduce Steps to reproduce the behavior:
Expected behavior The Influx widget should link to the correct "markdown link" note, and displays:
Screenshots
Desktop (please complete the following information):
Additional context Influx preview works correctly for "Shortest path when Possible" WikiLinks.