summaryrefslogtreecommitdiff
path: root/markdown/extensions/md_in_html.py
Commit message (Collapse)AuthorAgeFilesLines
* Use pyspelling to check spelling.Waylan Limberg2023-04-061-18/+19
| | | In addition to checking the spelling in our documentation, we are now also checking the spelling of the README.md and similar files as well as comments in our Python code.
* Fix typos and remove trailing spacesKian-Meng Ang2022-04-101-2/+2
|
* [style]: fix various typos in docstrings and commentsFlorian Best2022-03-181-2/+2
|
* Ensure <summary> tags are parsed correctly.Waylan Limberg2021-11-031-2/+3
| | | | Fixes #1079.
* Properly parse unclosed tags in code spansWaylan Limberg2020-11-231-0/+20
| | | | | | | * fix unclosed pi in code span * fix unclosed dec in code span * fix unclosed tag in code span Closes #1066.
* Properly parse processing instructions in md_in_htmlWaylan Limberg2020-11-191-4/+1
| | | | | | | Empty tags do not have a `mardkown` attribute set on them. Therefore, there is no need to check the mdstack to determine behavior. If we are in any md_in_html state (regardless of block, span, etc) the behavior is the same. Fixes #1070.
* Properly parse code spans in md_in_html (#1069)Waylan Limberg2020-11-181-13/+14
| | | | | | | | | | This reverts part of 2766698 and re-implements handling of tails in the same manner as the core. Also, ensure line_offset doesn't raise an error on bad input (see #1066) and properly handle script tags in code spans (same as in the core). Fixes #1068.
* Fix issues related to hr tagsIsaac Muse2020-10-241-6/+35
| | | | | | | | | | | Ensure that start/end tag handler does not include tags in the previous paragraph. Provide special handling for tags like hr that never have content. Use sets for block tag lists as they are much faster when comparing if an item is in the list. Fixes #1053.
* Ensure when tag text is None that it is converted to empty stringIsaac Muse2020-10-211-0/+2
| | | Fixes #1049
* Unify all block-level tags. (#1048)Waylan Limberg2020-10-201-24/+19
| | | | | | Use the list of tags defined in the core by the md_in_html extension. This ensures that the lists do not diverge and allows users and/or extensions to expand the list in the core and have that change affect the extension. Fixes #1047.
* Properly parse inline HTML in md_in_htmlIsaac Muse2020-10-191-5/+31
| | | Fixes #1040 and fixes #1045.
* Account for Etree Elements in HTML StashWaylan Limberg2020-10-141-0/+12
| | | | | | | | | | | | | | | | By calling str on all stash elements we ensure they don't raise an error. Worse case, soemthing like `<Element 'div' at 0x000001B2DAE94900>` gets inserted into the output. However, with the override in the md_in_html extension, we actually serialize and reinsert the original HTML. Worse case, an HTML block which should be parsed as Markdown gets skipped by the extension (`<div markdown="block"></div>` gets inserting into the output). The tricky part is testing as there should be no known cases where this ever occurs. Therefore, we forefully pass an etree Element directly to the method in the test. That said, as #1040 is unresolved at this point, I have tested locally with a real existing case and it works well. Related to #1040.
* Refactor HTML Parser (#803)Waylan Limberg2020-09-221-61/+242
| | | | | | | | | | The HTML parser has been completely replaced. The new HTML parser is built on Python's html.parser.HTMLParser, which alleviates various bugs and simplifies maintenance of the code. The md_in_html extension has been rebuilt on the new HTML Parser, which drastically simplifies it. Note that raw HTML elements with a markdown attribute defined are now converted to ElementTree Elements and are rendered by the serializer. Various bugs have been fixed. Link reference parsing, abbreviation reference parsing and footnote reference parsing has all been moved from preprocessors to blockprocessors, which allows them to be nested within other block level elements. Specifically, this change was necessary to maintain the current behavior in the rebuilt md_in_html extension. A few random edge-case bugs (see the included tests) were resolved in the process. Closes #595, closes #780, closes #830 and closes #1012.
* Simplify xml.etree.ElementTree loading (#902)Dmitry Shachnev2020-02-031-1/+2
| | | | | | | | cElementTree is a deprecated alias for ElementTree since Python 3.3. Also drop the recommendation to import etree from markdown.util, and deprecate markdown.util.etree.
* Drop support for Python 2.7 (#865)Hugo van Kemenade2019-10-241-2/+0
| | | | | | | * Python syntax upgraded using `pyupgrade --py3-plus` * Travis no longer uses `sudo`. See https://blog.travis-ci.com/2018-11-19-required-linux-infrastructure-migration See #760 for Python Version Support Timeline and related dicussion.
* Separate Markdown parsing in HTML to separate extension (#859)Isaac Muse2019-09-041-0/+101
Move Markdown parsing from the extra extension to a separate extension called md_in_html.