Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions python/acl_anthology/utils/xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@
TAGS_WITH_MARKUP = {
"b",
"i",
"u",
"sc",
"tt",
"par",
"a",
"url",
"tex-math",
Comment thread
nschneid marked this conversation as resolved.
Outdated
"fixed-case",
"title",
"abstract",
Expand Down
17 changes: 17 additions & 0 deletions python/tests/utils/xml_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@ def test_xml_indent(inp, out):
"<title><i>Italics</i><b>Bold</b></title>",
False,
),
( # Formatting markup differences are not logically equivalent
"<abstract><b>Important</b> message</abstract>",
"<abstract>Important message</abstract>",
False,
),
)


Expand Down Expand Up @@ -388,6 +393,18 @@ def test_xml_assert_equals(a, b, should_be_equal):
<attachment type="software" hash="079d4f4b">2022.acl-long.48.software.zip</attachment>
</paper>""",
),
# Requires TAGS_WITH_MARKUP to include <tex-math>
(
"<abstract><tex-math>a</tex-math> <b>xxx</b></abstract>",
"<abstract><tex-math>a</tex-math> xxx</abstract>",
"<abstract><tex-math>a</tex-math> <b>xxx</b></abstract>",
),
# Requires TAGS_WITH_MARKUP to include <par/>
(
"<abstract>a<par/><b>xxx</b></abstract>",
"<abstract>a<par/>xxx</abstract>",
"<abstract>a<par/><b>xxx</b></abstract>",
),
)


Expand Down
Loading