-
-
Notifications
You must be signed in to change notification settings - Fork 317
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
pre
& code
need the same newline treatment as ul
and li
#118
Comments
This is because <pre><code>a
b
c
</code></pre> renders as:
|
but <pre>
<code>a
b
c
</code>
</pre> renders as:
note the extra spacing because of newlines. |
Hmm. You're right. Was trying to avoid giving different HTML tags their own newline treatment, but you've made the point that it needs to be done. Would be great if the spec can have a line or two about expected newlines in the rendered markdown - since the spec checker checks the newlines as well, I think that would be beneficial. Newlines are implicitly part of the spec. |
The spec is trying to specify parsing, leaving some details of HTML rendering unspecified. HTML is used in the examples, instead of a custom representation of an abstract syntax tree, to make it easier for people to run the tests against their own markdown processors. But eventually we'll probably change that, so that the spec examples show an AST. (A program would then be provided that would take the HTML output of your markdown processor and convert it into this AST for the comparison.) |
That would be awesome. An AST would be perfect. Perhaps a JSON / YAML representation could be used to make it readable and as an interchange format - that way the use of the program would be optional. |
There's no clear guidance on newlines in the output HTML, either on whether there should be any or where they appear.
Particularly, the
<pre><code>
tag in Example 1 seems to be treated like a single unit, when it isn't. The is especially clear with list examples, where<ul>
and<li>
aren't stuck together.I'd suggest clarifying that leaf nodes may all have newlines after them, or that all HTML nodes do.
So Example 1 could be
or
depending on tag content whitespace trimming, and Example 2 would be
Making these changes will help treat the
code
node as a child ofpre
and apply newlines in a consistent way. Right now the spec seems to considerpre
andcode
as a single unit.The text was updated successfully, but these errors were encountered: