Fix titles with & inside.
[hacks/simpleWebSlides.git] / 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 ("&", "&")
+                                .replace("'","'")
+                                .replace('"', """)
+                                .replace("<", "&lt;")
+                                .replace(">", "&gt;"),
                                  'sections' : build_sections(doc) };
                 add(toc, this_toc);
             };