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.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -0
  3. data/lib/polytypo/data/VERSION +1 -1
  4. data/lib/polytypo/data/fixtures/bg.json +1 -1
  5. data/lib/polytypo/data/fixtures/cs.json +1 -1
  6. data/lib/polytypo/data/fixtures/da.json +1 -1
  7. data/lib/polytypo/data/fixtures/de-CH.json +1 -1
  8. data/lib/polytypo/data/fixtures/de-DE.json +1 -1
  9. data/lib/polytypo/data/fixtures/el.json +1 -1
  10. data/lib/polytypo/data/fixtures/en-GB.json +1 -1
  11. data/lib/polytypo/data/fixtures/en-US.json +1 -1
  12. data/lib/polytypo/data/fixtures/es.json +1 -1
  13. data/lib/polytypo/data/fixtures/et.json +1 -1
  14. data/lib/polytypo/data/fixtures/fi.json +1 -1
  15. data/lib/polytypo/data/fixtures/fr-CA.json +1 -1
  16. data/lib/polytypo/data/fixtures/fr.json +1 -1
  17. data/lib/polytypo/data/fixtures/hr.json +1 -1
  18. data/lib/polytypo/data/fixtures/hu.json +1 -1
  19. data/lib/polytypo/data/fixtures/it.json +1 -1
  20. data/lib/polytypo/data/fixtures/locale-resolution.json +1 -1
  21. data/lib/polytypo/data/fixtures/lt.json +1 -1
  22. data/lib/polytypo/data/fixtures/lv.json +1 -1
  23. data/lib/polytypo/data/fixtures/nb.json +1 -1
  24. data/lib/polytypo/data/fixtures/nl.json +1 -1
  25. data/lib/polytypo/data/fixtures/nn.json +1 -1
  26. data/lib/polytypo/data/fixtures/pl.json +1 -1
  27. data/lib/polytypo/data/fixtures/pt-BR.json +1 -1
  28. data/lib/polytypo/data/fixtures/pt-PT.json +1 -1
  29. data/lib/polytypo/data/fixtures/ro.json +1 -1
  30. data/lib/polytypo/data/fixtures/ru.json +1 -1
  31. data/lib/polytypo/data/fixtures/sk.json +1 -1
  32. data/lib/polytypo/data/fixtures/sl.json +1 -1
  33. data/lib/polytypo/data/fixtures/sq.json +1 -1
  34. data/lib/polytypo/data/fixtures/sr.json +1 -1
  35. data/lib/polytypo/data/fixtures/sv.json +1 -1
  36. data/lib/polytypo/data/fixtures/tr.json +1 -1
  37. data/lib/polytypo/data/fixtures/uk.json +1 -1
  38. data/lib/polytypo/data/locales/registry.json +1 -1
  39. data/lib/polytypo/data/rules/modes.md +11 -1
  40. data/lib/polytypo/data/rules/order.json +1 -1
  41. data/lib/polytypo/modes/html.rb +1 -1
  42. data/lib/polytypo/version.rb +1 -1
  43. data/lib/polytypo.rb +4 -0
  44. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f78898e809a20abf58f74b52b924dab7bf6ce49d0ac8a6b9ff081d15597014ba
4
- data.tar.gz: 57538c0a426cc846163be42ed480e8876a75b8a1f9692d4d5fa669a83ffb6ae2
3
+ metadata.gz: 6e79003b325556a7bc53483e49a67e9c8b85bc502ba6a76eb6ffe0fb310b8ce8
4
+ data.tar.gz: c00d0eeded7fc2cdd43cd9eca6e46faa04838c9d750ce9580df382b8763b744d
5
5
  SHA512:
6
- metadata.gz: 3a18978cb61cf598c837277d85f2f0d6885c03b612fe32dd06e5b12a63b67be585d2bac4db6bcaa40100d395902c0b460d0b86e1585a5708208335cfb6e37f02
7
- data.tar.gz: 4a32ef57ae8e5ec76947a64579ff83261746d6c8d54ee42c9c17abf5a3a59f92651f8170b20a8b579aff4815fc7e13c12c2ae685109589eb0ef2e694e824c27c
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
 
@@ -1 +1 @@
1
- 1.29.0
1
+ 1.30.0
@@ -1,5 +1,5 @@
1
1
  {
2
- "spec": "1.29.0",
2
+ "spec": "1.30.0",
3
3
  "locale": "bg",
4
4
  "cases": [
5
5
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "spec": "1.29.0",
2
+ "spec": "1.30.0",
3
3
  "locale": "cs",
4
4
  "cases": [
5
5
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "spec": "1.29.0",
2
+ "spec": "1.30.0",
3
3
  "locale": "da",
4
4
  "cases": [
5
5
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "spec": "1.29.0",
2
+ "spec": "1.30.0",
3
3
  "locale": "de-CH",
4
4
  "cases": [
5
5
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "spec": "1.29.0",
2
+ "spec": "1.30.0",
3
3
  "locale": "de-DE",
4
4
  "cases": [
5
5
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "spec": "1.29.0",
2
+ "spec": "1.30.0",
3
3
  "locale": "el",
4
4
  "cases": [
5
5
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "spec": "1.29.0",
2
+ "spec": "1.30.0",
3
3
  "locale": "en-GB",
4
4
  "cases": [
5
5
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "spec": "1.29.0",
2
+ "spec": "1.30.0",
3
3
  "locale": "en-US",
4
4
  "cases": [
5
5
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "spec": "1.29.0",
2
+ "spec": "1.30.0",
3
3
  "locale": "es",
4
4
  "cases": [
5
5
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "spec": "1.29.0",
2
+ "spec": "1.30.0",
3
3
  "locale": "et",
4
4
  "cases": [
5
5
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "spec": "1.29.0",
2
+ "spec": "1.30.0",
3
3
  "locale": "fi",
4
4
  "cases": [
5
5
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "spec": "1.29.0",
2
+ "spec": "1.30.0",
3
3
  "locale": "fr-CA",
4
4
  "cases": [
5
5
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "spec": "1.29.0",
2
+ "spec": "1.30.0",
3
3
  "locale": "fr",
4
4
  "cases": [
5
5
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "spec": "1.29.0",
2
+ "spec": "1.30.0",
3
3
  "locale": "hr",
4
4
  "cases": [
5
5
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "spec": "1.29.0",
2
+ "spec": "1.30.0",
3
3
  "locale": "hu",
4
4
  "cases": [
5
5
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "spec": "1.29.0",
2
+ "spec": "1.30.0",
3
3
  "locale": "it",
4
4
  "cases": [
5
5
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "spec": "1.29.0",
2
+ "spec": "1.30.0",
3
3
  "cases": [
4
4
  {
5
5
  "id": "exact-en-us",
@@ -1,5 +1,5 @@
1
1
  {
2
- "spec": "1.29.0",
2
+ "spec": "1.30.0",
3
3
  "locale": "lt",
4
4
  "cases": [
5
5
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "spec": "1.29.0",
2
+ "spec": "1.30.0",
3
3
  "locale": "lv",
4
4
  "cases": [
5
5
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "spec": "1.29.0",
2
+ "spec": "1.30.0",
3
3
  "locale": "nb",
4
4
  "cases": [
5
5
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "spec": "1.29.0",
2
+ "spec": "1.30.0",
3
3
  "locale": "nl",
4
4
  "cases": [
5
5
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "spec": "1.29.0",
2
+ "spec": "1.30.0",
3
3
  "locale": "nn",
4
4
  "cases": [
5
5
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "spec": "1.29.0",
2
+ "spec": "1.30.0",
3
3
  "locale": "pl",
4
4
  "cases": [
5
5
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "spec": "1.29.0",
2
+ "spec": "1.30.0",
3
3
  "locale": "pt-BR",
4
4
  "cases": [
5
5
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "spec": "1.29.0",
2
+ "spec": "1.30.0",
3
3
  "locale": "pt-PT",
4
4
  "cases": [
5
5
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "spec": "1.29.0",
2
+ "spec": "1.30.0",
3
3
  "locale": "ro",
4
4
  "cases": [
5
5
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "spec": "1.29.0",
2
+ "spec": "1.30.0",
3
3
  "locale": "ru",
4
4
  "cases": [
5
5
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "spec": "1.29.0",
2
+ "spec": "1.30.0",
3
3
  "locale": "sk",
4
4
  "cases": [
5
5
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "spec": "1.29.0",
2
+ "spec": "1.30.0",
3
3
  "locale": "sl",
4
4
  "cases": [
5
5
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "spec": "1.29.0",
2
+ "spec": "1.30.0",
3
3
  "locale": "sq",
4
4
  "cases": [
5
5
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "spec": "1.29.0",
2
+ "spec": "1.30.0",
3
3
  "locale": "sr",
4
4
  "cases": [
5
5
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "spec": "1.29.0",
2
+ "spec": "1.30.0",
3
3
  "locale": "sv",
4
4
  "cases": [
5
5
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "spec": "1.29.0",
2
+ "spec": "1.30.0",
3
3
  "locale": "tr",
4
4
  "cases": [
5
5
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "spec": "1.29.0",
2
+ "spec": "1.30.0",
3
3
  "locale": "uk",
4
4
  "cases": [
5
5
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "spec": "1.29.0",
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.29.0",
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
  {
@@ -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.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Polytypo
4
- VERSION = "1.29.0"
4
+ VERSION = "1.30.0"
5
5
  end
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polytypo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.29.0
4
+ version: 1.30.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Iurii Rogulia