doc: wikiparser: Handle processing instructions

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2020-08-28 12:09:25 -04:00
1 parent f628a3ed0b
commit 40f853278b
1 file changed
+8 -2
+8 -2
View File
@@ -3,11 +3,11 @@
MoinMoin wiki parser
"""
import logging
import re
from enum import Enum
from pathlib import Path
from xml.sax.saxutils import escape
import logging
import re
ICONS_DIR = 'icons'
@@ -1216,6 +1216,12 @@ PlainText('dialog.')])])])]
if line.strip().startswith('##'):
continue
# Processing instructions, not rendered
if line.strip() and \
line.strip().split()[0] in ('#format', '#redirect', '#refresh',
'#pragma', '#deprecated', '#language'):
continue
# Table of Contents
match = re.match(r'<<TableOfContents\((\d*)\)>>', line)
if match: