Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix logic for indentation inside list items
This fixes problems with the markdownify logic for indentation inside list items. This PR uses a branch building on that for matthewwithanm#120, matthewwithanm#150 and matthewwithanm#151, so those three PRs should be merged first before merging this one. There is limited logic in markdownify for handling indentation in the case of nested lists. There are two major problems with this logic: * As it's in `convert_list`, causing a list to be indented when inside another list, it does not add indentation for any other elements such as paragraphs that may be found inside list items (or `<pre>`, `<blockquote>`, etc.), so such elements are wrongly not indented and terminate the list in the output. * It uses fixed indentation of one tab. Following CommonMark, a tab in Markdown is considered equivalent to four spaces, which is not sufficient indentation in ordered list items with a number of three or more digits. Fix both of these issues by making `convert_li` handle indentation for the contents of `<li>`, based on the length of the list item marker, rather than doing it in `convert_list` at all.
- Loading branch information