UNPKG
@mkljczk/lexical-remark
Version:
latest (0.4.0)
0.4.0
0.3.9
This package contains Markdown helpers and functionality for Lexical using remark-parse.
@mkljczk/lexical-remark
/
lib
/
import
/
handlers
/
inlineCode.js
7 lines
(6 loc)
•
215 B
JavaScript
View Raw
1
2
3
4
5
6
7
import
{ $createTextNode }
from
'lexical'
;
export
const
inlineCode
= (
node, parser
) => {
const
lexicalNode = $createTextNode(node.
value
); lexicalNode.
toggleFormat
(
'code'
); parser.
append
(lexicalNode); };