Skip to content

tab_length parameter ignored #414

@karepker

Description

@karepker

Input file:

* Test 1
  * Test A
  * Test B
* Test 2

run with markdown.markdownFromFile('input.md', tab_length=2) produces output file:

<ul>
<li>Test 1</li>
<li>Test A</li>
<li>Test B</li>
<li>Test 2</li>
</ul>

when it should produce a nested list.

I think I've found the issue. In markdown/blockprocessors.py line 304:

RE = re.compile(r'^[ ]{0,3}\d+\.[ ]+(.*)')

3 should be self.tab_length - 1. Similarly for CHILD_RE and INDENT_RE in OListProcessor, RE in UListProcessor, and CHILD_RE in both SaneOListProcessor and SaneUListProcessor.

When I make these changes locally, I get the expected output for my test case, and all other tests pass as well. See this commit in my fork of your repository.

I can send you a pull request with these changes if you'd like.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions