Skip to content

6.0.0

Compare
Choose a tag to compare
@iamacup iamacup released this 24 Feb 20:00
· 81 commits to master since this release
755c17b

WARNING POTENTIALLY BREAKING: NAME CHANGES FOR STYLES AND RENDER RULES

This release fixes up the naming convention for styles and rules so that, on the whole they match and are easier to use and understand. It also improves how the rules and styles are applied making styling even more flexible and accurate

POTENTIALLY BREAKING STUFF

  • Some render rules has been renamed
  • Some styles have been renamed
  • The default value of the mergeStyle prop is now true, meaning that all styles are merged not overwritten by default, if you relied on this behaviour, just set mergeStyle to false
  • The code_block (previously codeBlock) style does not apply to fence anymore, this is a separate style and render rule, if you want to change all code blocks make sure to modify either a parent style (body, for example) or both fence and code_block styles / render rules
  • lists have had their render hierarchy changed - important to know if you have overwritten styles further up / down the tree as they may be in different positions now

Render Rule Changes

From To
root body

Style Changes - General

From To
root body
codeBlock code_block
codeInline code_inline
headingContainer DELETED - use heading1...heading6
heading DELETED - use heading1...heading6
tableHeader thead
tableHeaderCell th
tableRow tr
tableRowCell td
textGroup textgroup
strikethrough s

Style Changes - Lists

While some of these things have been 'renamed' they have also been moved around in the hierarchy to make more sense - here is the current render setup:

-ordered_list
--list_item (which contains ordered_list_icon and ordered_list_content as styles without render rules)
---paragraph
----textgroup
-----text

-bullet_list
--list_item (which contains bullet_list_icon and bullet_list_content as styles without render rules)
---paragraph
----textgroup
-----text
From To
list DELETED - use list_item or bullet_list / ordered_list
listItem list_item
listUnordered bullet_list
listUnorderedItemIcon bullet_list_icon
listUnorderedItem bullet_list_content
listOrdered ordered_list
listOrderedItemIcon ordered_list_icon
listOrderedItem ordered_list_content

Other minor things

  • Removal of the examples directory, the readme has been significantly updated so maintaining a separate examples set does not seem needed

  • Updated the numbers documentation, the implementation behaves per markdown-it (commonmark) spec, but the documentation did not match that spec

The complete list of render rules and styles (also available in the readme) after the changes in this version

Render Rule Style(s)
body body
heading1 heading1
heading2 heading2
heading3 heading3
heading4 heading4
heading5 heading5
heading6 heading6
hr hr
strong strong
em em
s s
blockquote blockquote
bullet_list bullet_list
ordered_list ordered_list
list_item list_item - This is a special case that contains a set of pseudo classes that don't align to the render rule: ordered_list_icon, ordered_list_content, bullet_list_icon, bullet_list_content
code_inline code_inline
code_block code_block
fence fence
table table
thead thead
tbody tbody
th th
tr tr
td td
link link
blocklink blocklink
image image
text text
textgroup textgroup
paragraph paragraph
hardbreak hardbreak
softbreak softbreak
pre pre
inline inline
span span