]> granicus.if.org Git - zziplib/commitdiff
docs unescape from dbk entities
authorGuido Draheim <guidod@gmx.de>
Mon, 5 Mar 2018 06:26:52 +0000 (07:26 +0100)
committerGuido Draheim <guidod@gmx.de>
Mon, 5 Mar 2018 06:26:52 +0000 (07:26 +0100)
docs/dbk2man.py

index d227d2e899151fde42338005f4f57eed562c0d06..04fe57ae9a3e1496cbb2f469d3c6ab13f9cd06a0 100755 (executable)
@@ -40,6 +40,13 @@ def esc(text):
     text = text.replace(".", "\\&.")
     text = text.replace("-", "\\-")
     return text
+def unescape(text):
+    text = text.replace('&lt;', '<')
+    text = text.replace('&gt;', '>')
+    text = text.replace('&quot;', '"')
+    text = text.replace('&amp;', '&')
+    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("</function>", "\\fP")
    item = item.replace("<literal>", "\\fI")
    item = item.replace("</literal>", "\\fP")
-   return item 
+   return item
 
 def styleinfo():
    styles = []