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 2020-08-24 07:22:51 -07:00 committed by James Valleroy
parent f628a3ed0b
commit 40f853278b
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -3,11 +3,11 @@
MoinMoin wiki parser MoinMoin wiki parser
""" """
import logging
import re
from enum import Enum from enum import Enum
from pathlib import Path from pathlib import Path
from xml.sax.saxutils import escape from xml.sax.saxutils import escape
import logging
import re
ICONS_DIR = 'icons' ICONS_DIR = 'icons'
@ -1216,6 +1216,12 @@ PlainText('dialog.')])])])]
if line.strip().startswith('##'): if line.strip().startswith('##'):
continue continue
# Processing instructions, not rendered
if line.strip() and \
line.strip().split()[0] in ('#format', '#redirect', '#refresh',
'#pragma', '#deprecated', '#language'):
continue
# Table of Contents # Table of Contents
match = re.match(r'<<TableOfContents\((\d*)\)>>', line) match = re.match(r'<<TableOfContents\((\d*)\)>>', line)
if match: if match: