gutterpress 0.11.19-alpha.1 → 0.11.19-alpha.2

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/dist/api/index.js CHANGED
@@ -137,7 +137,7 @@ import {
137
137
  testRemoteAccess,
138
138
  updateExtensions,
139
139
  validateProjectExtensions
140
- } from "../index-n4ek1358.js";
140
+ } from "../index-eqxs5118.js";
141
141
  import"../index-ht1bcqdd.js";
142
142
  import {
143
143
  BuildError
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  runBuild,
3
3
  splitOutPath
4
- } from "./cli-mkn97gxp.js";
4
+ } from "./cli-55jd2t8p.js";
5
5
  import {
6
6
  log
7
- } from "./cli-5j0a5hmc.js";
7
+ } from "./cli-r7czdzyz.js";
8
8
  import {
9
9
  UsageError,
10
10
  parseFormat,
11
11
  parsePdfxFlavor,
12
12
  rejectExtraPositionals,
13
13
  rejectUnknownFlags
14
- } from "./cli-n3nd3sav.js";
14
+ } from "./cli-xf9b7ptc.js";
15
15
  import"./cli-ht1bcqdd.js";
16
16
  import"./cli-xx94a1k6.js";
17
17
  import {
@@ -0,0 +1,63 @@
1
+ /**
2
+ * The characters `source.characters` reports (#382), each with what the
3
+ * author types instead.
4
+ *
5
+ * They arrive by pasting from a chat model, a word processor, a web page or a
6
+ * PDF: typography the author did not choose (em dashes, curly quotes, an
7
+ * ellipsis character, arrows, emoji), look-alikes, and invisible characters
8
+ * that change what prints (a zero-width space splits a word, a byte-order
9
+ * mark at the top of a file turns the first heading into a paragraph).
10
+ *
11
+ * Every spelling here is plain ASCII that the renderer turns back into the
12
+ * same character: markdown-it's typographer (`typographer: true` in
13
+ * `lib/markdown/renderer.ts`) makes `---` an em dash and straight quotes
14
+ * curly, and HTML entities cover the rest. So an intentional use stays
15
+ * possible and visible in the source; only the raw pasted character is
16
+ * reported. « » „ ‚ ‹ › are deliberately absent: they are correct quotation
17
+ * marks in other languages and the typographer cannot produce them.
18
+ *
19
+ * PURE data, no imports: the desktop editor mirrors this module
20
+ * (`packages/desktop/src/lib/editor/special-characters.ts`) to mark the same
21
+ * characters as the author types, and `tests/editor/special-characters.test.ts`
22
+ * there holds the two copies equal.
23
+ */
24
+ /** Stable id for the kind of character, carried on each finding's `code`. */
25
+ export type CharacterCode =
26
+ /** The typographer makes it from plain typing (`---`, `"`, `...`). */
27
+ "typographer"
28
+ /** Looks like a quote mark or hyphen but is not one. */
29
+ | "lookalike"
30
+ /** Bullets, arrows, marks and emoji. */
31
+ | "symbol"
32
+ /** Zero-width, format and bidi characters. */
33
+ | "invisible"
34
+ /** A space that is not a plain space. */
35
+ | "whitespace"
36
+ /** A control character. */
37
+ | "control"
38
+ /** U+FFFD, left where an encoding error lost the real character. */
39
+ | "replacement"
40
+ /** A private-use code point: a glyph only its own font has. */
41
+ | "private-use";
42
+ export interface CharacterInfo {
43
+ /** Plain-language name, e.g. "Em dash". */
44
+ name: string;
45
+ code: CharacterCode;
46
+ /** What to do about it, as a sentence for the author. */
47
+ fix: string;
48
+ }
49
+ /**
50
+ * Every reported character, one code point at a time. Built from a string,
51
+ * not a regex literal: Bun's transpiler turns `\u2028` / `\u2029` escapes in
52
+ * a regex literal into the raw characters, which are line terminators, and
53
+ * the file no longer parses. Emoji are those shown as emoji by default, plus
54
+ * any pictograph followed by the emoji presentation selector (U+FE0F).
55
+ */
56
+ export declare const CHARACTER_PATTERN: RegExp;
57
+ /**
58
+ * Describe one character {@link CHARACTER_PATTERN} matched. Only called on
59
+ * matches, so the emoji fallback is the only branch left at the end.
60
+ */
61
+ export declare function describeCharacter(char: string): CharacterInfo;
62
+ /** `U+2014` for a character. */
63
+ export declare function codePointLabel(char: string): string;
@@ -0,0 +1 @@
1
+ export {};
@@ -8,3 +8,4 @@ import "./accessibility-alt-text";
8
8
  import "./accessibility-heading-order";
9
9
  import "./layout-markers";
10
10
  import "./merge-markers";
11
+ import "./characters";