From a7b15dee7fdfa6644d1f342362c69f2a7188b54a Mon Sep 17 00:00:00 2001 From: Stephen Pollei Date: Mon, 7 Sep 2015 18:31:35 -0700 Subject: [PATCH] added as an optional ommited end tag as per http://www.w3.org/TR/html5/syntax.html#optional-tags updated README to deal with some link-rot modified: external/slowparse/README.md modified: external/slowparse/slowparse.js https://www.khanacademy.org/profile/spollei/ --- external/slowparse/README.md | 5 +++++ external/slowparse/slowparse.js | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/external/slowparse/README.md b/external/slowparse/README.md index d71eb21c7..e94011f6e 100644 --- a/external/slowparse/README.md +++ b/external/slowparse/README.md @@ -1,4 +1,9 @@ +This is a version of slowparse modified for KA. It is based off this file: +https://github.com/mozilla/slowparse/blob/c0ede5d6d65c50f707b20f5036316b13bf85c80d/slowparse.js + If you want to know the KA-specific changes, I recommend you run a diff. + From: https://github.com/mozilla/thimble.webmaker.org/tree/master/public/friendlycode/vendor/slowparse +now https://github.com/mozilla/slowparse Released under the Mozilla Public License. diff --git a/external/slowparse/slowparse.js b/external/slowparse/slowparse.js index 501f34c25..c09923723 100644 --- a/external/slowparse/slowparse.js +++ b/external/slowparse/slowparse.js @@ -1291,7 +1291,7 @@ // http://www.w3.org/TR/html5/syntax.html#optional-tags // HTML elements that with omittable close tag - omittableCloseTagHtmlElements: ["p", "li", "td", "th"], + omittableCloseTagHtmlElements: ["p", "li", "td", "th", "option"], // HTML elements that paired with omittable close tag list omittableCloseTags: { @@ -1301,7 +1301,17 @@ "section", "table", "ul"], "th": ["th", "td"], "td": ["th", "td"], - "li": ["li"] + "tr": ["tr"], + "li": ["li"], + "rb": ["rb","rt","rtc","rp"], + "rt": ["rb","rt","rtc","rp"], + "rtc": ["rb","rtc","rp"], + "rp": ["rb","rt","rtc","rp"], + "optgroup": ["optgroup"], + "option": ["option"], + "thead": ["tbody", "tfoot"], + "tbody": ["tbody", "tfoot"], + "tfoot": ["tbody"] }, // We keep a list of all valid HTML5 elements.