Releases: miyuchina/mistletoe
v0.8.0
Added:
- Support escaped pipes in table cells (#85)
traverse()
function, to recursively yield children of a token (breadth-first traverse) (#94)- XWiki20Renderer - supports XWiki syntax 2.0 (#113)
Fixed:
- JIRARenderer is basically ready for real life scenarios now
- Read and write to files / console in UTF-8, so that UnicodeDecodeError-s and UnicodeEncodeError-s are avoided (#100)
- Various Markdown parsing problems (#86, #91)
- Removed over-escaping of URLs in HTML and Jira renderers (#102)
- TOCRenderer: The resulting
toc
property is properly generated (#88) - LaTeXRenderer: Escape underscores and percentages + don't escape in inline code (#93 / #112)
Testing:
v0.7.2
Fixed:
- Fixed incorrect handling of loose list (#54, #65, thanks @Rogdham and @vallentin)
- Fixed
FileWrapper
backstep afterStopIteration
(#58, thanks @Rogdham) - Allow more than one level of token subclass (#62, thanks @Rogdham)
- Tables can handle rows with missing columns (#67, thanks @Grollicus)
- Fixed unresolved reference (#73, thanks @vallentin)
- Fixed EOL markers in LaTeX tables (#79, thanks @liuq)
Testing:
v0.7.1
Fixed:
- only matching the first instance of
InlineCode
(#50, thanks @huettenhain); - normalize newlines after every line (#51, thanks @elebow and @rsrdesarrollo);
- trailing characters after reference definition.
Performance:
- small speed boost to
ParseToken.append_child
.
Version 0.7
Warning: this is a release that breaks backwards compatibility in non-trivial ways (hopefully for the last time!) Read the full release notes if you are updating from a previous version.
Features:
- all tests passing in CommonMark test suite (finally! 🎉)
- allow specifying span token precedence levels;
- new and shiny
span_tokenizer.tokenize
.
Fixed:
- well, all the CommonMark test cases..
ASTRenderer
crashes on tables with headers (#48, thanks @timfox456!)
Where I break backwards compatibility:
Previously span-level tokens need to have their children
attribute manually specified. This is no longer the case, as the children
attribute will automatically be set based on the class variable parse_group
, which correspond to the regex match group in which child tokens might occur.
As an example, previously GithubWiki
is implemented as this:
from mistletoe.span_token import SpanToken, tokenize_inner
import re
class GithubWiki(SpanToken):
pattern = re.compile(r'...')
def __init__(self, match_obj):
super().__init__(match_obj)
# alternatively, self.children = tokenize_inner(match_obj.group(1))
self.target = match_obj.group(2)
Now we can write:
from mistletoe.span_token import SpanToken
import re
class GithubWiki(SpanToken):
pattern = re.compile(r'...')
parse_inner = True # default value, can be omitted
parse_group = 1 # default value, can be omitted
precedence = 5 # default value, can be omitted
def __init__(self, match_obj):
self.target = match_obj.group(2)
If we have a span token that does not need further parsing, we can write:
class Foo(SpanToken):
pattern = re.compile(r'(foo)')
parse_inner = False
def __init__(self, match_obj):
self.content = match_obj.group(1)
See the readme for more details.
v0.6.2
Features:
- CommonMark compliant
CodeFence
; - CommonMark compliant
BlockCode
; - CommonMark compliant
HTMLBlock
; - CommonMark compliant
HTMLSpan
; - CommonMark compliant
AutoLink
; - CommonMark compliant
InlineCode
; - CommonMark compliant
Heading
; - CommonMark compliant
SetextHeading
; - added span-level token
LineBreak
; - better handling of lazy-continuation in
Quote
; Footnote
s can be defined in any block-level containers.
Fixes:
- loose lists conform to CommonMark spec (#44, thanks @huettenhain);
- not parsing sub-lists deeper than two levels (#46, thanks @daerhu);
FileWrapper._index
should not go below -1.
Development:
- refactored handling of
SetextHeading
; - removed
block_tokenizer.MismatchException
; - removed
_children
attribute, usingchildren
directly; (potentially breaking change?) - renamed
Separator
toThematicBreak
; - renamed
FootnoteBlock
toFootnote
; tokenize
andtokenize_inner
returns lists of tokens;- refactored CommonMark testing script.
v0.6.1
Features:
- CommonMark compliant
CodeFence
(#41); - allow multiple backticks for
InlineCode
; - strips whitespace around
InlineCode
;
Fixed:
Separator
needs at least three characters;- indented code blocks should not interrupt paragraphs (#40, thanks @joncass);
- crashes when sublists have different marker type (#42, thanks @JBartlett86);
- typo in
Paragraph.read
(#43, thanks @NatTupper); - preliminary fixes for handling loose lists (#44, thanks @huettenhain);
- removed corrupted
block_token.until
function; - html code language tags starts with "
language-
".
Version 0.6 Poinsettia
Features:
- added Pygments renderer to
contrib
(#35, thanks to @Bridouz); HTMLSpan
now supports comments (#37);- (more or less) Commonmark compliant List implementation (#40).
Fixes:
- changed logo to an actual mistletoe (#21, thanks to @liuq);
- allow lists after block tokens without newlines (#34, thanks to @huettenhain);
- recognize headings within paragraphs (#36);
- disallow opening space in html tag (#37).
Performance:
- removed
FileWrapper.normalize
; - utilized universal newline mode.
Breaking changes:
BlockToken.start
does not advance file iterator.
Special shout-out to @joncass for raising the unattributed issues above, and giving me the motivation to finally fix the list implementation!
Note that this is a release with major changes. If you notice any rough edges (as there will certainly be), please do not hesitate to open an issue.
v0.5.5
Features:
- added default render methods for all tokens;
- added
reset_tokens
function toblock_token
andspan_token
; - allowed
BlockToken.read
to return any iterable; - BaseRenderer is now available at mistletoe.BaseRenderer;
- added Scheme.
Fixes:
v0.5.4
Features:
- md2jira: read from stdin if no input file is given (#27, thanks @alexkolson!);
- better command line options and help messages;
- auto-splitlines when
mistletoe.markdown
is given a string; - inline tokens can span multiple lines (#30, thanks @duckwork!).
Fixes:
- TableRow now supports table shorthand (#29, thanks @huettenhain!);
- normalize line breaks.
... plus various refactors and documentation improvements.
v0.5.3
Features:
- shortened
mistletoe.markdown
keyword argument name (renderer_cls
torenderer
); - removed List reference lookup;
- list items can contain paragraphs (CM5.2);
- shorthand syntax added for tables (#26).
Fixed:
- ignored invisible characters at line end for
CodeFence
(#24); - fixed extra newlines for headings in JIRARenderer (#25, thanks @huettenhain!);
Development:
- moved documentation to
docs
directory; - solved the biggest mystery in the codebase.