nekohayo / specto

Automatically exported from code.google.com/p/specto
0 stars 0 forks source link

entity problem with a certain watch #94

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. use the attached watch list
2. refresh/restart specto until the website "specto translation" is marked
updated
3. click on the watch

What is the expected output? What do you see instead?
/home/jeff/trunks/specto-woutc/spectlib/notifier.py:206: GtkWarning: Failed
to set text from markup due to error parsing markup: Erreur à la ligne 21 :
Le nom d'entité « mdash » n'est pas connu

self.wTree.get_widget("lblExtraInfo").set_label(watch.get_extra_information())

Original issue reported on code.google.com by nekoh...@gmail.com on 6 Jan 2008 at 2:01

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by nekoh...@gmail.com on 6 Jan 2008 at 2:02

GoogleCodeExporter commented 9 years ago
I think this could be fixed with this function but i didn't test it yet:
    def escape(cls, text, quotes=True):
        """Create a Markup instance from a string and escape special characters
        it may contain (<, >, & and ").

        If the `quotes` parameter is set to `False`, the " character is left as
        is. Escaping quotes is generally only required for strings that are to
        be used in attribute values.
        """
        if isinstance(text, cls):
            return text
        if not text:
            return cls()
        text = str(text).replace('&', '&') \
                        .replace('<', '<') \
                        .replace('>', '>')
        if quotes:
            text = text.replace('"', '"')
        return cls(text)
    escape = classmethod(escape)

Original comment by woutclym...@gmail.com on 11 Mar 2008 at 10:52

GoogleCodeExporter commented 9 years ago

Original comment by nekoh...@gmail.com on 20 Mar 2009 at 11:27

GoogleCodeExporter commented 9 years ago

Original comment by nekoh...@gmail.com on 16 Apr 2011 at 3:29