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:
@@ -24,6 +24,8 @@ Now some inline markup like _italics_, **bold**, ~~strike through~~ and `code()
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
@@ -99,4 +99,11 @@
|
|||||||
background-color: #F8F8F8;
|
background-color: #F8F8F8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.fixme {
|
||||||
|
border: 1px solid @colorText;
|
||||||
|
border-radius: 4px;
|
||||||
|
background-color: #ffd703;
|
||||||
|
padding: 0 4px;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -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="([^"]+))"|',
|
||||||
|
Reference in New Issue
Block a user