mdutils icon indicating copy to clipboard operation
mdutils copied to clipboard

Can't make list of numbers

Open infinitesteps opened this issue 2 years ago • 2 comments

Describe the bug Can't create list of numeric items. Discovered when trying to list versions of software

To Reproduce

>>> from mdutils.mdutils import MdUtils
>>> mdf = MdUtils('foo.md', title='Foo')
>>> mdf.new_list(['foo', 'bar'])
>>> mdf.new_list(['1.2', '1.3'])
>>> mdf.create_md_file()

results:

Foo
===

- foo
- bar

1.2
1.3

Expected behavior

Foo
===

- foo
- bar

- 1.2
- 1.3

Desktop (please complete the following information):

  • macOS 12.6.5 (21G531)
  • Python 3.11.1
  • mdutils-1.6.0

infinitesteps avatar Jun 26 '23 12:06 infinitesteps

For anyone else needing to work around this problem, prefix each items with a space

mdf.new_list(items=[' ' + v for v in versions])

infinitesteps avatar Jun 26 '23 12:06 infinitesteps

Thanks for reporting it, I'll take a look.

didix21 avatar Jun 27 '23 06:06 didix21