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