added test course to fix corner cases like nested numbered lists
This commit is contained in:
parent
37d8c8e30f
commit
10408e5fa3
3 changed files with 45 additions and 1 deletions
|
@ -49,11 +49,12 @@ class MarkdownGenerator:
|
|||
|
||||
# row head
|
||||
h = textwrap.wrap(k, h_len, break_long_words=False)
|
||||
wrapper = textwrap.TextWrapper(d_len)
|
||||
wrapper = textwrap.TextWrapper(d_len,break_long_words=True,replace_whitespace=False)
|
||||
|
||||
# split test to wrap lines into correct length
|
||||
t = [wrapper.wrap(line) for line in v.split('\n')]
|
||||
|
||||
|
||||
# replace empty arrays from split with a empty string
|
||||
t = list(map(lambda e: [""] if e == [] else e, t))
|
||||
|
||||
|
|
10
test.md
Normal file
10
test.md
Normal file
|
@ -0,0 +1,10 @@
|
|||
----------------------------------------------------------------------------------------------------------------------------------
|
||||
Inhalt Test
|
||||
------------------------------------ ---------------------------------------------------------------------------------------------
|
||||
Modulinhalte 1. Section One
|
||||
2. Section Two
|
||||
1. Section Two Sub One
|
||||
2. Section Two Sub Two
|
||||
3. Section Two Sub Three
|
||||
4. Section Two Sub Four
|
||||
----------------------------------------------------------------------------------------------------------------------------------
|
33
test/simple/mod.test.yaml
Normal file
33
test/simple/mod.test.yaml
Normal file
|
@ -0,0 +1,33 @@
|
|||
|
||||
name:
|
||||
en: Test Course
|
||||
|
||||
|
||||
#
|
||||
# nested lists seem to work in Markdown only in the US style way
|
||||
#
|
||||
# reference here: https://meta.stackexchange.com/questions/85474/how-to-write-nested-numbered-lists
|
||||
#
|
||||
# note the parser actually corrects 'Tervuren' to 3 in resulting data
|
||||
#
|
||||
|
||||
content:
|
||||
en: |
|
||||
1. Dog
|
||||
|
||||
1. German Shepherd
|
||||
|
||||
2. Belgian Shepherd
|
||||
|
||||
1. Malinois
|
||||
|
||||
2. Groenendael
|
||||
|
||||
4. Tervuren
|
||||
|
||||
2. Cat
|
||||
|
||||
1. Siberian
|
||||
|
||||
2. Siamese
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue