Skip to content

Commit

Permalink
fixed inline code formatting, issue 146
Browse files Browse the repository at this point in the history
  • Loading branch information
yogthos committed Jan 11, 2019
1 parent 5715d22 commit 38d68c3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion project.clj
@@ -1,4 +1,4 @@
(defproject markdown-clj "1.0.5"
(defproject markdown-clj "1.0.6"
:description "Markdown parser"
:url "https://github.com/yogthos/markdown-clj"
:license {:name "Eclipse Public License"
Expand Down
6 changes: 5 additions & 1 deletion src/cljc/markdown/common.cljc
Expand Up @@ -181,5 +181,9 @@
text
(-> text
(string/replace #"\-\-\-" "—")
(string/replace #"\-\-" "–")))
(string/replace #"\-\-" "–")
(string/replace #"<code>.*</code>"
(fn [s](-> s
(string/replace #"&mdash;" "---")
(string/replace #"&ndash;" "--"))))))
state])
2 changes: 2 additions & 0 deletions test/markdown/md_test.cljc
Expand Up @@ -158,6 +158,8 @@
(deftest code
(is (= "<p>foo bar baz <code>x = y + z;</code> foo</p>"
(entry-function "foo bar baz `x = y + z;` foo")))
(is (= "<p>bar <code>foo --- -- bar</code> foo</p>"
(entry-function "bar `foo --- -- bar` foo")))
(is (= "<p><code>&lt;?xml version='1.0' encoding='UTF-8'?&gt;&lt;channel&gt;&lt;/channel&gt;</code></p>"
(entry-function "`<?xml version='1.0' encoding='UTF-8'?><channel></channel>`")))
(is (= "<p>foo bar baz <code>&#40;fn &#91;x &amp; xs&#93; &#40;str &quot;x:&quot; x&#41;&#41;</code> foo</p>"
Expand Down

0 comments on commit 38d68c3

Please sign in to comment.