polytypo 1.17.1 → 1.17.3
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/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/de-CH.json +1 -1
- data/lib/polytypo/data/fixtures/de-DE.json +9 -26
- data/lib/polytypo/data/fixtures/el.json +1 -1
- data/lib/polytypo/data/fixtures/en-GB.json +172 -1
- data/lib/polytypo/data/fixtures/en-US.json +181 -516
- data/lib/polytypo/data/fixtures/es.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 +48 -37
- 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/nl.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/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 +124 -9
- data/lib/polytypo/data/rules/order.json +1 -1
- data/lib/polytypo/modes/markdown.rb +109 -5
- data/lib/polytypo/modes/runner.rb +13 -4
- data/lib/polytypo/modes/spans.rb +45 -3
- data/lib/polytypo/version.rb +1 -1
- 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: edc406d95c832de832c565083d70026c88c9c81fbe5155c028546d4dd62b0bc7
|
|
4
|
+
data.tar.gz: 7a20dab89c59c83926fb46f2d1a068683b41c18a8e9c9366abf57b6e24bf3dd9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3a80f23b401fac0852442eddee666e318fc81658c1eab39c0112536b9310051088232100c1d7ee1ee8483282c47c9841c8c0034ebfa80550f12fb4c662dd1f34
|
|
7
|
+
data.tar.gz: 1eee25a1cff3f33f8a92b7fdd20c8def024658f840a4c5ffafeea6a85a08f2943c878f8101c614c29f5944ae28b80e712037d91cf8cf58261c505e2bbcfa7c6e
|
data/lib/polytypo/data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.17.
|
|
1
|
+
1.17.3
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"spec": "1.17.
|
|
2
|
+
"spec": "1.17.3",
|
|
3
3
|
"locale": "de-DE",
|
|
4
4
|
"cases": [
|
|
5
5
|
{
|
|
@@ -677,9 +677,7 @@
|
|
|
677
677
|
"id": "de-de-yaml-colon-split-declines-growth",
|
|
678
678
|
"rule": "dashes",
|
|
679
679
|
"mode": "yaml",
|
|
680
|
-
"keys": [
|
|
681
|
-
"description"
|
|
682
|
-
],
|
|
680
|
+
"keys": ["description"],
|
|
683
681
|
"in": "description: a:--b\n",
|
|
684
682
|
"out": "description: a:--b\n",
|
|
685
683
|
"note": "modes.md §3.8.6: `:` is an opaque unit inside a plain scalar, so the dash token sits at a span extremity and the `-spaced` replacement (2 → 3) is discarded by the edge-growth rule of §3.4. Without the split this becomes `a: – b`, which no longer parses as one scalar."
|
|
@@ -688,9 +686,7 @@
|
|
|
688
686
|
"id": "de-de-yaml-hash-split-declines-growth",
|
|
689
687
|
"rule": "dashes",
|
|
690
688
|
"mode": "yaml",
|
|
691
|
-
"keys": [
|
|
692
|
-
"description"
|
|
693
|
-
],
|
|
689
|
+
"keys": ["description"],
|
|
694
690
|
"in": "description: a--#b\n",
|
|
695
691
|
"out": "description: a--#b\n",
|
|
696
692
|
"note": "modes.md §3.8.6: `#` is an opaque unit inside a plain scalar for the same reason. Without the split this becomes `a – #b`, and everything from the hash becomes a comment."
|
|
@@ -699,9 +695,7 @@
|
|
|
699
695
|
"id": "de-de-yaml-block-prose",
|
|
700
696
|
"rule": "quotes",
|
|
701
697
|
"mode": "yaml",
|
|
702
|
-
"keys": [
|
|
703
|
-
"description"
|
|
704
|
-
],
|
|
698
|
+
"keys": ["description"],
|
|
705
699
|
"in": "description: |\n Er sagte \"hallo\" und ging\n",
|
|
706
700
|
"out": "description: |\n Er sagte „hallo“ und ging\n",
|
|
707
701
|
"note": "modes.md §8 item 4: the same construct in a locale whose quote glyphs are structurally different from en-US, so a fixture is not the same English output with a different locale field."
|
|
@@ -710,9 +704,7 @@
|
|
|
710
704
|
"id": "de-de-yaml-unlisted-key-untouched",
|
|
711
705
|
"rule": "dashes",
|
|
712
706
|
"mode": "yaml",
|
|
713
|
-
"keys": [
|
|
714
|
-
"description"
|
|
715
|
-
],
|
|
707
|
+
"keys": ["description"],
|
|
716
708
|
"in": "run: git diff -- a--b\n",
|
|
717
709
|
"out": "run: git diff -- a--b\n",
|
|
718
710
|
"note": "modes.md §3.8.2: the measured case. A keyless draft rewrote shell inside `run:`; `keys` is what makes it unreachable."
|
|
@@ -746,9 +738,7 @@
|
|
|
746
738
|
"id": "de-de-yaml-three-dash-against-colon",
|
|
747
739
|
"rule": "dashes",
|
|
748
740
|
"mode": "yaml",
|
|
749
|
-
"keys": [
|
|
750
|
-
"description"
|
|
751
|
-
],
|
|
741
|
+
"keys": ["description"],
|
|
752
742
|
"in": "description: a:---b\n",
|
|
753
743
|
"out": "description: a:---b\n",
|
|
754
744
|
"note": "modes.md §3.8.6 with §3.4's character clause: without it this became `description: a: – b`, which no longer parses — `: ` is a mapping indicator. The two-dash companion de-de-yaml-colon-split-declines-growth is caught by the length clause; only this one needs the character clause."
|
|
@@ -757,9 +747,7 @@
|
|
|
757
747
|
"id": "de-de-yaml-three-dash-against-hash",
|
|
758
748
|
"rule": "dashes",
|
|
759
749
|
"mode": "yaml",
|
|
760
|
-
"keys": [
|
|
761
|
-
"description"
|
|
762
|
-
],
|
|
750
|
+
"keys": ["description"],
|
|
763
751
|
"in": "description: a---#b\n",
|
|
764
752
|
"out": "description: a---#b\n",
|
|
765
753
|
"note": "modes.md §3.8.6 with §3.4's character clause: without it this became `description: a – #b`, and everything from the hash became a comment — the value silently truncated to `a –`."
|
|
@@ -769,10 +757,7 @@
|
|
|
769
757
|
"rule": "quotes",
|
|
770
758
|
"mode": "markdown",
|
|
771
759
|
"dialect": "commonmark",
|
|
772
|
-
"frontmatterKeys": [
|
|
773
|
-
"title",
|
|
774
|
-
"summary"
|
|
775
|
-
],
|
|
760
|
+
"frontmatterKeys": ["title", "summary"],
|
|
776
761
|
"in": "---\ntitle: Er sagte \"hallo\" laut\nsummary: Noch \"eins\" hier\nslug: \"er-sagte-hallo\"\n---\n\nIm Text \"so\" hier.\n",
|
|
777
762
|
"out": "---\ntitle: Er sagte „hallo“ laut\nsummary: Noch „eins“ hier\nslug: \"er-sagte-hallo\"\n---\n\nIm Text „so“ hier.\n",
|
|
778
763
|
"note": "modes.md §3.7.4: two listed plain scalars in a locale whose quote glyphs differ from English, with an unlisted slug between the block and the body. Each listed scalar is its own span and the marks pair inside it, so the German pair appears three times and the slug keeps its straight quotes."
|
|
@@ -781,9 +766,7 @@
|
|
|
781
766
|
"id": "de-de-yaml-single-quoted-escape-growth-declined",
|
|
782
767
|
"rule": "dashes",
|
|
783
768
|
"mode": "yaml",
|
|
784
|
-
"keys": [
|
|
785
|
-
"description"
|
|
786
|
-
],
|
|
769
|
+
"keys": ["description"],
|
|
787
770
|
"in": "description: 'a''--''b'\n",
|
|
788
771
|
"out": "description: 'a''--''b'\n",
|
|
789
772
|
"note": "modes.md §3.8.6 and §3.4: de-DE is a `-spaced` locale, so the dash would grow against a unit and the edge-growth rule discards it, as in fr. A second locale so that an implementation that does not split cannot pass on one cell alone."
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"spec": "1.17.
|
|
2
|
+
"spec": "1.17.3",
|
|
3
3
|
"locale": "en-GB",
|
|
4
4
|
"cases": [
|
|
5
5
|
{
|
|
@@ -1476,6 +1476,177 @@
|
|
|
1476
1476
|
}
|
|
1477
1477
|
],
|
|
1478
1478
|
"note": "modes.md §3.9.2: touching ranges are one protected run and give one marker."
|
|
1479
|
+
},
|
|
1480
|
+
{
|
|
1481
|
+
"id": "en-gb-markdown-commonmark-delimiter-space-deletion",
|
|
1482
|
+
"rule": "spaces",
|
|
1483
|
+
"mode": "markdown",
|
|
1484
|
+
"dialect": "commonmark",
|
|
1485
|
+
"in": "see booking._ , emails.booking_ here, and a , b.\n",
|
|
1486
|
+
"out": "see booking._ , emails.booking_ here, and a, b.\n",
|
|
1487
|
+
"note": "modes.md §3.4 delimiter-neighbour rule: deleting the space before the comma would turn the two underscores into emphasis delimiters that the input does not have; that edit is discarded. The same deletion beside ordinary text (a , b) is applied."
|
|
1488
|
+
},
|
|
1489
|
+
{
|
|
1490
|
+
"id": "en-gb-markdown-mdx-delimiter-space-deletion",
|
|
1491
|
+
"rule": "spaces",
|
|
1492
|
+
"mode": "markdown",
|
|
1493
|
+
"dialect": "mdx",
|
|
1494
|
+
"in": "see booking._ , emails.booking_ here, and a , b.\n",
|
|
1495
|
+
"out": "see booking._ , emails.booking_ here, and a, b.\n",
|
|
1496
|
+
"note": "modes.md §3.4: the delimiter-neighbour rule holds in both dialects."
|
|
1497
|
+
},
|
|
1498
|
+
{
|
|
1499
|
+
"id": "en-gb-markdown-commonmark-autolink-literal-closing-quote",
|
|
1500
|
+
"rule": "quotes",
|
|
1501
|
+
"mode": "markdown",
|
|
1502
|
+
"dialect": "commonmark",
|
|
1503
|
+
"in": "Visit \"https://example.com/a\" now, and \"this\" converts.\n",
|
|
1504
|
+
"out": "Visit \"https://example.com/a\" now, and ‘this’ converts.\n",
|
|
1505
|
+
"note": "modes.md §3.7.3 autolink-literal tail: the closing mark sits inside the tail, which is skipped, so the pair is left as typed rather than half-converted. A converted closing mark is not ASCII punctuation and would become part of the link destination."
|
|
1506
|
+
},
|
|
1507
|
+
{
|
|
1508
|
+
"id": "en-gb-markdown-mdx-autolink-literal-closing-quote",
|
|
1509
|
+
"rule": "quotes",
|
|
1510
|
+
"mode": "markdown",
|
|
1511
|
+
"dialect": "mdx",
|
|
1512
|
+
"in": "Visit \"https://example.com/a\" now, and \"this\" converts.\n",
|
|
1513
|
+
"out": "Visit \"https://example.com/a\" now, and ‘this’ converts.\n",
|
|
1514
|
+
"note": "modes.md §3.7.3: the autolink-literal tail is skipped in both dialects."
|
|
1515
|
+
},
|
|
1516
|
+
{
|
|
1517
|
+
"id": "en-gb-markdown-commonmark-autolink-literal-single-quotes",
|
|
1518
|
+
"rule": "quotes",
|
|
1519
|
+
"mode": "markdown",
|
|
1520
|
+
"dialect": "commonmark",
|
|
1521
|
+
"in": "See 'https://example.com/a' now and 'this' too.\n",
|
|
1522
|
+
"out": "See 'https://example.com/a' now and ‘this’ too.\n",
|
|
1523
|
+
"note": "modes.md §3.7.3 autolink-literal tail: the same for a single-quoted URL; the pair is left as typed and the pair around an ordinary word converts."
|
|
1524
|
+
},
|
|
1525
|
+
{
|
|
1526
|
+
"id": "en-gb-markdown-commonmark-autolink-literal-ellipsis",
|
|
1527
|
+
"rule": "ellipsis",
|
|
1528
|
+
"mode": "markdown",
|
|
1529
|
+
"dialect": "commonmark",
|
|
1530
|
+
"in": "Read https://example.com/a... then wait...\n",
|
|
1531
|
+
"out": "Read https://example.com/a... then wait…\n",
|
|
1532
|
+
"note": "modes.md §3.7.3 autolink-literal tail: dots directly after a bare URL belong to the tail and stay; the dots after a word convert."
|
|
1533
|
+
},
|
|
1534
|
+
{
|
|
1535
|
+
"id": "en-gb-markdown-commonmark-autolink-literal-after-punctuation",
|
|
1536
|
+
"rule": "quotes",
|
|
1537
|
+
"mode": "markdown",
|
|
1538
|
+
"dialect": "commonmark",
|
|
1539
|
+
"in": "He said \"www.example.com/a\" today and \"this\" too.\n",
|
|
1540
|
+
"out": "He said \"www.example.com/a\" today and ‘this’ too.\n",
|
|
1541
|
+
"note": "modes.md §3.7.3 autolink-literal tail: a www. address is found in the source wherever it starts, not only where a parser recognises a link, because parsers disagree about what may precede it. The pair around it is left as typed."
|
|
1542
|
+
},
|
|
1543
|
+
{
|
|
1544
|
+
"id": "en-gb-markdown-commonmark-autolink-literal-delimiter-inside",
|
|
1545
|
+
"rule": "quotes",
|
|
1546
|
+
"mode": "markdown",
|
|
1547
|
+
"dialect": "commonmark",
|
|
1548
|
+
"in": "He said \"www.example.com/a_b\" today and \"this\" too.\n",
|
|
1549
|
+
"out": "He said \"www.example.com/a_b\" today and ‘this’ too.\n",
|
|
1550
|
+
"note": "modes.md §3.7.3 autolink-literal tail: the scan runs over the merged span, so an underscore inside the address, which the parser reports as a separate token, does not hide the tail from it."
|
|
1551
|
+
},
|
|
1552
|
+
{
|
|
1553
|
+
"id": "en-gb-markdown-mdx-autolink-literal-delimiter-inside",
|
|
1554
|
+
"rule": "quotes",
|
|
1555
|
+
"mode": "markdown",
|
|
1556
|
+
"dialect": "mdx",
|
|
1557
|
+
"in": "He said \"www.example.com/a_b\" today and \"this\" too.\n",
|
|
1558
|
+
"out": "He said \"www.example.com/a_b\" today and ‘this’ too.\n",
|
|
1559
|
+
"note": "modes.md §3.7.3: the same in the mdx dialect."
|
|
1560
|
+
},
|
|
1561
|
+
{
|
|
1562
|
+
"id": "en-gb-markdown-commonmark-autolink-literal-after-digit",
|
|
1563
|
+
"rule": "ellipsis",
|
|
1564
|
+
"mode": "markdown",
|
|
1565
|
+
"dialect": "commonmark",
|
|
1566
|
+
"in": "See 1https://example.com/a... more and wait...\n",
|
|
1567
|
+
"out": "See 1https://example.com/a... more and wait…\n",
|
|
1568
|
+
"note": "modes.md §3.7.3 autolink-literal tail: the address is found wherever the scheme or www. appears, with no test on the preceding character, because a parser may read a link directly after a digit."
|
|
1569
|
+
},
|
|
1570
|
+
{
|
|
1571
|
+
"id": "en-gb-markdown-commonmark-autolink-literal-email-converts",
|
|
1572
|
+
"rule": "ellipsis",
|
|
1573
|
+
"mode": "markdown",
|
|
1574
|
+
"dialect": "commonmark",
|
|
1575
|
+
"in": "Mail foo@example.com... then wait...\n",
|
|
1576
|
+
"out": "Mail foo@example.com… then wait…\n",
|
|
1577
|
+
"note": "modes.md §3.7.3 autolink-literal tail: the tail rule covers http, https and www addresses only. An e-mail address ends where the parser says and the dots after it convert, as before."
|
|
1578
|
+
},
|
|
1579
|
+
{
|
|
1580
|
+
"id": "en-gb-markdown-commonmark-autolink-literal-terminator-kept",
|
|
1581
|
+
"rule": "dashes",
|
|
1582
|
+
"mode": "markdown",
|
|
1583
|
+
"dialect": "commonmark",
|
|
1584
|
+
"in": "Read https://example.com/a - fine and b - c\n",
|
|
1585
|
+
"out": "Read https://example.com/a – fine and b – c\n",
|
|
1586
|
+
"note": "modes.md §3.7.3 terminator guard: an edit that keeps U+0020 at the terminator is applied; a spaced hyphen after a bare URL still becomes an en dash when a word precedes the URL. The address alone at the start of the text is left as typed."
|
|
1587
|
+
},
|
|
1588
|
+
{
|
|
1589
|
+
"id": "en-gb-markdown-commonmark-shortcut-reference-label",
|
|
1590
|
+
"rule": "apostrophe",
|
|
1591
|
+
"mode": "markdown",
|
|
1592
|
+
"dialect": "commonmark",
|
|
1593
|
+
"in": "See [Smith's book] and [Smith's book][] and [it's][ref].\n\n[Smith's book]: https://example.com\n[ref]: https://example.com\n",
|
|
1594
|
+
"out": "See [Smith's book] and [Smith's book][] and [it’s][ref].\n\n[Smith's book]: https://example.com\n[ref]: https://example.com\n",
|
|
1595
|
+
"note": "modes.md §3.7.3 reference label: the text of a shortcut or collapsed reference link is also the label matched against its definition, so it is skipped; the text of a full reference link is free prose and converts."
|
|
1596
|
+
},
|
|
1597
|
+
{
|
|
1598
|
+
"id": "en-gb-markdown-mdx-shortcut-reference-label",
|
|
1599
|
+
"rule": "apostrophe",
|
|
1600
|
+
"mode": "markdown",
|
|
1601
|
+
"dialect": "mdx",
|
|
1602
|
+
"in": "See [Smith's book] and [Smith's book][] and [it's][ref].\n\n[Smith's book]: https://example.com\n[ref]: https://example.com\n",
|
|
1603
|
+
"out": "See [Smith's book] and [Smith's book][] and [it’s][ref].\n\n[Smith's book]: https://example.com\n[ref]: https://example.com\n",
|
|
1604
|
+
"note": "modes.md §3.7.3: the reference-label rule holds in both dialects."
|
|
1605
|
+
},
|
|
1606
|
+
{
|
|
1607
|
+
"id": "en-gb-markdown-commonmark-image-shortcut-reference-label",
|
|
1608
|
+
"rule": "apostrophe",
|
|
1609
|
+
"mode": "markdown",
|
|
1610
|
+
"dialect": "commonmark",
|
|
1611
|
+
"in": "See ![it's] and ![it's][] and ![it's][ref].\n\n[it's]: https://example.com/i.png\n[ref]: https://example.com/i.png\n",
|
|
1612
|
+
"out": "See ![it's] and ![it's][] and ![it’s][ref].\n\n[it's]: https://example.com/i.png\n[ref]: https://example.com/i.png\n",
|
|
1613
|
+
"note": "modes.md §3.7.3 reference label: the alt text of a shortcut or collapsed image reference is its label and is skipped; a full reference's alt text converts."
|
|
1614
|
+
},
|
|
1615
|
+
{
|
|
1616
|
+
"id": "en-gb-markdown-commonmark-bracketed-text-without-definition",
|
|
1617
|
+
"rule": "apostrophe",
|
|
1618
|
+
"mode": "markdown",
|
|
1619
|
+
"dialect": "commonmark",
|
|
1620
|
+
"in": "See [it's] and it's.\n",
|
|
1621
|
+
"out": "See [it’s] and it’s.\n",
|
|
1622
|
+
"note": "modes.md §3.7.3 reference label: square brackets that match no definition are not a link, so the text converts. A port that skips every bracketed run fails here."
|
|
1623
|
+
},
|
|
1624
|
+
{
|
|
1625
|
+
"id": "en-gb-markdown-commonmark-reference-label-defined-later-accepted-cost",
|
|
1626
|
+
"rule": "apostrophe",
|
|
1627
|
+
"mode": "markdown",
|
|
1628
|
+
"dialect": "commonmark",
|
|
1629
|
+
"in": "See [it's] and it's.\n\n[it’s]: https://example.com\n",
|
|
1630
|
+
"out": "See [it’s] and it’s.\n\n[it’s]: https://example.com\n",
|
|
1631
|
+
"note": "modes.md §3.7.3 reference label, accepted cost: text that matched no definition in the input converts to the spelling a definition uses and becomes a link. This direction cannot be closed without comparing definitions, and it creates a link rather than destroying one."
|
|
1632
|
+
},
|
|
1633
|
+
{
|
|
1634
|
+
"id": "en-gb-markdown-commonmark-footnote-labels",
|
|
1635
|
+
"rule": "apostrophe",
|
|
1636
|
+
"mode": "markdown",
|
|
1637
|
+
"dialect": "commonmark",
|
|
1638
|
+
"in": "Note[^a's] and it's.\n\n[^a's]: it's text\n",
|
|
1639
|
+
"out": "Note[^a's] and it’s.\n\n[^a's]: it’s text\n",
|
|
1640
|
+
"note": "modes.md §3.7.3: the label of a footnote call and of a footnote definition is skipped, so the two keep matching; the prose around and inside the footnote converts."
|
|
1641
|
+
},
|
|
1642
|
+
{
|
|
1643
|
+
"id": "en-gb-markdown-mdx-footnote-labels",
|
|
1644
|
+
"rule": "apostrophe",
|
|
1645
|
+
"mode": "markdown",
|
|
1646
|
+
"dialect": "mdx",
|
|
1647
|
+
"in": "Note[^a's] and it's.\n\n[^a's]: it's text\n",
|
|
1648
|
+
"out": "Note[^a's] and it’s.\n\n[^a's]: it’s text\n",
|
|
1649
|
+
"note": "modes.md §3.7.3: footnote labels are skipped in both dialects."
|
|
1479
1650
|
}
|
|
1480
1651
|
]
|
|
1481
1652
|
}
|