build: include <ul> in text panels

This commit is contained in:
ktyl 2023-08-10 00:47:54 +02:00
parent 358314e4cd
commit 2d58ddf640
1 changed files with 3 additions and 0 deletions

View File

@ -61,6 +61,9 @@ with open(dummy_file, 'r') as read_file, open(dest_file, 'w') as write_file:
# extract images from their enclosing <p> tags and put them in img panels
html = re.sub('(<p>(<img(?:.+)/>)</p>)', r'<div class="img-panel">\2</div>', html)
# wrap <ul> elements with <p> to get them into blocks
html = re.sub('(<ul>(\n|.)*</ul>)', r'<p>\1</p>', html)
# insert text-panel start between non-<p> and <p> elements
html = re.sub('((?<!</p>)\n)(<p>)', r'\1<div class="text-panel">\n\2', html)
# insert para-block end between <p> and non-<p> elements