Skip to content

Commit

Permalink
1.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
secure-77 committed Feb 5, 2023
1 parent e49b68b commit d100137
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 8 deletions.
6 changes: 6 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 1.5.3
- support file links with exclamation mark and aliases (issue #55)
- support image resizing (issue #54)
- fixed $refName missing php variable (PR #56)


## 1.5.2
- fixed $closing variable error
- set focus to search field
Expand Down
7 changes: 7 additions & 0 deletions perlite/Demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,19 @@ If you want to discuss about Perlite you can join the thread in the [Obsidian Fo

## Demo Files


[[Demo Documents/markdown-sample]]

[[Demo Documents/markdown-sample2]]

[[Demo Documents/markdown-sample3|Call outs]]

[[Demo Documents/pdf-test.pdf|PDF Alias]]

## Images

![[test_img.png|200x200]]

## Documentation on Github

[Perlite on Github](https://github.com/secure-77/Perlite/)
Expand Down
Binary file added perlite/Demo/test_img.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion perlite/PerliteParsedown.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*!
* Perlite v1.5.2 (https://github.com/secure-77/Perlite)
* Perlite v1.5.3 (https://github.com/secure-77/Perlite)
* Author: sec77 & Toaa (https://secure77.de)
* Licensed under MIT (https://github.com/secure-77/Perlite/blob/main/LICENSE)
*/
Expand Down
17 changes: 12 additions & 5 deletions perlite/content.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,20 @@ function parseContent($requestFile) {
$mdpath = $path;
$path = $startDir . $path;

// pdf links
$replaces = '<a class="internal-link" target="_blank" rel="noopener noreferrer" href="'.$path .'/'.'\\2">\\2</a>';
$pattern = array('/(\!\[\[)(.*?.pdf)(\]\])/');

// 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);

// img links
$replaces = '<p><a href="#" class="pop"><img class="images" alt="image not found" src="'. $path .'/\\2\\3'.'"/></a></p>';
$pattern = array('/(\!\[\[)(.*?)(.png|.jpg|.jpeg|.gif|.bmp|.tif|.tiff)(\]\])/');
$replaces = '<p><a href="#" class="pop"><img class="images" width="\\4" height="\\5" alt="image not found" src="'. $path .'/\\2\\3'.'"/></a></p>';
$pattern = array('/(\!?\[\[)(.*?)(.png|.jpg|.jpeg|.gif|.bmp|.tif|.tiff)\|?(\d*)x?(\d*)(\]\])/');
$content = preg_replace($pattern, $replaces ,$content);

// handle internal site links
Expand Down Expand Up @@ -163,6 +169,7 @@ function($matches) use ($path, $sameFolder) {

# split by # to keep the reference
$splitLink = explode("#", $urlPath);
$refName = '';
if (count($splitLink) > 1) {

$urlPath = $splitLink[0];
Expand Down
2 changes: 1 addition & 1 deletion perlite/helper.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*!
* Perlite v1.5.2 (https://github.com/secure-77/Perlite)
* Perlite v1.5.3 (https://github.com/secure-77/Perlite)
* Author: sec77 (https://secure77.de)
* Licensed under MIT (https://github.com/secure-77/Perlite/blob/main/LICENSE)
*/
Expand Down
2 changes: 1 addition & 1 deletion perlite/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<?php

/*!
* Version v1.5.2
* Version v1.5.3
*/

include('helper.php');
Expand Down

0 comments on commit d100137

Please sign in to comment.