Skip to content
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

Some links are breaking the page for no apparent reason #128

Open
codergoblin opened this issue Jun 13, 2024 · 1 comment
Open

Some links are breaking the page for no apparent reason #128

codergoblin opened this issue Jun 13, 2024 · 1 comment
Labels
bug report Something isn't working

Comments

@codergoblin
Copy link

I have many instances in my wiki where links break the page in a strange way.

image

root@vultr:/opt/Perlite# cat /data/perlite/Sif/Kugelglobe.md 

A strange cubic object that irradiates light.
Found by [[Triya]] on a beach in [[Synthea]]. LPH later discovered that the globe was probably from [[Phanes]] since it fits perfectly in an artifact stand that the party found in an underground [[Antediluvians]] ossuary underneath [[Sif]]. LPH got a confirmation of this theory when the [[Antediluvians]] ([[Stargazers]]) that [[Triya]] faced in the [[Temple of Bes]] performed the same type of magic that [[Triya]] does. 

it looks like in this case [[Triya]] breaks the link, but not sure why, it does not seem to be any different to other links that function correctly. It happens in different pages with different links but I can't see any pattern.

@codergoblin codergoblin added the bug report Something isn't working label Jun 13, 2024
@rgaricano
Copy link

rgaricano commented Sep 9, 2024

Yes, it happend to me too,
It happend if the name of the link have some image extension on it, as tif gif tiff bmp ....
I solved changing regexpression of line 152 of perlite/content.php as follow:
$pattern = array('/(!?[[)(.*?)(.png|.jpg|.jpeg|.svg|.gif|.bmp|.tif|.tiff)|?(.+|)(]])/');
(it's noted under //img link with captions replace block )
and restart server:
systemctl restart php8.3-fpm nginx

by the way i add a block for embed m4a links, adding this lines between embedded blocks:


     // embedded m4a links
        $replaces = '
        <video controls src="' . $path . '/\\2" type="audio/x-m4a">
                <a class="internal-link" target="_blank" rel="noopener noreferrer" href="' . $path . '/' . '\\2">Your browser does not support the video tag: Download \\2</a>
        </video>';
        $pattern = array('/(\!\[\[)(.*?.(?:m4a))(\]\])/');
        $content = preg_replace($pattern, $replaces, $content);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants