From c104846b5d3455dd9f1226c70333683bfe163fc8 Mon Sep 17 00:00:00 2001 From: til-schneider Date: Mon, 28 Dec 2015 11:30:07 +0100 Subject: [PATCH] Added support for `FIXME` --- src/articles/cheat_sheets/Markdown_cheat_sheet.md | 2 ++ src/client/less/markdown.less | 7 +++++++ src/server/logic/RenderService.php | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/src/articles/cheat_sheets/Markdown_cheat_sheet.md b/src/articles/cheat_sheets/Markdown_cheat_sheet.md index a6f12af..142b44f 100644 --- a/src/articles/cheat_sheets/Markdown_cheat_sheet.md +++ b/src/articles/cheat_sheets/Markdown_cheat_sheet.md @@ -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") +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 >> And, they can be nested diff --git a/src/client/less/markdown.less b/src/client/less/markdown.less index 173ba54..d453896 100644 --- a/src/client/less/markdown.less +++ b/src/client/less/markdown.less @@ -99,4 +99,11 @@ background-color: #F8F8F8; } + .fixme { + border: 1px solid @colorText; + border-radius: 4px; + background-color: #ffd703; + padding: 0 4px; + } + } diff --git a/src/server/logic/RenderService.php b/src/server/logic/RenderService.php index 2edf901..57f8286 100644 --- a/src/server/logic/RenderService.php +++ b/src/server/logic/RenderService.php @@ -16,6 +16,10 @@ class RenderService { public function renderMarkdown($markdownText, $isEditMode) { require_once __DIR__ . '/../lib/parsedown/Parsedown.php'; $html = Parsedown::instance()->text($markdownText); + + // Support `FIXME` + $html = preg_replace('/(^|\\W)FIXME(\\W|$)/', '$1FIXME$2', $html); + if ($isEditMode) { // Append `?edit` to local links (in order to stay in edit mode) $html = preg_replace_callback('|(