Spaces and newlines in tests

A number of the tests in spec.txt assume certain layout conventions in the HTML. Many of these have no effect on the rendered result, but they do cause my tests to fail. For example:

`code  
span`
     code: result == @html
     lhs:  "<p>`code  \nspan`</p>\n"
     rhs:  "<p><code>code span</code></p>\n"

My code adds a \n, while the test does not.

Given that inline elements are by their nature intended to create inline content, and that it would be abusing the markup to render then using display: block, is my markup incorrect to add the \n? If not, should the tests be more permissive?

Thanks for this work. It’s much appreciated.

Dave

+++ pragdave [Sep 03 14 23:20 ]:

A number of the tests in spec.txt assume certain layout conventions in
the HTML. Many of these have no effect on the rendered result, but they
do cause my tests to fail.

Given that inline elements are by their nature intended to create
inline content, and that it would be abusing the markup to render then
using display: block, is my markup incorrect to add the \n? If not,
should the tests be more permissive?

The spec explicitly says that consecutive whitespace inside a code span
is collapsed to a single space. You might quibble with that decision.

I guess I am “quibbling,” in that I don’t believe it is beneficial for the spec to include rules that have no effect on the visible output. It is difficult to implement a markdown parser—why make it harder with additional specifications that make no practical difference?

Cheers

Dave

I’d be interested in a reasoning for this whitespace eating behavior too, especially since there are some similar situations in the spec where it does not happen (e.g. examples 122/124, 249–252, 343).