Skip to content

Commit

Permalink
Remove tabs at the beginning of the line in paragraphs
Browse files Browse the repository at this point in the history
  • Loading branch information
rlidwka committed Feb 14, 2017
1 parent 35e54db commit dc1c392
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/rules_inline/newline.js
Expand Up @@ -2,6 +2,9 @@

'use strict';

var isSpace = require('../common/utils').isSpace;


module.exports = function newline(state, silent) {
var pmax, max, pos = state.pos;

Expand Down Expand Up @@ -32,7 +35,7 @@ module.exports = function newline(state, silent) {
pos++;

// skip heading spaces for next line
while (pos < max && state.src.charCodeAt(pos) === 0x20) { pos++; }
while (pos < max && isSpace(state.src.charCodeAt(pos))) { pos++; }

state.pos = pos;
return true;
Expand Down
22 changes: 22 additions & 0 deletions test/fixtures/markdown-it/commonmark_extras.txt
Expand Up @@ -159,6 +159,28 @@ Info string in fenced code block can't contain marker used for the fence
<pre><code class="test`"></code></pre>
.

Tabs should be stripped from the beginning of the line
.
foo
bar
baz
.
<p>foo
bar
baz</p>
.

Tabs should not cause hardbreak, EOL tabs aren't stripped in commonmark 0.27
.
foo1
foo2
bar
.
<p>foo1
foo2<br>
bar</p>
.

Coverage. Directive can terminate paragraph.
.
a
Expand Down

0 comments on commit dc1c392

Please sign in to comment.