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

Errant space appears when indenting a code block in an ordered list item #584

Closed
khad opened this issue Apr 30, 2015 · 1 comment
Closed

Comments

@khad
Copy link

khad commented Apr 30, 2015

There seem to be some spaces coming into my code blocks to play. :)

Here is the input:

1. The first step.
2. Another step. We can call it the second one
3. This is obviously the third step.

    This is indented because it is part of the third step. Don't run this:

        this is indented with two tabs because it is a command you should never run

    Possible other command to never run:

        this is also indented with two tabs since it is another command you must never run

4. Last step. Please be done now.

This is the output from marked:

<li>The first step.</li>
<li>Another step. We can call it the second one</li>
<li><p>This is obviously the third step.</p>
<p> This is indented because it is part of the third step. Don't run this:</p>
<pre><code> this is indented with two tabs because it is a command you should never run
</code></pre><p> Possible other command to never run:</p>
<pre><code> this is also indented with two tabs since it is another command you must never run
</code></pre></li>
<li><p>Last step. Please be done now.</p>
</li>
</ol>

Note the spaces being prepended before "This is indented…" and "Possible other…". This isn't such a problem because HTML compresses whitespace. (But you might want to fix that as well.)

The main issue is the space being prepended to code blocks. Look for it right before "this is indented with two tabs…" and "this is also indented with two tabs…".

I am not sure why it is there or where it comes from. The behavior is the same when using four spaces instead of two tabs, so it doesn't appear to be related to spaces vs. tabs at all.

The space doesn't appear when parsing with the Markdown Dingus (or, coincidentally, GitHub's Markdown preview here). :)

They (and the other parsers I've used) produce the result I would expect:

<li>The first step.</li>
<li>Another step. We can call it the second one</li>
<li><p>This is obviously the third step.</p>

<p>This is indented because it is part of the third step. Don't run this:</p>

<pre><code>this is indented with two tabs because it is a command you should never run
</code></pre>

<p>Possible other command to never run:</p>

<pre><code>this is also indented with two tabs since it is another command you must never run
</code></pre></li>
<li><p>Last step. Please be done now.</p></li>
</ol>

I hope that helps. Please let me know if there is anything I can clarify. It's not a huge problem, but I suspect it can be resolved pretty easily. Then again, those are famous last words. I'm a writer not a developer. :)

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