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
/
image.js
6 lines
(5 loc)
•
229 B
JavaScript
View Raw
1
2
3
4
5
6
import
{ $createImageNode }
from
'../../extensions/image/node.js'
;
export
const
image
= (
node, parser
) => {
const
lexicalNode = $createImageNode({
altText
: node.
alt
??
''
,
src
: node.
url
}); parser.
append
(lexicalNode); };