Commit dd6b11a
Remove the never-matching BOM rule from the Markdown grammar (#1820)
kpeg does not interpret `\u` escapes in string literals, so `BOM =
"\uFEFF"` generated `match_string("uFEFF")` and the rule has never
consumed a BOM since it was introduced.
Files are read through RDoc::Encoding, which already strips the BOM, and
no other markup parser handles it, so drop the rule instead of fixing
it.
```ruby
# :markup: markdown
# uFEFF is not a bom because backslash is missing
class A
end
```
↓
```html
<!-- before -->
<section class="description">
<p>is not a bom because backslash is missing</p>
<!-- after -->
<section class="description">
<p>uFEFF is not a bom because backslash is missing</p>
```
No test added: the only behavioral change is that a leading string
"uFEFF" is no longer eaten. I don't think we want a test to ensure that
"uFEFF" remains.
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>1 parent f7e570c commit dd6b11a
3 files changed
Lines changed: 4 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
569 | 569 | | |
570 | 570 | | |
571 | 571 | | |
572 | | - | |
| 572 | + | |
573 | 573 | | |
574 | 574 | | |
575 | 575 | | |
| |||
1180 | 1180 | | |
1181 | 1181 | | |
1182 | 1182 | | |
1183 | | - | |
1184 | 1183 | | |
1185 | 1184 | | |
1186 | 1185 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
962 | 962 | | |
963 | 963 | | |
964 | 964 | | |
965 | | - | |
| 965 | + | |
966 | 966 | | |
967 | 967 | | |
968 | 968 | | |
969 | 969 | | |
970 | | - | |
971 | | - | |
972 | | - | |
973 | | - | |
974 | | - | |
975 | | - | |
976 | | - | |
977 | | - | |
978 | | - | |
979 | | - | |
980 | 970 | | |
981 | 971 | | |
982 | 972 | | |
| |||
14777 | 14767 | | |
14778 | 14768 | | |
14779 | 14769 | | |
14780 | | - | |
14781 | | - | |
14782 | | - | |
14783 | | - | |
14784 | | - | |
14785 | | - | |
14786 | | - | |
14787 | 14770 | | |
14788 | 14771 | | |
14789 | 14772 | | |
| |||
16624 | 16607 | | |
16625 | 16608 | | |
16626 | 16609 | | |
16627 | | - | |
| 16610 | + | |
16628 | 16611 | | |
16629 | 16612 | | |
16630 | 16613 | | |
| |||
16838 | 16821 | | |
16839 | 16822 | | |
16840 | 16823 | | |
16841 | | - | |
16842 | 16824 | | |
16843 | 16825 | | |
16844 | 16826 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
0 commit comments