From 6a9b3c293af818b1a3db8acf39c7758828284abc Mon Sep 17 00:00:00 2001 From: Stefan Sauer Date: Fri, 13 Apr 2018 09:38:15 +0200 Subject: [PATCH] tools/c10e-html: strip html produced by xslt Remove some content that we won't produce in the new version to ease diffing. --- tools/c10e-html.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/c10e-html.py b/tools/c10e-html.py index d90ff7b..81e8a8d 100755 --- a/tools/c10e-html.py +++ b/tools/c10e-html.py @@ -6,6 +6,7 @@ import argparse import glob +import re import os import sys @@ -16,7 +17,18 @@ def prettify(filename): with open(filename, 'r') as doc: soup = BeautifulSoup(doc.read(), 'lxml') with open(filename, 'w') as doc: - doc.write(soup.prettify()) + html = soup.prettify() + # strip things that mkhtml2 is not producing to reduce the diff + html = html.replace('a class="link" href', 'a href') + html = html.replace('summary="Navigation header" ', '') + html = html.replace(""" +""", '') + html = re.sub(r'\s*]*>', '', html) + doc.write(html) def main(htmldir): -- 2.11.4.GIT