Fix titles with & inside.
authorKim Nguyễn <kn@lri.fr>
Wed, 23 Sep 2015 16:17:01 +0000 (18:17 +0200)
committerKim Nguyễn <kn@lri.fr>
Wed, 23 Sep 2015 16:17:01 +0000 (18:17 +0200)
simpleWebSlides.js

index ce50c94..23f08a2 100644 (file)
@@ -550,7 +550,12 @@ SWS.Presentation = new function () {
 
         var loop = function (doc, dir, add, ignoreFirst) {
             if (ignoreFirst !== true) {
-                var this_toc = { 'title' : doc.find("title").first().text(),
+                var this_toc = { 'title' : doc.find("title").first().text()
+                                .replace ("&", "&amp;")
+                                .replace("'","&apos;")
+                                .replace('"', "&quot;")
+                                .replace("<", "&lt;")
+                                .replace(">", "&gt;"),
                                  'sections' : build_sections(doc) };
                 add(toc, this_toc);
             };