polytypo 1.6.3 → 1.7.0

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.
Files changed (77) hide show
  1. package/README.md +27 -0
  2. package/dist/{chunk-VVBJZBXR.js → chunk-25XZKUNP.js} +1 -1
  3. package/dist/{chunk-VVBJZBXR.js.map → chunk-25XZKUNP.js.map} +1 -1
  4. package/dist/chunk-33SLJJSZ.cjs +33 -0
  5. package/dist/{chunk-TV4AZVHZ.cjs.map → chunk-33SLJJSZ.cjs.map} +1 -1
  6. package/dist/{chunk-RNH6KTYZ.cjs → chunk-54TSHDNC.cjs} +68 -20
  7. package/dist/chunk-54TSHDNC.cjs.map +1 -0
  8. package/dist/chunk-74I62TZ2.js +35 -0
  9. package/dist/chunk-74I62TZ2.js.map +1 -0
  10. package/dist/{chunk-ODTH774G.js → chunk-DAIPI5CX.js} +2 -2
  11. package/dist/{chunk-UB7HJ4MX.cjs → chunk-FMU74VA6.cjs} +1 -1
  12. package/dist/{chunk-UB7HJ4MX.cjs.map → chunk-FMU74VA6.cjs.map} +1 -1
  13. package/dist/{chunk-UOPLHOTJ.js → chunk-GUTUSN4K.js} +4 -4
  14. package/dist/{chunk-4ELGGQ7B.js → chunk-HBIIWBB5.js} +23 -27
  15. package/dist/chunk-HBIIWBB5.js.map +1 -0
  16. package/dist/chunk-HTCGXDEG.cjs +31 -0
  17. package/dist/{chunk-GZSUAD6M.cjs.map → chunk-HTCGXDEG.cjs.map} +1 -1
  18. package/dist/{chunk-JT3VGUUU.cjs → chunk-I2QPXPHX.cjs} +3 -3
  19. package/dist/{chunk-JT3VGUUU.cjs.map → chunk-I2QPXPHX.cjs.map} +1 -1
  20. package/dist/{chunk-2XWZW3RU.cjs → chunk-IQHYZG2K.cjs} +23 -27
  21. package/dist/chunk-IQHYZG2K.cjs.map +1 -0
  22. package/dist/{chunk-RZYVLO3Z.js → chunk-ITDTGCLJ.js} +2 -2
  23. package/dist/{chunk-27B32RJQ.js → chunk-JE2MK4CC.js} +59 -11
  24. package/dist/chunk-JE2MK4CC.js.map +1 -0
  25. package/dist/{chunk-UIUJSDBS.js → chunk-JVBK3LG3.js} +2 -2
  26. package/dist/{chunk-BCU7YHWD.cjs → chunk-MMXKQUAS.cjs} +4 -4
  27. package/dist/{chunk-BCU7YHWD.cjs.map → chunk-MMXKQUAS.cjs.map} +1 -1
  28. package/dist/{chunk-OHMN6WPZ.js → chunk-U5Y7C2L4.js} +21 -8
  29. package/dist/{chunk-OHMN6WPZ.js.map → chunk-U5Y7C2L4.js.map} +1 -1
  30. package/dist/{chunk-7DKZNZUD.cjs → chunk-VDLHT5CW.cjs} +35 -22
  31. package/dist/chunk-VDLHT5CW.cjs.map +1 -0
  32. package/dist/chunk-X6CI7GWV.cjs +35 -0
  33. package/dist/chunk-X6CI7GWV.cjs.map +1 -0
  34. package/dist/{errors-C1_sHGgx.d.ts → errors-DeHxbXRn.d.cts} +8 -0
  35. package/dist/{errors-C1_sHGgx.d.cts → errors-DeHxbXRn.d.ts} +8 -0
  36. package/dist/html.cjs +10 -10
  37. package/dist/html.cjs.map +1 -1
  38. package/dist/html.d.cts +3 -3
  39. package/dist/html.d.ts +3 -3
  40. package/dist/html.js +5 -5
  41. package/dist/html.js.map +1 -1
  42. package/dist/index.cjs +18 -17
  43. package/dist/index.cjs.map +1 -1
  44. package/dist/index.d.cts +2 -2
  45. package/dist/index.d.ts +2 -2
  46. package/dist/index.js +8 -7
  47. package/dist/index.js.map +1 -1
  48. package/dist/markdown.cjs +11 -10
  49. package/dist/markdown.cjs.map +1 -1
  50. package/dist/markdown.d.cts +2 -2
  51. package/dist/markdown.d.ts +2 -2
  52. package/dist/markdown.js +6 -5
  53. package/dist/markdown.js.map +1 -1
  54. package/dist/text.cjs +8 -8
  55. package/dist/text.cjs.map +1 -1
  56. package/dist/text.d.cts +3 -3
  57. package/dist/text.d.ts +3 -3
  58. package/dist/text.js +3 -3
  59. package/dist/text.js.map +1 -1
  60. package/dist/yaml.cjs +10 -9
  61. package/dist/yaml.cjs.map +1 -1
  62. package/dist/yaml.d.cts +3 -3
  63. package/dist/yaml.d.ts +3 -3
  64. package/dist/yaml.js +5 -4
  65. package/dist/yaml.js.map +1 -1
  66. package/package.json +1 -1
  67. package/dist/chunk-27B32RJQ.js.map +0 -1
  68. package/dist/chunk-2XWZW3RU.cjs.map +0 -1
  69. package/dist/chunk-4ELGGQ7B.js.map +0 -1
  70. package/dist/chunk-7DKZNZUD.cjs.map +0 -1
  71. package/dist/chunk-GZSUAD6M.cjs +0 -31
  72. package/dist/chunk-RNH6KTYZ.cjs.map +0 -1
  73. package/dist/chunk-TV4AZVHZ.cjs +0 -33
  74. /package/dist/{chunk-ODTH774G.js.map → chunk-DAIPI5CX.js.map} +0 -0
  75. /package/dist/{chunk-UOPLHOTJ.js.map → chunk-GUTUSN4K.js.map} +0 -0
  76. /package/dist/{chunk-RZYVLO3Z.js.map → chunk-ITDTGCLJ.js.map} +0 -0
  77. /package/dist/{chunk-UIUJSDBS.js.map → chunk-JVBK3LG3.js.map} +0 -0
package/README.md CHANGED
@@ -99,6 +99,33 @@ even four spaces is prose and a brace in it is a JSX expression: the same sample
99
99
  `POLYTYPO_MALFORMED_INPUT` instead. A fence or a code span is the one marker that means _code_ in
100
100
  both dialects.
101
101
 
102
+ Frontmatter is skipped whole by default, delimiters included — it is a machine-read block, and
103
+ `fr` would put a narrow no-break space in front of the colon of every field in it. On a site whose
104
+ frontmatter carries the headline that leaves the most visible string on the page untouched, so name
105
+ the keys you want processed:
106
+
107
+ ```ts
108
+ import { transform } from "polytypo/markdown";
109
+
110
+ transform(
111
+ `---\ntitle: He said "hello" once\nslug: "he-said-hello"\n---\n\nThe body was typeset all along.\n`,
112
+ { locale: "en-US", dialect: "commonmark", frontmatterKeys: ["title"] },
113
+ );
114
+ // ---
115
+ // title: He said “hello” once
116
+ // slug: "he-said-hello"
117
+ // ---
118
+ //
119
+ // The body was typeset all along.
120
+ ```
121
+
122
+ Without the option nothing in the block changes, and a key you do not name never does. The block is
123
+ read with the same scanner `yaml` mode uses, so it refuses the same constructs — a single-quoted
124
+ scalar containing `''` among them, which is how an apostrophe is written inside single quotes, so
125
+ `title: 'It''s a test'` comes back untouched. Double-quoted and plain scalars have no such limit.
126
+ The block is also processed separately from the body, which shows up in exactly one place: an
127
+ unbalanced quotation mark in `title` cannot pair with a mark in your first paragraph.
128
+
102
129
  `analyze()` runs the same pipeline and reports what it would do instead of doing it — one record
103
130
  per edit, each with the rule that made it and code-point offsets into the input you passed (into
104
131
  the **document**, in `html`, `markdown` and `yaml` mode, not into a span):
@@ -5837,4 +5837,4 @@ export {
5837
5837
  runRules,
5838
5838
  runRulesRecording
5839
5839
  };
5840
- //# sourceMappingURL=chunk-VVBJZBXR.js.map
5840
+ //# sourceMappingURL=chunk-25XZKUNP.js.map