@inshapardaz/likhari-converters 0.1.41 → 0.1.43-dev.323
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;AA4FhD,eAAO,MAAM,kBAAkB,EAAE,
|
|
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;AA4FhD,eAAO,MAAM,kBAAkB,EAAE,eAmDhC,CAAC"}
|
package/dist/plain-text/index.js
CHANGED
|
@@ -84,17 +84,14 @@ export const plainTextConverter = {
|
|
|
84
84
|
const children = paragraphs.map((paragraph) => ({
|
|
85
85
|
type: 'paragraph',
|
|
86
86
|
children: paragraph
|
|
87
|
-
?
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
version: 1,
|
|
96
|
-
},
|
|
97
|
-
]
|
|
87
|
+
? // A single newline is a soft line break: a line-break node, not a
|
|
88
|
+
// '\n' inside the text, so the editor treats the lines as lines.
|
|
89
|
+
paragraph.split(/\r?\n/).flatMap((line, index) => [
|
|
90
|
+
...(index > 0 ? [{ type: 'linebreak', version: 1 }] : []),
|
|
91
|
+
...(line === ''
|
|
92
|
+
? []
|
|
93
|
+
: [{ type: 'text', text: line, detail: 0, format: 0, mode: 'normal', style: '', version: 1 }]),
|
|
94
|
+
])
|
|
98
95
|
: [],
|
|
99
96
|
direction: 'ltr',
|
|
100
97
|
format: '',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inshapardaz/likhari-converters",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.43-dev.323",
|
|
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": {
|