]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
web: don't display header/footer for manual pages
authorVincent Bernat <bernat@luffy.cx>
Sun, 13 Jan 2013 13:33:45 +0000 (14:33 +0100)
committerVincent Bernat <bernat@luffy.cx>
Sun, 13 Jan 2013 13:33:45 +0000 (14:33 +0100)
extensions/text.py

index db327c6f17410ab013caea120db4a65398cdf925..a4b4344c30ea6a98be924650d9e9eb9b127608cf 100644 (file)
@@ -45,9 +45,6 @@ class IncludeManpagePlugin(Plugin):
         # Escape HTML sequences
         output = cgi.escape(output)
 
-        # Add <br> for new lines
-        output = output.replace("\n", "<br>")
-
         # Dots
         output = re.sub('\\+\b\\+\bo\bo', '&raquo;', output)
 
@@ -57,4 +54,7 @@ class IncludeManpagePlugin(Plugin):
         output = re.sub('_\b(.)', r'<u>\1</u>', output)
         output = re.sub(r'\</u\>\<u\>', '', output)
 
+        # Remove header and footers and use <br> for new lines
+        output = "\n".join(output.split("\n")[2:-3])
+
         return output.decode('ascii', errors='replace')