mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-02 15:44:06 +01:00
Web: Add support for charrefs. Closes GH-923.
This commit is contained in:
parent
95c15922e4
commit
ba12692fb4
@ -70,6 +70,10 @@ class Title(HTMLParser.HTMLParser):
|
||||
if name in self.entitydefs:
|
||||
self.title += self.entitydefs[name]
|
||||
|
||||
def handle_charref(self, name):
|
||||
if self.inTitle:
|
||||
self.title += unichr(int(name))
|
||||
|
||||
class DelayedIrc:
|
||||
def __init__(self, irc):
|
||||
self._irc = irc
|
||||
|
@ -65,6 +65,9 @@ class WebTestCase(ChannelPluginTestCase):
|
||||
# Checks that the parser doesn't hang on invalid tags
|
||||
self.assertNotError(
|
||||
'title http://www.youtube.com/watch?v=x4BtiqPN4u8')
|
||||
self.assertResponse(
|
||||
'title http://www.thefreedictionary.com/don%27t',
|
||||
"don't - definition of don't by The Free Dictionary")
|
||||
|
||||
def testTitleSnarfer(self):
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user