| Total Complexity | 2 |
| Total Lines | 25 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | from panflute import convert_text |
||
| 2 | |||
| 3 | import pandoc_numbering |
||
| 4 | |||
| 5 | |||
| 6 | def conversion(markdown, format="markdown"): |
||
| 7 | doc = convert_text(markdown, standalone=True) |
||
| 8 | doc.format = format |
||
| 9 | pandoc_numbering.main(doc) |
||
| 10 | return doc |
||
| 11 | |||
| 12 | |||
| 13 | def verify_conversion(test, markdown, expected, format="markdown"): |
||
| 14 | doc = conversion(markdown, format) |
||
| 15 | text = convert_text( |
||
| 16 | doc, |
||
| 17 | input_format="panflute", |
||
| 18 | output_format="markdown", |
||
| 19 | extra_args=["--wrap=none"], |
||
| 20 | standalone=True, |
||
| 21 | ) |
||
| 22 | print(text.strip()) |
||
| 23 | print(expected.strip()) |
||
| 24 | test.assertEqual(text.strip(), expected.strip()) |
||
| 25 |