-
-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File links does not work properly #55
Comments
Hi @Diafwl, yes currently file links need to start with an I will take a look if I can implement the other formats as well. |
but because of regex it does not capturing |
yes, aliases for files are not supported / implemented at the moment |
if we change pdf regex to |
looks good 👍 then only the alias part is missing, ideally I should move the obsidian linking part into the PerliteParsdown.php but this is a little bit more work |
@Diafwl // pdf links with Alias
$replaces = '<a class="internal-link" target="_blank" rel="noopener noreferrer" href="'.$path .'/'.'\\2">\\3</a>';
$pattern = array('/(\!?\[\[)(.*?.pdf)\|(.*)(\]\])/');
$content = preg_replace($pattern, $replaces ,$content);
// pdf links without Alias
$replaces = '<a class="internal-link" target="_blank" rel="noopener noreferrer" href="'.$path .'/'.'\\2">\\2</a>';
$pattern = array('/(\!?\[\[)(.*?.pdf)(\]\])/');
$content = preg_replace($pattern, $replaces ,$content); I will check this again as soon I have some time and will make a new release |
Yeah it works perfectly. Thank you. |
This is fixed in version 1.5.3 |
Describe the bug
links does not work properly for files, they are behaves like normal md links, not file links
To Reproduce
Steps to reproduce the behavior:
Link a file like:
[[book.pdf]]
does not workLink a file like:
[[book.pdf| Book Volume 1]]
does not workLink a file like:
![[book.pdf| Book Volume 1]]
does not workExpected behavior
3 of them needed to behave like:
![[book.df]]
[Book Volume](book.pdf)
does work perfectlyDesktop (please complete the following information):
The text was updated successfully, but these errors were encountered: