Mistletoe

Latest version: v1.3.0

Safety actively analyzes 613631 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 5

1.3.0

Added

* Add line numbers (`line_number` attribute) on all _block_ tokens during parsing (188).
* More thorough documentation and explanation of AST and tokens in the [Developer's Guide](https://github.com/miyuchina/mistletoe/blob/master/dev-guide.md) (within #188).
* `HtmlRenderer`: Option to skip HTML tokens parsing (74 via 204). Just pass `process_html_tokens=False` to the renderer's constructor.
* `LaTeXRenderer`: Add AMS packages for Math (207).

Fixed

* `MarkdownRenderer`: Penultimate lines of multiline fragments being ignored (201).
* `MathJaxRenderer`: Output inline math (in: `$...$`) correctly (out: `\(...\)`) (195).
* Make local installation work again with pip 23.2 and above (fb231b112ea5).

Changed

* `MarkdownRenderer`: Keep the original content spacing after the list marker (196 via 197).

*COMPATIBILITY REMARKS*:
* The old behavior can be enforced by passing `normalize_whitespace=True` to the renderer's constructor (202).
* Provided you create `ListItem`'s tokens directly via its constructor, you need to pass it a new parameter called `indentation` (number of spaces before the item marker):
diff
-def __init__(self, parse_buffer, prepend, leader):
+def __init__(self, parse_buffer, indentation, prepend, leader):


* Allow just 1 dash in Table delimiter cells (131 via 203).

For contributors:

* Improvements in the Python styling checks, setup and documentation - see [diff](https://github.com/miyuchina/mistletoe/compare/8bc913d1965640c83ca26c5425df12441b5ade36..b911e5b64a98d537bb44a0212cbf8fa708d37d48).

1.2.1

Fixed

* In v1.2.0, due to 182, using `HTMLRenderer` (the old class name) directly from the `mistletoe` package stopped working.

1.2.0

Fixed

* `FileWrapper`'s methods anchor/reset are DEPRECATED, use a more versatile get_pos/set_pos approach instead (186).
* `LaTeXRenderer`: Escape special characters in URLs of generated links (114 via 190).

Changed

* Do not escape double or single quotes _by default_ (181).
* As in GFM, tables are allowed to interrupt paragraphs _by default_ (166 via 187). Set `mistletoe.block_token.Table.interrupt_paragraph` to `false` if you need the old behavior.
* `PygmentsRenderer` no longer throws a `ClassNotFound` error if there is a code language specified which is not supported by the Pygments highlighter (183). If you still need to get the error, simply pass `fail_on_unsupported_language=True` to the renderer's constructor.
* Use strict PascalCase for class names (182). The old names like `HTMLRenderer` are marked as deprecated.

For contributors:

* Unify `assertEqual()` calls in all the tests (185).
* Starting to use [requirements.txt](https://pip.pypa.io/en/latest/user_guide/#requirements-files).
* `Scheme` renderer's `__main__` section turned into a proper unit test (189).
* The possibility of a block token to interrupt a paragraph was generalized (187). A token class just needs to define the `check_interrupts_paragraph(cls, lines) -> bool` method.

1.1.0

Added

* `MarkdownRenderer` - the long awaited renderer for outputting parsed AST back to the Markdown syntax (4, 162). 🎉
For this, parsing was extended to store additional information about the input markdown.
* New options to control whether `HTMLRenderer` should escape double and/or single quotes (176).

Fixed

* `Token.__repr__()` no longer outputs class attributes (172).
* Make `Scheme` (`scheme.py`) work again (7883f58d35b82).
* Make CI work again (121). Good news for both the maintainers and the contributors.

Changed

* "Simpler is better!": Revert back to `HTMLRenderer` _not_ escaping single quotes by default (176).
Note that we plan to extend this to _not_ escaping double quotes in the next version.
* As a side effect of 162, the AST token classes and parsing process was changed for more uniform behavior and API
(163).
* `ASTRenderer` no longer outputs _all_ token attributes, but only those listed in `Token.repr_attributes` (172).

Special thanks go to anderskaplan as the most active contributor of this release. 💪

1.0.1

**Fixed:**

* Do include package "mistletoe.contrib" in the built artifacts (177).

**Updated:**

* Make CONTRIBUTING.md more up-to-date.

1.0.0

**WARNING - Backwards compatibility changes:**

* 167: For practical reasons and for following common packaging practices, `contrib` folder got moved under the `mistletoe` folder / package. So if you reference a renderer from that folder, you need to reference it as `mistletoe.contrib.<renderer>` now.
* See "change handling of (white)space characters in code spans" below. We keep processing extra whitespace characters at the parsing level, so that all renderers can benefit from it out-of-the-box. Provided that a custom renderer, for whatever reason, relied on all the spaces being collapsed, it needs to do that collapsing itself now (e.g. `' '.join(re.split('[ \n]+', content.strip()))`, or `re.sub('[ \n]+', ' ', content.strip())`).

**Added:**

* `JIRARenderer`: Support link title notation, i.e. `[label](url "title")` gets transformed to `[label|url|title]` (161)

**Fixed:**

* Make the `traverse()` function actually work with various input parameters:
* filtering by class (157, 158)
* filtering by `depth` (159)
* Compatibility with the latest CommonMark specification v0.30 (108):
* Change handling of (white)space characters in code spans (156; in line with commonmark/commonmark-spec532 and commonmark/commonmark-spec569)
* Fix handling of tabs and parsing continuation lines within list items (89 via 164)
* Fix the other examples, mostly edge cases, from the spec (see 165 and 168 for details; 173 seems to be fixed as well)
* Make parsing of link reference definitions (a.k.a. `Footnote`s) more strict - spec compliant (132)
* Fix handling of special punctuation characters when parsing emphasis (96, 175)

**Updated:**

* Smaller inner working refactorings, like 171.

Page 1 of 5

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.