-
-
Notifications
You must be signed in to change notification settings - Fork 315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistency in the spec regarding nested emphasis of the same type #127
Comments
+++ Kārlis Gaņģis [Sep 16 14 10:25 ]:
No, because
Then we hit a
Spec says the latter. We continue to take single inline
Could you spell out your algorithm more fully? I am
Yes, clearly there is a need for more examples, and also for |
Closely related to #51 but that one is more about the implementation while this is about the spec itself.
The spec in section 6.4 mentions (note that it only implies the result, the spec does not describe what should be the result of these examples):
But after that goes and says:
Also, section 6 contains:
Reading these rules when parsing
*emph *with emph* in it*
we should get<em>emph *with emph</em> in it
which is certainly not what is probably intended by the author. Of course, the rules could also mean that we match the first opener with first closer and second opener with second closer. But while that looks OK in HTML, it cannot be properly represented in AST.Note that this "good" scenario does not really represent the problems in parsing it - many completely wrong parsers could easily get this correctly (even by just replacing openers with
<em>
and closers with</em>
, without even thinking about their relations). So a better sample to consider would beNow should this be
<em>foo *bar foo</em>
or*foo <em>bar foo</em>
? The stack based approach I mentioned in #51 that would also work for the existing C reference implementation allows both answers with a simple modification with no performance costs so the specification could go both ways - either each closer matches the closest or the farthest opener.In short - the specification implies how
*a *b* c*
has to be parsed but that contradicts the current rules. Also there are no tests that verify the implementations with these examples.The text was updated successfully, but these errors were encountered: