Commit 40b5253
committed
JATS writer: improve representation of divs
The writer now checks if the element used to represent (non-special)
divs has any `<boxed-text>` specific attributes. If it does, the writer
keeps wrapping the div contents in a `<boxed-text>`, as it did before.
Otherwise, the writer falls back to the more appropriate `<p>` element
or simply unwraps the div if the wrapping element wouldn't have any
attributes. The new behavior gives better semantic results in most
cases, as `<boxed-text>` should be used for text that "is outside the
flow of the narrative text", which doesn't apply to most divs.
"Special" divs, like those used to mark sections, are not affected by
this change.1 parent 15ddf41 commit 40b5253
4 files changed
Lines changed: 30 additions & 74 deletions
File tree
- src/Text/Pandoc/Writers
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
368 | 378 | | |
369 | 379 | | |
370 | 380 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
576 | 576 | | |
577 | 577 | | |
578 | 578 | | |
579 | | - | |
580 | | - | |
581 | | - | |
| 579 | + | |
582 | 580 | | |
583 | | - | |
584 | | - | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | | - | |
590 | | - | |
591 | | - | |
592 | | - | |
| 581 | + | |
| 582 | + | |
593 | 583 | | |
594 | 584 | | |
595 | 585 | | |
596 | 586 | | |
597 | | - | |
598 | | - | |
599 | | - | |
| 587 | + | |
600 | 588 | | |
601 | 589 | | |
602 | 590 | | |
603 | 591 | | |
604 | 592 | | |
605 | 593 | | |
606 | 594 | | |
607 | | - | |
608 | | - | |
609 | | - | |
610 | | - | |
611 | | - | |
612 | | - | |
613 | | - | |
| 595 | + | |
614 | 596 | | |
615 | 597 | | |
616 | 598 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
573 | 573 | | |
574 | 574 | | |
575 | 575 | | |
576 | | - | |
577 | | - | |
578 | | - | |
| 576 | + | |
579 | 577 | | |
580 | | - | |
581 | | - | |
582 | | - | |
583 | | - | |
584 | | - | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | | - | |
| 578 | + | |
| 579 | + | |
590 | 580 | | |
591 | 581 | | |
592 | 582 | | |
593 | 583 | | |
594 | | - | |
595 | | - | |
596 | | - | |
| 584 | + | |
597 | 585 | | |
598 | 586 | | |
599 | 587 | | |
600 | 588 | | |
601 | 589 | | |
602 | 590 | | |
603 | 591 | | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | | - | |
608 | | - | |
609 | | - | |
610 | | - | |
| 592 | + | |
611 | 593 | | |
612 | 594 | | |
613 | 595 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
576 | 576 | | |
577 | 577 | | |
578 | 578 | | |
579 | | - | |
580 | | - | |
581 | | - | |
| 579 | + | |
582 | 580 | | |
583 | | - | |
584 | | - | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | | - | |
590 | | - | |
591 | | - | |
592 | | - | |
| 581 | + | |
| 582 | + | |
593 | 583 | | |
594 | 584 | | |
595 | 585 | | |
596 | 586 | | |
597 | | - | |
598 | | - | |
599 | | - | |
| 587 | + | |
600 | 588 | | |
601 | 589 | | |
602 | 590 | | |
603 | 591 | | |
604 | 592 | | |
605 | 593 | | |
606 | 594 | | |
607 | | - | |
608 | | - | |
609 | | - | |
610 | | - | |
611 | | - | |
612 | | - | |
613 | | - | |
| 595 | + | |
614 | 596 | | |
615 | 597 | | |
616 | 598 | | |
| |||
0 commit comments