svelte-lexical
now supports markdown shortcuts to format text and insert elements. Here are the supported shortcuts:
Transformer | Description |
---|---|
BOLD_STAR | Enclose text in ** to make it to bold (e.g. **bold text** ) |
BOLD_UNDERSCORE | Enclose text in ** to make it to bold (e.g. __bold text__ ) |
ITALIC_STAR | Enclose text in * to make it italic (e.g. *italic text\* ) |
ITALIC_UNDERSCORE | Enclose text in _ to make it italic (e.g. _italic text_ ) |
BOLD_ITALIC_STAR | Enclose text in **_ to make it to bold and italic (e.g. ***bold text*** ) |
BOLD_ITALIC_UNDERSCORE | Enclose text in ** to make it to bold and italic (e.g. ___bold text___ ) |
INLINE_CODE | Enclose text in backticks to convert it to inline code (e.g. `let value = 5` ) |
HIGHLIGHT | Enclose text in == to highlight (e.g. ==highlight== ) |
STRIKETHROUGH | Enclose text in ~~ for strikethrough (e.g. ~~strikethrough~~ ) |
HEADING | Type # to create a heading. Supports H1 to H6 (e.g. ### creates H3) |
QUOTE | Type > to create a quote |
CODE | Type ``` followed by space to create a code block |
UNORDERED_LIST | Tyoe - to create an unordered list |
ORDERED_LIST | Type 1. to create an ordered list (you can use any digit instead of 1 as starting number) |
CHECK_LIST | Type [] to create an check list |
LINK | Create a link using []() e.g. [Syed Umar Anis](http://umaranis.com) |
HR | Create horizontal rule using one of the following: --- , ___ , *** |
IMAGE | Create a image using ![]() e.g. ![Image Alt Text](https://i0.wp.com/umaranis.com/wp-content/uploads/2023/09/image.png) |
Other new features include options to clear formatting
, add subscript
and superscript
. For more details, see release notes here.