Skip to content

Ignore unneeded tags in diffs for direct_html #1585

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 13, 2019
Merged
Changes from all 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
13 changes: 13 additions & 0 deletions integtest/html_diff
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,19 @@ def normalize_html(html):
parent = e.parent
e.unwrap()
parent.smooth()
# Asciidoctor suppports adding a `<meta name="description"` if a book
# defines a `:description:` attribute. Docbook doesn't. We're quite ok with
# adding it but we can ignore it in the diff because, well, we don't need
# to see it.
for e in soup.select("meta[name='description']"):
e.extract()
# Docbook renders "indexterms" with an inline anchor and asciidoctor
# doesn't. You can't see them and no one is linking to them and the links
# don't really do anything. So we're ok ignoring them.
for e in soup.select("a.indexterm"):
parent = e.parent
e.extract()
parent.smooth()

# Remove empty "class" attributes and sort the listed classes.
for e in soup.select('*'):
Expand Down