nitdoc: Escape headers.
authorJean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Wed, 3 Dec 2014 19:20:01 +0000 (14:20 -0500)
committerJean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Thu, 4 Dec 2014 19:26:29 +0000 (14:26 -0500)
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

src/doc/doc_templates.nit

index 9f4e3fb..c4729a5 100644 (file)
@@ -580,7 +580,7 @@ class TplClassDefinition
 
        private fun render_list(name: String, elts: Array[TplListElt]) do
                if elts.is_empty then return
-               add "<h5>{name}</h5>"
+               add "<h5>{name.html_escape}</h5>"
                add "<ul class='list-unstyled list-definition'>"
                for elt in elts do add elt
                add "</ul>"
@@ -597,7 +597,7 @@ class TplSearchPage
 
        redef fun rendering do
                var title = self.title
-               if title != null then add "<h1>{title}</h1>"
+               if title != null then add "<h1>{title.to_s.html_escape}</h1>"
                add "<div class='container-fluid'>"
                add " <div class='row'>"
                if not modules.is_empty then