Skip to content

Commit

Permalink
Fixing #428 by forcing the nestable tags
Browse files Browse the repository at this point in the history
By default the nestable tags aren't correctly configured in BeautifulSoup.
By adding them manually we make nested lists possible.
  • Loading branch information
Wim Vinckier committed Jan 13, 2015
1 parent 0628abb commit b30d201
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions everpad/provider/sync/note.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ def _prepare_content(self, content):
html=content[:limits.EDAM_NOTE_CONTENT_LEN_MAX]
))).strip().encode('utf8')

BeautifulSoup.NESTABLE_TAGS['li'] = ['ul', 'ol']
BeautifulSoup.NESTABLE_TAGS['ul'] = ['li']
BeautifulSoup.NESTABLE_TAGS['ol'] = ['li']

soup = BeautifulSoup(enml_content, selfClosingTags=[
'img', 'en-todo', 'en-media', 'br', 'hr',
])
Expand Down

0 comments on commit b30d201

Please sign in to comment.