support HTML definition lists (<dl>
, <dt>
, and <dd>
)
#173
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #172.
New
convert_dt()
andconvert_dd()
functions are added that follow the PHP Markdown Extra syntax:https://michelf.ca/projects/php-markdown/extra/#def-list
If additional definition list dialects are requested in the future, a configuration option can be added to select the format.
No
convert_dl()
function is added; the child-tag conversion functions do all the work.The regression tests are updated to test various structures. I also used Pandoc to confirm that all Markdownify results are converted back to the expected HTML source.
Note: This pull request requires that #171 be merged first; otherwise the
test_dl
unit test will fail.Limitations
There are two limitations in this support, both related to the fact that blank lines are added outside the
convert_dt()
andconvert_dd()
function scopes.Limitation 1 - multiple terms sharing the same definition are not handled properly (the term lines are separated by a blank line instead of kept directly adjacent):
Limitation 2 - a blank line is always inserted before definitions, causing them to signify paragraph-based definitions even when they were not: