From d13cefcc79be21dd52f95e5421887801acebf0f5 Mon Sep 17 00:00:00 2001 From: Guido Draheim Date: Mon, 5 Mar 2018 07:26:52 +0100 Subject: [PATCH] docs unescape from dbk entities --- docs/dbk2man.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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 = [] -- 2.40.0