All notable changes will be documented in this file.
- Expose all of codeinfo to CodeBlock renderer (Tauren Mills)
- Include className in core props (Espen Hovlandsdal)
- Add
linkTarget
prop to optionally add atarget
attribute on links (James Simpson) - Fix typo in readme (Chase Ricketts)
- Allow using Commonmark 0.27 (Lukas Geiger)
- Update dependencies to latest versions (Espen Hovlandsdal)
- Enable Commonmark.js 0.26 compatibility (Espen Hovlandsdal)
- Fix bug where nodes would not be rendered due to duplicate keys (Espen Hovlandsdal)
- Fix regression in passing props to
Code
-nodes (Espen Hovlandsdal)
- Give
Code
renderers aninline
property that is always true, allowing reuse of renderer forCodeBlock
andCode
(Espen Hovlandsdal)
- Fix bug where lists, codeblocks and headings would not get passed
sourcepos
prop (Espen Hovlandsdal)
- Plain DOM-node renderers are now given only their respective props. Fixes warnings when using React >= 15.2 (Espen Hovlandsdal)
- New
transformImageUri
option allows you to transform URIs for images. (Petri Lehtinen)
- Fix image alt text when it includes special characters (Ramsay Stirling II)
- Pass
nodeKey
as prop to complex renderers. Fixes warning in React >= 15 (Espen Hovlandsdal)
- Also join sibling nodes within paragraphs and similar (Espen Hovlandsdal)
- Join sibling text nodes into one text node (Espen Hovlandsdal)
- Use strings as renderers in simple cases (Glen Mailer)
- Set keys on lists and code blocks (Guillaume Plique)
- Breaking change: Inline HTML nodes are now wrapped in a
<span>
, block HTML nodes in<div>
. This is necessary to properly support custom renderers.
- The default URI transformer no longer applies double URI-encoding.
- The default URI transformer is now exposed on the
uriTransformer
property of the renderer, allowing it to be reused. - Documentation for
transformLinkUri
-option.
- Breaking change: The renderer now requires Node 0.14 or higher. This is because the renderer uses stateless components internally.
- Breaking change:
allowNode
now receives different properties in the options argument. SeeREADME.md
for more details. - Breaking change: CommonMark has changed some type names.
Html
is nowHtmlInline
,Header
is nowHeading
andHorizontalRule
is nowThematicBreak
. This affects theallowedTypes
anddisallowedTypes
options. - Breaking change: A bug in the
allowedTypes
/disallowedTypes
andallowNode
options made them only applicable to certain types. In this version, all types are filtered, as expected. - Breaking change: Link URIs are now filtered through an XSS-filter by default, prefixing "dangerous" protocols such as
javascript:
withx-
(eg:javascript:alert('foo')
turns intox-javascript:alert('foo')
). This can be overridden with thetransformLinkUri
-option. Passnull
to disable the feature or a custom function to replace the built-in behaviour.
- New
renderers
option allows you to customize which React component should be used for rendering given types. SeeREADME.md
for more details. (Espen Hovlandsdal / Guillaume Plique) - New
unwrapDisallowed
option allows you to select if the contents of a disallowed node should be "unwrapped" (placed into the disallowed node position). For instance, setting this option to true and disallowing a link would still render the text of the link, instead of the whole link node and all it's children disappearing. (Espen Hovlandsdal) - New
transformLinkUri
option allows you to transform URIs in links. By default, an XSS-filter is used, but you could also use this for use cases like transforming absolute to relative URLs, or similar. (Espen Hovlandsdal)
- Provide index-based keys to generated elements to silent warnings from React (Guillaume Plique)
- Upgrade commonmark to latest version (Guillaume Plique)
- Allow passing
allowNode
- a function which determines if a given node should be allowed (Espen Hovlandsdal)
- Add support for specifying which types should be allowed -
allowTypes
/disallowedTypes
(Espen Hovlandsdal)
- Add support for hard linebreaks (marlonbaeten)
- Peer dependency for React was (incorrectly) set to >= 0.14.0, when 0.13.3 was supported.