Commits

David Cramer committed 240731d

Fix for YouTube parsing

  • Participants
  • Parent commits 84b9d75

Comments (0)

Files changed (1)

File bbcode/bbtags/web.py

     close_pattern = re.compile(patterns.closing % 'youtube', re.I)
     
     def parse(self):
-        url = ''
+        inner = ''
         for node in self.nodes:
             if node.is_text_node or isinstance(node, AutoDetectURL):
                 inner += node.raw_content
             else:
                 soft_raise("Youtube tag cannot have nested tags")
                 return self.raw_content
-        match = self._video_id_pattern.search(url)
+        match = self._video_id_pattern.search(inner)
         if not match:
-            soft_raise("'%s' does not seem like a youtube link" % url)
+            soft_raise("'%s' does not seem like a youtube link" % inner)
             return self.raw_content
         videoid = match.groups()
         if not videoid:
-            soft_raise("'%s' does not seem like a youtube link" % url)
+            soft_raise("'%s' does not seem like a youtube link" % inner)
             return self.raw_content
         videoid = videoid[0]
         return (