Commit 5c75d23
committed
Ignore nested STRONGs during rendering
STRONG, in most rendering engines, becomes bold. Bold cannot be applied to
text two times in most languages. This caps the number of times we attempt
to bold text when rendering.
Running `python3 -c 'pad = "_" * 100000; print(pad + "." + pad, end="")' | time ./build/src/cmark-gfm --to $LANG`
Before:
```
./build/src/cmark-gfm --to plaintext > /dev/null 12.29s user 0.00s system 99% cpu 12.321 total
./build/src/cmark-gfm --to commonmark > /dev/null 25.97s user 0.01s system 99% cpu 26.026 total
./build/src/cmark-gfm --to html > /dev/null 0.01s user 0.00s system 43% cpu 0.033 total
./build/src/cmark-gfm --to man > /dev/null 12.91s user 0.00s system 99% cpu 12.938 total
./build/src/cmark-gfm --to latex > /dev/null 13.13s user 0.01s system 99% cpu 13.159 total
```
After:
```
./build/src/cmark-gfm --to plaintext > /dev/null 0.01s user 0.01s system 39% cpu 0.030 total
./build/src/cmark-gfm --to commonmark > /dev/null 0.01s user 0.00s system 41% cpu 0.031 total
./build/src/cmark-gfm --to html > /dev/null 0.01s user 0.00s system 38% cpu 0.030 total
./build/src/cmark-gfm --to man > /dev/null 0.01s user 0.01s system 40% cpu 0.030 total
./build/src/cmark-gfm --to latex > /dev/null 0.01s user 0.00s system 39% cpu 0.033 total
```1 parent c32ef78 commit 5c75d23
5 files changed
+46
-32
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
200 | 203 | | |
201 | 204 | | |
202 | 205 | | |
| |||
405 | 408 | | |
406 | 409 | | |
407 | 410 | | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
412 | 417 | | |
413 | 418 | | |
414 | 419 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
364 | 364 | | |
365 | 365 | | |
366 | 366 | | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
371 | 373 | | |
372 | 374 | | |
373 | 375 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
392 | 394 | | |
393 | 395 | | |
394 | 396 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
232 | 234 | | |
233 | 235 | | |
234 | 236 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
57 | 60 | | |
58 | 61 | | |
59 | 62 | | |
| |||
0 commit comments