mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 13:32:15 +00:00
Improved list handling in RML
This commit is contained in:
@@ -189,7 +189,7 @@
|
||||
<para>{{ item.name }}
|
||||
{% if item.description %}
|
||||
</para>
|
||||
<indent left="0.5cm">
|
||||
<indent left="0.6cm">
|
||||
{{ item.description|markdown:"rml" }}
|
||||
</indent>
|
||||
<para>
|
||||
|
||||
@@ -32,16 +32,15 @@ def markdown_filter(text, format='html'):
|
||||
|
||||
for list in soup.findAll(['ul','ol']):
|
||||
list['style'] = list.name
|
||||
for li in list.findAll('li'):
|
||||
p = soup.new_tag('p')
|
||||
p.string = li.text
|
||||
li.string = ''
|
||||
li.append(p)
|
||||
indent = soup.new_tag('indent')
|
||||
indent['left'] = '1.2cm'
|
||||
for li in list.findAll('li', recursive=False):
|
||||
text = li.find(text=True)
|
||||
text.wrap(soup.new_tag('p'))
|
||||
|
||||
content = list.replace_with(indent)
|
||||
indent.append(content)
|
||||
if list.parent.name != 'li':
|
||||
indent = soup.new_tag('indent')
|
||||
indent['left'] = '0.6cm'
|
||||
|
||||
list.wrap(indent)
|
||||
|
||||
# Paragraphs have a different tag
|
||||
for p in soup('p'):
|
||||
|
||||
BIN
db.sqlite3
BIN
db.sqlite3
Binary file not shown.
Reference in New Issue
Block a user