1
0
mirror of https://github.com/til-schneider/slim-wiki.git synced 2025-08-09 01:56:40 +02:00

Added support for FIXME

This commit is contained in:
til-schneider
2015-12-28 11:30:07 +01:00
parent ddf876679c
commit c104846b5d
3 changed files with 13 additions and 0 deletions

View File

@@ -24,6 +24,8 @@ Now some inline markup like _italics_, **bold**, ~~strike through~~ and `code()
![picture alt](http://nuclearpixel.com/content/icons/2010-02-09_stellar_icons_from_space_from_2005/earth_128.png "Title is optional") ![picture alt](http://nuclearpixel.com/content/icons/2010-02-09_stellar_icons_from_space_from_2005/earth_128.png "Title is optional")
Want to mark something in your article to fix later? Write FIXME. This will create a yellow fixme marker.
> Blockquotes are like quoted text in email replies > Blockquotes are like quoted text in email replies
>> And, they can be nested >> And, they can be nested

View File

@@ -99,4 +99,11 @@
background-color: #F8F8F8; background-color: #F8F8F8;
} }
.fixme {
border: 1px solid @colorText;
border-radius: 4px;
background-color: #ffd703;
padding: 0 4px;
}
} }

View File

@@ -16,6 +16,10 @@ class RenderService {
public function renderMarkdown($markdownText, $isEditMode) { public function renderMarkdown($markdownText, $isEditMode) {
require_once __DIR__ . '/../lib/parsedown/Parsedown.php'; require_once __DIR__ . '/../lib/parsedown/Parsedown.php';
$html = Parsedown::instance()->text($markdownText); $html = Parsedown::instance()->text($markdownText);
// Support `FIXME`
$html = preg_replace('/(^|\\W)FIXME(\\W|$)/', '$1<span class="fixme">FIXME</span>$2', $html);
if ($isEditMode) { if ($isEditMode) {
// Append `?edit` to local links (in order to stay in edit mode) // Append `?edit` to local links (in order to stay in edit mode)
$html = preg_replace_callback('|(<a href="([^"]+))"|', $html = preg_replace_callback('|(<a href="([^"]+))"|',