Skip to content
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

v 2.1.0 does not preserve whitespace in <pre> blocks #263

Closed
keertip opened this issue Sep 24, 2019 · 2 comments
Closed

v 2.1.0 does not preserve whitespace in <pre> blocks #263

keertip opened this issue Sep 24, 2019 · 2 comments

Comments

@keertip
Copy link
Contributor

keertip commented Sep 24, 2019

Upgraded to 2.1.0 from 2.0.3 and see a test failure in dartdoc with text like

Sample class [String]\n<pre> A\n B\n</pre>

markdown removes the whitespace before A and B, using HtmlRenderer().render.

@srawlins
Copy link
Member

What did that source use to render? What does it render now? Using the command-line tool, it looks like it just puts the source between <p> and </p>, w/o parsing any markdown between:

$ dart bin/markdown.dart
Sample class [String]\n<pre> A\n B\n</pre>^D
<p>Sample class [String]\n<pre> A\n B\n</pre></p>

@keertip
Copy link
Contributor Author

keertip commented Sep 24, 2019

Passing in a node that's text <pre>\n A\n B\n</pre>, get back string <pre>A\nB\n</pre>

From the test

 Expected: '<p>Sample class <code>String</code></p><pre class="language-dart">  A\n'
              '   B\n'
              '</pre>'
    Actual: '<p>Sample class <code>String</code></p><pre class="language-dart">A\n'
              'B\n'
              '</pre>'
     Which: is different.
            Expected: ... age-dart">  A\n   B\ ...
              Actual: ... age-dart">A\nB\n</pr ...
                                    ^
             Differ at offset 66

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants