DjangoBB

Django based forum engine

  • You are not logged in.
  • Root
  • » Bugs
  • » HTMLParseError: malformed start tag [RSS Feed]

#1 Sept. 21, 2012 11:02:45

jedie
From: germany
Registered: 2012-07-12
Posts: 160
Reputation: +  1  -
Profile   Send e-mail  

HTMLParseError: malformed start tag

Users can get HTMLParseError in DjangoBB if he use Python <2.7.3

IMHO this should be added to the (not existing) README.

The Problem is in HTMLParser while replacing text smilies with pictures to exclude ‘a’, ‘pre’ and ‘span’ blocks.
Example and more info here: https://github.com/jedie/django-phpBB3/issues/14

A work-a-round is to disable smiles support with settings.DJANGOBB_SMILES_SUPPORT = False

Other work-a-round is to change smiles() in ./djangobb_forum/util.py to e.g.:

def smiles(data):
    """
    Replace text smiles.
    """
    try:
        parser = ExcludeTagsHTMLParser(_smile_replacer)
        parser.feed(data)
        smiled_html = parser.html
        parser.close()
    except HTMLParseError, err:
        smiled_html = data
    return smiled_html
So smilies would not replaced with picture, if HTMLParser can't parse the text.

EDIT: Create http://djangobb.org/ticket/238 for this

EDIT2: https://github.com/slav0nic/DjangoBB/pull/17




Some of my Projects:
* Migrate phpBB to DjangoBB with django-phpBB3
* DjangoBB github repro and information about my changes
* PyLucid CMS written in Django: http://www.pylucid.org/

Edited jedie (Sept. 21, 2012 11:29:31)

Offline

  • Root
  • » Bugs
  • » HTMLParseError: malformed start tag[RSS Feed]

Board footer

Moderator control

Powered by DjangoBB

Lo-Fi Version