From 1cc84d8806be85fff2c12c26caf8e6ed0a2f39cd Mon Sep 17 00:00:00 2001 From: hotoo Date: Sun, 2 Nov 2014 15:22:02 +0800 Subject: [PATCH] fixed #11, support . --- examples/data.mdown | 1 + markline.js | 2 ++ timeline.css | 9 +++++++++ 3 files changed, 12 insertions(+) diff --git a/examples/data.mdown b/examples/data.mdown index a52032c..b585841 100644 --- a/examples/data.mdown +++ b/examples/data.mdown @@ -17,6 +17,7 @@ * 2000 this is **strong**, and __strong2__ * 2000 this is *em*, and _em2_ * 2000 this is ~delete~, and ~~delete2~~ +* 2000 this is `code` and `another code`. ## @Memthon and #HashTags diff --git a/markline.js b/markline.js index fb11a8e..ef3eadf 100644 --- a/markline.js +++ b/markline.js @@ -68,6 +68,7 @@ function parseMarkdown(markdown, meta){ var RE_STRONG = /(\*\*|__)(.*?)\1/g; var RE_EM = /(\*|_)(.*?)\1/g; var RE_DELETE = /(\~\~?)(.*?)\1/g; + var RE_CODE = /`([^`]+)`/g var RE_MENTION = /(^|[^a-zA-Z0-9])@([^\s\t,\(\)\[\]\{\}]+)/g; var RE_MENTION_PLACEHOLDER = /\{@mention\}/ig; var RE_HASHTAG = /(?:^|[\s\t])\#([^\s\t]+)/g; @@ -78,6 +79,7 @@ function parseMarkdown(markdown, meta){ html = html.replace(RE_STRONG, '$2'); html = html.replace(RE_EM, '$2'); html = html.replace(RE_DELETE, '$2'); + html = html.replace(RE_CODE, '$1'); // mention: if (meta.mention) { diff --git a/timeline.css b/timeline.css index 918156c..5d61e85 100644 --- a/timeline.css +++ b/timeline.css @@ -219,6 +219,15 @@ font-style: italic; color: #999; } +.markline > section > .events code { + font-size: 13px; + color: rgba(0, 0, 0, 0.75); + background-color: #999; + padding: 1px 3px; + border-radius: 3px; + margin-left: 3px; + margin-right: 3px; +} .markline > section > .events a { color: #6EA3D0; text-decoration: none;