polytypo 1.29.0 → 1.30.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.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/polytypo/data/VERSION +1 -1
- data/lib/polytypo/data/fixtures/bg.json +1 -1
- data/lib/polytypo/data/fixtures/cs.json +1 -1
- data/lib/polytypo/data/fixtures/da.json +1 -1
- data/lib/polytypo/data/fixtures/de-CH.json +1 -1
- data/lib/polytypo/data/fixtures/de-DE.json +1 -1
- data/lib/polytypo/data/fixtures/el.json +1 -1
- data/lib/polytypo/data/fixtures/en-GB.json +1 -1
- data/lib/polytypo/data/fixtures/en-US.json +1 -1
- data/lib/polytypo/data/fixtures/es.json +1 -1
- data/lib/polytypo/data/fixtures/et.json +1 -1
- data/lib/polytypo/data/fixtures/fi.json +1 -1
- data/lib/polytypo/data/fixtures/fr-CA.json +1 -1
- data/lib/polytypo/data/fixtures/fr.json +1 -1
- data/lib/polytypo/data/fixtures/hr.json +1 -1
- data/lib/polytypo/data/fixtures/hu.json +1 -1
- data/lib/polytypo/data/fixtures/it.json +1 -1
- data/lib/polytypo/data/fixtures/locale-resolution.json +1 -1
- data/lib/polytypo/data/fixtures/lt.json +1 -1
- data/lib/polytypo/data/fixtures/lv.json +1 -1
- data/lib/polytypo/data/fixtures/nb.json +1 -1
- data/lib/polytypo/data/fixtures/nl.json +1 -1
- data/lib/polytypo/data/fixtures/nn.json +1 -1
- data/lib/polytypo/data/fixtures/pl.json +1 -1
- data/lib/polytypo/data/fixtures/pt-BR.json +1 -1
- data/lib/polytypo/data/fixtures/pt-PT.json +1 -1
- data/lib/polytypo/data/fixtures/ro.json +1 -1
- data/lib/polytypo/data/fixtures/ru.json +1 -1
- data/lib/polytypo/data/fixtures/sk.json +1 -1
- data/lib/polytypo/data/fixtures/sl.json +1 -1
- data/lib/polytypo/data/fixtures/sq.json +1 -1
- data/lib/polytypo/data/fixtures/sr.json +1 -1
- data/lib/polytypo/data/fixtures/sv.json +1 -1
- data/lib/polytypo/data/fixtures/tr.json +1 -1
- data/lib/polytypo/data/fixtures/uk.json +1 -1
- data/lib/polytypo/data/locales/registry.json +1 -1
- data/lib/polytypo/data/rules/modes.md +11 -1
- data/lib/polytypo/data/rules/order.json +1 -1
- data/lib/polytypo/modes/html.rb +1 -1
- data/lib/polytypo/version.rb +1 -1
- data/lib/polytypo.rb +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6e79003b325556a7bc53483e49a67e9c8b85bc502ba6a76eb6ffe0fb310b8ce8
|
|
4
|
+
data.tar.gz: c00d0eeded7fc2cdd43cd9eca6e46faa04838c9d750ce9580df382b8763b744d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 05f98cbb256c36f883ac8c405fb5d3b3fffb991ce8fdfaacf2a0a1bd936b36ad26f5190bd2e7d9ac8543a77f60a843617db9138739c681e908c47a9b6eb721b2
|
|
7
|
+
data.tar.gz: db2c38cfc1234349ab077dbe4e08b6e3546fdd3e866d9e67995fba813d7059c403d495798bd25bc184b899fbd0443642c2c431a2bc744bdd22eab09e7d79d9b0
|
data/README.md
CHANGED
|
@@ -62,6 +62,10 @@ Polytypo.transform(%q{<a title="test... wait">Wait... she said "go on."</a>}, lo
|
|
|
62
62
|
# => "<a title=\"test... wait\">Wait… she said “go on.”</a>"
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
+
`html` mode leaves ten elements alone, with everything inside them: `code`, `pre`, `kbd`, `samp`,
|
|
66
|
+
`var`, `script`, `style`, `textarea`, `svg` and `math`. If you walk a document with a parser of your
|
|
67
|
+
own, read `Polytypo::SKIPPED_ELEMENTS` instead of copying the names; it is a frozen array.
|
|
68
|
+
|
|
65
69
|
`locale:` has no default anywhere and must always be passed explicitly — there is no silent
|
|
66
70
|
fallback to English. `mode:` defaults to `"text"` if omitted.
|
|
67
71
|
|
data/lib/polytypo/data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.
|
|
1
|
+
1.30.0
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"spec": "1.
|
|
2
|
+
"spec": "1.30.0",
|
|
3
3
|
"$comment": "Locale resolution input. Algorithm is specified in spec/rules/locale-resolution.md and is identical in every runtime — never delegate it to a platform locale-negotiation library. \"spec\" here must track spec/VERSION exactly — it is not itself the global version source; scripts/validate-spec.mjs enforces the match.",
|
|
4
4
|
"locales": [
|
|
5
5
|
"en-US",
|
|
@@ -19,7 +19,7 @@ step 9 with §3.8.5's content-line condition, added in 1.10.0, §3.8.4's carriag
|
|
|
19
19
|
continuation line with the bails of §3.8.6 that use it, added in 1.11.0, and §3.8.4's node lines,
|
|
20
20
|
declined keys, node markers and own-line region, with the changes to steps 1, 3, 4, 5, 6, 7 and 8
|
|
21
21
|
that go with them, added in 1.11.0, and §3.9 with the amendments it carries to §3.1, §3.5 step 2,
|
|
22
|
-
§4, §5, §7 item 7 and §8, added in 1.13.0, and §3.4's delimiter-neighbour rule with §3.7.3's autolink-literal tail, terminator guard and reference labels, and the amendments they carry to §3.4's deletion paragraph, §5 items 2 and 3, its fifth-part note and testing obligation, and §6, added in 1.17.2, and §3.4's escape-and-reference rule with the amendments it carries to §3.6, §3.7.3, §5 item 2's fifth-part note, §5 item 3 and the testing obligation, added in 1.17.4, and §3.4's bracket-shape rule, added in 1.17.5, and §3.6's whitespace-only text node rule, added in 1.23.0, and §3.6's ignored-tag rule, added in 1.23.1).
|
|
22
|
+
§4, §5, §7 item 7 and §8, added in 1.13.0, and §3.4's delimiter-neighbour rule with §3.7.3's autolink-literal tail, terminator guard and reference labels, and the amendments they carry to §3.4's deletion paragraph, §5 items 2 and 3, its fifth-part note and testing obligation, and §6, added in 1.17.2, and §3.4's escape-and-reference rule with the amendments it carries to §3.6, §3.7.3, §5 item 2's fifth-part note, §5 item 3 and the testing obligation, added in 1.17.4, and §3.4's bracket-shape rule, added in 1.17.5, and §3.6's whitespace-only text node rule, added in 1.23.0, and §3.6's ignored-tag rule, added in 1.23.1, and §3.6's published list, added in 1.30.0).
|
|
23
23
|
|
|
24
24
|
---
|
|
25
25
|
|
|
@@ -587,6 +587,16 @@ guessing from its name is exactly the kind of heuristic that behaves differently
|
|
|
587
587
|
runtimes. **The skip list is closed**: extending it is a spec change, not an implementation
|
|
588
588
|
decision.
|
|
589
589
|
|
|
590
|
+
**The list is published (since 1.30.0).** Every runtime exposes the ten element names above, as
|
|
591
|
+
lowercase strings in the order the first bullet gives them, from its public API (from the `html`
|
|
592
|
+
entry point, in a runtime that has one) as a constant a caller cannot modify: a frozen array, a tuple, a constant array, or, where the
|
|
593
|
+
language has no immutable collection, a function that returns a fresh copy on each call. The
|
|
594
|
+
mode's own membership test is built from this list, not from a second copy of it, and it is exactly §3.6's ten names: a
|
|
595
|
+
caller that walks a document with its own parser (a `.tsx` file, a template) reads it to decide
|
|
596
|
+
which elements to leave alone. How the constant is named follows each runtime's own conventions,
|
|
597
|
+
and its README says where to find it. Nothing about the list changes: it stays closed, and the
|
|
598
|
+
value moves only with a spec version.
|
|
599
|
+
|
|
590
600
|
### 3.7 Skip list — `markdown`
|
|
591
601
|
|
|
592
602
|
#### 3.7.1 The dialect is chosen by the caller, never detected
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"spec": "1.
|
|
2
|
+
"spec": "1.30.0",
|
|
3
3
|
"$comment": "Single source of truth for pipeline order. Rules run in ascending `order`. Disabling a rule removes it from the sequence and never reorders the rest. Rule ids are public API (see docs/ARCHITECTURE.md section 5). \"spec\" here must track spec/VERSION exactly — it is not itself the global version source; scripts/validate-spec.mjs enforces the match.",
|
|
4
4
|
"rules": [
|
|
5
5
|
{
|
data/lib/polytypo/modes/html.rb
CHANGED
|
@@ -20,7 +20,7 @@ module Polytypo
|
|
|
20
20
|
# modes.md 3.6, exhaustive and CLOSED: extending it is a spec change, not an implementation
|
|
21
21
|
# decision. svg/math are here because in MathML a quotation mark, a hyphen and a prime are
|
|
22
22
|
# operators and identifiers -- substituting a curly glyph changes what the expression means.
|
|
23
|
-
SKIPPED_ELEMENTS = %w[code pre kbd samp var script style textarea svg math].freeze
|
|
23
|
+
SKIPPED_ELEMENTS = %w[code pre kbd samp var script style textarea svg math].each(&:freeze).freeze
|
|
24
24
|
|
|
25
25
|
# HTML5 void elements: never pushed onto the element stack, since an author is not required
|
|
26
26
|
# to close them and this tokenizer never synthesizes a matching end tag for one.
|
data/lib/polytypo/version.rb
CHANGED
data/lib/polytypo.rb
CHANGED
|
@@ -17,6 +17,10 @@ require_relative "polytypo/modes/yaml"
|
|
|
17
17
|
# (github.com/polytypo/polytypo). See spec/CONFORMANCE.md there for exactly what this runtime
|
|
18
18
|
# implements.
|
|
19
19
|
module Polytypo
|
|
20
|
+
# The elements whose whole subtree html mode leaves alone, as frozen lowercase strings in spec
|
|
21
|
+
# order (modes.md 3.6). The mode's own membership test reads this same array.
|
|
22
|
+
SKIPPED_ELEMENTS = Modes::Html::SKIPPED_ELEMENTS
|
|
23
|
+
|
|
20
24
|
# Applies polytypo's rule pipeline to +input+ and returns the result.
|
|
21
25
|
#
|
|
22
26
|
# +locale+ is required, with no default -- an unknown locale raises Polytypo::Error with
|