Fixed issues with angled brackets, made them HTML entities.
This commit is contained in:
parent
e98709fb87
commit
8c8b9648fd
2 changed files with 17 additions and 3 deletions
|
@ -80,6 +80,12 @@
|
||||||
(str/replace #"->" "→")
|
(str/replace #"->" "→")
|
||||||
(str/replace #""" "\"")))
|
(str/replace #""" "\"")))
|
||||||
|
|
||||||
|
(defn replace-html-entities
|
||||||
|
[s]
|
||||||
|
(-> s
|
||||||
|
(str/replace "<" "<")
|
||||||
|
(str/replace ">" ">")))
|
||||||
|
|
||||||
;; As a result of docifying then grouping, you'll end up with a seq like this one:
|
;; As a result of docifying then grouping, you'll end up with a seq like this one:
|
||||||
;; <pre><code>[...
|
;; <pre><code>[...
|
||||||
;; {:docs [{:docs-text "Some doc text"}]
|
;; {:docs [{:docs-text "Some doc text"}]
|
||||||
|
@ -117,10 +123,12 @@
|
||||||
str
|
str
|
||||||
prep-docs-text
|
prep-docs-text
|
||||||
replace-special-chars
|
replace-special-chars
|
||||||
|
replace-html-entities
|
||||||
(md)))
|
(md)))
|
||||||
|
|
||||||
(defn codes-to-html [code-block]
|
(defn codes-to-html [code-block]
|
||||||
(html [:pre {:class "brush: clojure"} code-block]))
|
(html [:pre {:class "brush: clojure"}
|
||||||
|
(replace-html-entities code-block)]))
|
||||||
|
|
||||||
(defn section-to-html [section]
|
(defn section-to-html [section]
|
||||||
(html [:tr
|
(html [:tr
|
||||||
|
|
|
@ -81,6 +81,14 @@
|
||||||
<object-start> \{
|
<object-start> \{
|
||||||
<object-end> \}))
|
<object-end> \}))
|
||||||
|
|
||||||
|
;; Issue #26: Angle-bracket in Function Name Breaks Layout
|
||||||
|
(defn <test [] nil)
|
||||||
|
|
||||||
|
(defn test-html-entities-in-doc
|
||||||
|
"<is this working?"
|
||||||
|
[]
|
||||||
|
nil)
|
||||||
|
|
||||||
(defmulti kompile identity)
|
(defmulti kompile identity)
|
||||||
|
|
||||||
(defmethod kompile [::standard AutoIncClause]
|
(defmethod kompile [::standard AutoIncClause]
|
||||||
|
@ -108,7 +116,6 @@
|
||||||
nl
|
nl
|
||||||
"})"))
|
"})"))
|
||||||
|
|
||||||
|
|
||||||
'(defn special-forms []
|
'(defn special-forms []
|
||||||
{'def handle-def
|
{'def handle-def
|
||||||
'fn handle-fn
|
'fn handle-fn
|
||||||
|
@ -146,4 +153,3 @@
|
||||||
(greater 2 1) => truthy)
|
(greater 2 1) => truthy)
|
||||||
|
|
||||||
'(file->tickets commits)
|
'(file->tickets commits)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue