Skip to content

Commit

Permalink
Web: Add support for charrefs. Closes GH-923.
Browse files Browse the repository at this point in the history
  • Loading branch information
progval committed Dec 11, 2014
1 parent 95c1592 commit ba12692
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugins/Web/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ def handle_entityref(self, name):
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
Expand Down
3 changes: 3 additions & 0 deletions plugins/Web/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ def testTitle(self):
# 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:
Expand Down

0 comments on commit ba12692

Please sign in to comment.