diff --git a/Changelog.md b/Changelog.md index 0e6d52fe..5fa2e2eb 100644 --- a/Changelog.md +++ b/Changelog.md @@ -6,6 +6,8 @@ - fixed kartex problem PR [#131](https://github.com/secure-77/Perlite/pull/131) thanks to @Yaro2709 - fixed obsidian edit link thanks to klgzzz - changed site title to use the env. variable site_title +- fixed issue [#128](https://github.com/secure-77/Perlite/issues/128) thanks to @rgaricano +- added m4a support thanks to @rgaricano diff --git a/perlite/Demo/Demo Documents/Links and Embedded.md b/perlite/Demo/Demo Documents/Links and Embedded.md index edef39c3..2e8be1d4 100644 --- a/perlite/Demo/Demo Documents/Links and Embedded.md +++ b/perlite/Demo/Demo Documents/Links and Embedded.md @@ -12,6 +12,8 @@ Link to another markdown file: [[Markdown Samples]] Link to another markdown file with a custom linke name: [[Markdown Samples|Custom Link Name]] +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. ## Links to Headings @@ -32,6 +34,10 @@ Youtube embedded: ![Making a Minecraft Obsidian Block in Real Life Using Astro Tech Resin](https://www.youtube.com/watch?v=NnTvZWp5Q7o) +## Audio + +![[docs/sample3.m4a]] + ## PDF Link to internal stored PDF: [[pdf-test.pdf]] diff --git a/perlite/Demo/Demo Documents/docs/sample3.m4a b/perlite/Demo/Demo Documents/docs/sample3.m4a new file mode 100644 index 00000000..b426ffbd Binary files /dev/null and b/perlite/Demo/Demo Documents/docs/sample3.m4a differ diff --git a/perlite/content.php b/perlite/content.php index 499e207c..c7c23d84 100644 --- a/perlite/content.php +++ b/perlite/content.php @@ -129,6 +129,16 @@ function parseContent($requestFile) $pattern = array('/(\!\[\[)(.*?.(?:mp4))(\]\])/'); $content = preg_replace($pattern, $replaces, $content); + + // embedded m4a links + $replaces = ' + '; + $pattern = array('/(\!\[\[)(.*?.(?:m4a))(\]\])/'); + $content = preg_replace($pattern, $replaces, $content); + + // links to other files with Alias $replaces = '\\3'; $pattern = array('/(\[\[)(.*?.(?:' . $linkFileTypes . '))\|(.*)(\]\])/'); @@ -142,6 +152,8 @@ function parseContent($requestFile) // img links with size $replaces = '

image not found

'; $pattern = array('/(\!?\[\[)(.*?)'.$allowedImageTypes.'\|?(\d*)x?(\d*)(\]\])/'); + + $content = preg_replace($pattern, $replaces, $content); // centerise or right align images with "center"/"right" directive @@ -166,7 +178,7 @@ function parseContent($requestFile) // img links with captions $replaces = '

\\4

'; - $pattern = array('/(\!?\[\[)(.*?)'.$allowedImageTypes.'\|?(.*)(\]\])/'); + $pattern = array('/(\!?\[[)(.*?)'.$allowedImageTypes.'|?(.+|)(]\])/'); $content = preg_replace($pattern, $replaces, $content);