All notable changes to
the dillonkearns/elm-markdown
elm package
will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- We now have nested list parsing! 🎉 A huge thanks to @LutSa and @klaftertief for their work on this! See #88.
- Multiline list items are parsed correctly (fixes #81).
- Fixed precedence - thematic breaks take precedence over new list item (fixes #59).
Breaking changes:
Markdown.Inline.Block
adds
| Strikethrough (List.List Markdown.Block.Inline)
Markdown.Renderer
now has a new field:
, strikethrough : List.List view -> view
- Handle some new code fence parsing corner cases. Thank you for the fixes Thomasin! See dillonkearns#69).
- Inline fold function can do things like gather all links in the markdown. See #53 (thank you @bburdette!).
- Setext headers are now parsed. See #65 (thank you @thomasin!).
- Allow for leading spaces in front of heading hashes, as per markdown spec. See #66 (thank you @pkeugine!).
- GitHub-Flavored Markdown tables are now parsed! Thank you Stephen! (See #52).
- The type for GitHub tables has been fixed. It was missing an outer
List
type.List (List (List Inline))
refers to rows of columns, with a list of inlines in each cell. For example, a cell could have Hello world, which would be two inlines (the plain text, followed by the italic text).
- Block data type has been changed to better reflect the naming in the markdown spec.
- The Renderer code is now in a separate module,
Markdown.Renderer
. - Heading levels are now given as a custom type to make it explicit that the values can't be greater than level 6. There's a helper function in the Block module to convert it to an Int.
- Some names in the
Renderer
record type have changed to better reflect the markdown spec's terminlogy. TheRenderer
also now has functions for displaying Github-Flavored Markdown tables. Take a look at this diff to see an example of how to upgrade your Renderer code: https://github.com/dillonkearns/elm-markdown/pull/35/files#diff-5d05b9d569f6fb96977355f9ff688eb4. Also note that Table parsing is only partially implemented now so it isn't currently turned on. The actual table parsing functionality will be coming in a future release. But you can handle the types now so we don't need to do a breaking change to introduce that functionality.
This release includes a lot of new passing specs! Big thanks to Pablo Hirafuji for his fantastic work on inline parsing in his markdown library, and for giving me permission to use it here 🙏
- Several parsing cases now fall back to inline parsing rather than giving an error.
- Inline parsing is totally revamped. Including
- Autolinks (no GFM autolinks yet)
- Backslash escaping support
- Hard line breaks
- Link references now work! (although link reference definitions that are defined in container blocks, like block quotes, are ignored. For now they must be defined at the top level, but they can be referenced anywhere.)
- Fallbacks work correctly for inline parsing (inlines will never cause the entire parser to fail now. In the future, it may include warnings, but you'll be able to render the fallback.)
- Some basic inline HTML parsing (doesn't yet support multi-line inline HTML, only multi-line HTML blocks, i.e. the HTML tag must be the first thing on the line).
- HTML comments, CDATA, processing instructions, and declarations are now parsed. They are not rendered, but they are available in the Block structure of your parsed AST. If you wanted to render them, you could transform your AST to change them to a rendering block.
- Added parsing for block quotes
- Added task list item parsing (breaking change: see an example here, or the full diff including ElmUi.elm here).
- Lines with only tabs or spaces no longer cause parsing errors. Instead, they go through the correct blank line handling. See #28.
- Fixed some other various cases, see the new test cases that are passing
- Got a 16x performance improvement thanks to this performance optimization trick!
- Just pushing README update with updated Ellie examples, see #22.
- Parse numbered lists (see #9). Thank you @stephenreddek!!!
- Fix HTML ordering bug (see #16). Thank you matheus23! 🎉🙏
- Lists with markers besides
-
are now handled, thanks to #8 (thank you Stephen Reddekopp 🙏)
- HTML attributes were cut short with certain escape characters. They are now correctly parsed, thanks to #11 (thank you Brian Ginsburg!!!)