Commit 86455e9
committed
markdown escaping: Fix injection of escapes
c437630 ("Fix markdown character escaping bug (issue #1236)")
fixed the escaping of multiple markdown markers, but it dropped dividing
by two the number of escaped characters being injected:
- txt_frag[: -((num_escape_chars + 1) // 2)]
+ for _ in range(escape_run - 1):
This restores dividing by two the number of escapes, and restores the
test results accordingly, making it the behavior closer to
https://spec.commonmark.org/dingus/
Fixes: #12151 parent 6b9983f commit 86455e9
7 files changed
Lines changed: 70 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4486 | 4486 | | |
4487 | 4487 | | |
4488 | 4488 | | |
4489 | | - | |
| 4489 | + | |
4490 | 4490 | | |
4491 | 4491 | | |
4492 | 4492 | | |
| |||
4495 | 4495 | | |
4496 | 4496 | | |
4497 | 4497 | | |
4498 | | - | |
| 4498 | + | |
4499 | 4499 | | |
4500 | 4500 | | |
4501 | 4501 | | |
| |||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
121 | 122 | | |
122 | 123 | | |
123 | 124 | | |
124 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
125 | 154 | | |
126 | 155 | | |
127 | 156 | | |
| |||
130 | 159 | | |
131 | 160 | | |
132 | 161 | | |
133 | | - | |
134 | | - | |
| 162 | + | |
| 163 | + | |
135 | 164 | | |
136 | 165 | | |
137 | | - | |
138 | 166 | | |
| 167 | + | |
139 | 168 | | |
140 | 169 | | |
141 | 170 | | |
142 | | - | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
143 | 204 | | |
144 | 205 | | |
145 | 206 | | |
| |||
270 | 331 | | |
271 | 332 | | |
272 | 333 | | |
273 | | - | |
| 334 | + | |
274 | 335 | | |
275 | 336 | | |
276 | 337 | | |
| |||
0 commit comments