Skip to content

Commit

Permalink
version 2.0.x (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
stndc committed Jun 21, 2023
1 parent 1e68a11 commit f30972f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion miniMarkdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* miniMarkdown
* author: STNDC
* web: https://stndc.github.io
* version: 1.x
* version: 2.0.x
*
* @param string $text
*
Expand Down Expand Up @@ -37,6 +37,15 @@ function minimarkdown($text){
// Negative
$text = preg_replace('/\-\-(.+)\-\-/', '<span class="negative">$1</span>', $text);

// Image
$text = preg_replace('/\!\[(.+)\]\((.+)\)/', '<img src="$2" alt="$1">', $text);

// Link
$text = preg_replace('/\[(.+)\]\((.+)\)/', '<a href="$2">$1</a>', $text);

// Email
$text = preg_replace('/\[email\](.+)\[\/email\]/', '<a href="mailto:$1">$1</a>', $text);

return $text;

}
Expand Down

0 comments on commit f30972f

Please sign in to comment.