From: Guido Draheim Date: Mon, 5 Mar 2018 06:26:52 +0000 (+0100) Subject: docs unescape from dbk entities X-Git-Tag: v0.13.69~19 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d13cefcc79be21dd52f95e5421887801acebf0f5;p=zziplib docs unescape from dbk entities --- diff --git a/docs/dbk2man.py b/docs/dbk2man.py index d227d2e..04fe57a 100755 --- a/docs/dbk2man.py +++ b/docs/dbk2man.py @@ -40,6 +40,13 @@ def esc(text): text = text.replace(".", "\\&.") text = text.replace("-", "\\-") return text +def unescape(text): + text = text.replace('<', '<') + text = text.replace('>', '>') + text = text.replace('"', '"') + text = text.replace('&', '&') + return text + def refentryinfo2(refentry, title): date, productname, manvolnum, refentrytitle = "", "", "", "" @@ -170,7 +177,7 @@ def refsections2(refentry, title = ""): return text def cleanpara(para): - item = ET.tostring(para) + item = unescape(ET.tostring(para)) item = item.replace("\n", " ") item = item.replace(" ", " ") item = item.replace(" ", " ") @@ -184,7 +191,7 @@ def cleanpara(para): item = item.replace("", "\\fP") item = item.replace("", "\\fI") item = item.replace("", "\\fP") - return item + return item def styleinfo(): styles = []