@sushichan044/kg-core 0.3.0 → 0.4.1
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.
- package/README.md +6 -5
- package/dist/index.d.mts +208 -201
- package/dist/index.mjs +247 -55
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,12 +24,13 @@ import {
|
|
|
24
24
|
manuscriptGridComposer,
|
|
25
25
|
ParseError,
|
|
26
26
|
parseManuscript,
|
|
27
|
+
kakuyomuParser,
|
|
27
28
|
pixivParser,
|
|
28
29
|
ProofreadError,
|
|
29
30
|
proofreadManuscript,
|
|
30
31
|
} from "@sushichan044/kg-core";
|
|
31
32
|
|
|
32
|
-
const parsed = parseManuscript(source, { parser:
|
|
33
|
+
const parsed = parseManuscript(source, { parser: kakuyomuParser });
|
|
33
34
|
if (!parsed.ok) throw new Error(ParseError.describe(parsed.error));
|
|
34
35
|
|
|
35
36
|
const composed = composeManuscript(parsed.value, {
|
|
@@ -46,10 +47,10 @@ if (!proofread.ok) throw new Error(ProofreadError.describe(proofread.error));
|
|
|
46
47
|
const diagnostics = [...parsed.warnings, ...proofread.value];
|
|
47
48
|
```
|
|
48
49
|
|
|
49
|
-
`parseManuscript` uses `plainTextParser` when no parser is supplied. The
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
parser warning.
|
|
50
|
+
`parseManuscript` uses `plainTextParser` when no parser is supplied. The built-in
|
|
51
|
+
`pixivParser` normalizes ruby, bold, italic, and emphasis notation; `kakuyomuParser`
|
|
52
|
+
normalizes Kakuyomu ruby and emphasis marks. Malformed or unknown notation remains
|
|
53
|
+
visible and produces a parser warning.
|
|
53
54
|
|
|
54
55
|
`composeManuscript` requires a composer. The built-in grid composer produces a
|
|
55
56
|
self-contained snapshot containing the parsed manuscript, accepted settings,
|