@inshapardaz/likhari-converters 0.1.4-dev.23 → 0.1.4-dev.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plain-text/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plain-text/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAyDhD,eAAO,MAAM,kBAAkB,EAAE,eAkDhC,CAAC"}
|
package/dist/plain-text/index.js
CHANGED
|
@@ -14,6 +14,12 @@ function nodeToText(node, listItemIndex = 0) {
|
|
|
14
14
|
if (node.type === 'text' || node.type === 'linebreak') {
|
|
15
15
|
return node.text ?? (node.type === 'linebreak' ? '\n' : '');
|
|
16
16
|
}
|
|
17
|
+
// Images have no plain-text form; keep their alt text (or caption) so
|
|
18
|
+
// previews and search indexing still see what the image is about.
|
|
19
|
+
if (node.type === 'image') {
|
|
20
|
+
const image = node;
|
|
21
|
+
return image.altText || image.caption || '';
|
|
22
|
+
}
|
|
17
23
|
if (node.type === 'list' && withChildren.children) {
|
|
18
24
|
const listType = node.listType ?? 'bullet';
|
|
19
25
|
return withChildren.children
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inshapardaz/likhari-converters",
|
|
3
|
-
"version": "0.1.4-dev.
|
|
3
|
+
"version": "0.1.4-dev.27",
|
|
4
4
|
"description": "Format transformers (Markdown/HTML/plain-text/Lexical JSON) against the canonical Lexical EditorState, isolated from UI.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|