-
Notifications
You must be signed in to change notification settings - Fork 23
added </option> as an optional ommited end tag #81
base: gh-pages
Are you sure you want to change the base?
Conversation
as per http://www.w3.org/TR/html5/syntax.html#optional-tags modified: src/HTMLParser.js modified: test/test-slowparse.js
"rtc": ["rb","rtc","rp"], | ||
"rp": ["rb","rt","rtc","rp"], | ||
"optgroup": ["optgroup"], | ||
"option": ["option"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or may also be followed by an "optgroup"
super-thanks for adding those! A few notes on the PR though, mostly the fact that you added more than just |
OK I'll add more test cases, and I'll work to make them pass. Right now they will definitely fail if I'm reading the code correctly; I added them to high-light incompleteness. So I'll make tests for "tr", "optgroup" and the ruby stuff, etc. I have no real clue about ruby. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ruby however I can find some examples and adapt them as tests. I'll cross-check with https://validator.w3.org/ . https://bugzilla.mozilla.org/show_bug.cgi?id=946393 "Allow optional omittable close tags according to the W3C HTML5 standards" 50% chance I'll have another patch ready to review by end of tomorrow, 95% chance by Monday. |
Thimble just relaunched a completely overhaul on thimble.mozilla.org, using a codebase that isn't making use of Slowparse at the moment, but adding it back in does seem on their roadmap from what I can tell. |
Indeed, I expect Slowparse to rejoin Thimble soon. We just lack elegant UI, but patches like this make the backend something to be desired. |
fixed dd and dt as per https://bugzilla.mozilla.org/show_bug.cgi?id=946393 got some ruby working added more tests of omitable tags; 6 of which currently fail they fail because omitable tags may nest so more care is needed * modified: src/HTMLParser.js * modified: test/test-slowparse.js
fixed dd and dt as per https://bugzilla.mozilla.org/show_bug.cgi?id=946393 <dl><dt>Coffee<dd>Black hot drink<dt>Milk<dd>White cold drink</dl> got some ruby working <ruby>漢<rp>(<rt>Kan<rp>)</rp>字<rp>(<rt>ji<rp>)</ruby> added more tests of omitable tags; 6 of which currently fail <select><optgroup label="X"><option>V<option>S<optgroup label="Z"><option>M<option>A</select>
<table><thead><tr><td><tbody><tr><td><tr><td><tfoot></table>
<ruby><rb>10<rb>31<rb>2002<rtc><rt>Month<rt>Day<rt>Year<rtc><rt>Expiration Date</ruby> For example when optgroup Z is started option S and optgroup X both need to end. I'll need more work to make them pass. I've been reading through to see where I might need to add some loops and extra tests etc. It might be next weekend before I can try again. I am happy Thimble can use slowparse again; I might slowly add things to it. My interest is mostly in https://github.com/Khan/live-editor as I use their website a bit https://www.khanacademy.org/profile/spollei/ .
|
hm, in that case it's probably worth landing all of these separately, so that things that already work can be merged in, and things that require code changes so the tests pass can be worked on without holding up the other elements. |
…blems down to 2 failures instead of 6 modified: src/DOMBuilder.js modified: src/HTMLParser.js
OK I was able to work on it again this weekend, but not finish it. down to only two failures. |
@@ -35,6 +35,12 @@ module.exports = (function(){ | |||
popElement: function() { | |||
this.currentNode = this.currentNode.parentNode; | |||
}, | |||
popElements: function(n) { | |||
while (n>0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since we're terminating on n=0, we can say while(n--)
here, so that we don't need the decrement in the body.
So awsome! Looking forward to next weekend's result =D |
Hey @pollei - it's only been two years, but guess what, we're adding Slowparse back to Thimble! You can check out the tracking issue here: mozilla/brackets#876 Any chance that you are still going to finish this PR? Thanks! |
as per http://www.w3.org/TR/html5/syntax.html#optional-tags
modified: src/HTMLParser.js
modified: test/test-slowparse.js