Skip to content

Text starting with ** (bold) breaks new_list method #116

@LeskoIam

Description

@LeskoIam

Describe the bug

Using mk_file.new_list("...") with item string starting with ** (bald) is missing - in markdown.

To Reproduce

from mdutils.mdutils import MdUtils

md_file = MdUtils(file_name="report", title="Report")
md_file.new_header(level=1, title="Introduction")

md_file.new_list("This works ok".split())

produces

- This
- works
- ok

as expected.
Next line does not

md_file.new_list(["**value1**: 1", "**value2**: 2", "**value3**: 3"])
# Using marked_with with other signs does not help
# md_file.new_list(["**value1**: 1", "**value2**: 2", "**value3**: 3"], marked_with="+")

produces

**value1**: 1
**value2**: 2
**value3**: 3

Expected behavior
Even if ** are first characters list item should be added with correct formatting.

Screenshots
/

Desktop (please complete the following information):

  • OS: Win 10
  • Version (mdutils): 1.8.0

Additional context
/

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions