From 8c8b9648fdcecf1b193273ec0e1221bc4b64fce9 Mon Sep 17 00:00:00 2001 From: Nicolas Buduroi Date: Mon, 14 Mar 2011 07:21:18 +0800 Subject: [PATCH] Fixed issues with angled brackets, made them HTML entities. --- src/marginalia/html.clj | 10 +++++++++- src/problem_cases/general.clj | 10 ++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/marginalia/html.clj b/src/marginalia/html.clj index 99cffde..16529ef 100644 --- a/src/marginalia/html.clj +++ b/src/marginalia/html.clj @@ -80,6 +80,12 @@ (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: ;;
[...
 ;; {:docs [{:docs-text "Some doc text"}]
@@ -117,10 +123,12 @@
       str
       prep-docs-text
       replace-special-chars
+      replace-html-entities
       (md)))
 
 (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]
   (html [:tr
diff --git a/src/problem_cases/general.clj b/src/problem_cases/general.clj
index a8a0c13..861c1ce 100644
--- a/src/problem_cases/general.clj
+++ b/src/problem_cases/general.clj
@@ -81,6 +81,14 @@
                    \{
                      \}))
 
+;; Issue #26: Angle-bracket in Function Name Breaks Layout
+(defn  truthy)
 
 '(file->tickets commits)
-