[cpif] r249 - trunk/frontend-web

svn at argo.es svn at argo.es
Thu Jul 5 11:59:21 CEST 2007


Author: alvaro
Date: Thu Jul  5 11:59:18 2007
New Revision: 249

Log:
Soporte para poner smileys con el tag [code]
si que se traduzcan.


Modified:
   trunk/frontend-web/parser_bbcode.py
   trunk/frontend-web/parser_html.py
   trunk/frontend-web/parser_smileys.py

Modified: trunk/frontend-web/parser_bbcode.py
==============================================================================
--- trunk/frontend-web/parser_bbcode.py	(original)
+++ trunk/frontend-web/parser_bbcode.py	Thu Jul  5 11:59:18 2007
@@ -8,9 +8,10 @@
 allowed_tags = {
 #   "bbcode": (start tag, end tag (if needed), True if allows arguments, context where ir is NOT permitted)
     "b": ('<strong>', '</strong>', False, 'strong'), 
-    "u": ('<span style="text-decoration:underline">', '</span>', False, 'span'), 
+    "u": ('<span style="text-decoration:underline">', '</span>', False, None), 
     "s": ('<strike>', '</strike>', False, 'strike'), 
     "size": ('<span style="font-size:%(arg)s">', '</span>', True, None), 
+    "code": ('<code><pre>', '</pre><code>', False, 'code'), 
     "i": ('<em>', '</em>', False, 'em'), 
     "url": ('<a href="%(arg)s">', '</a>', True, 'a'), 
     "quote*": ('<blockquote>', '</blockquote>', False, None), 

Modified: trunk/frontend-web/parser_html.py
==============================================================================
--- trunk/frontend-web/parser_html.py	(original)
+++ trunk/frontend-web/parser_html.py	Thu Jul  5 11:59:18 2007
@@ -6,6 +6,8 @@
     "b": [], 
     "s": [], 
     "i": [], 
+    "pre": [], 
+    "code": [], 
     "em": [], 
     "strong": [], 
     "img": ["src", "alt", "title"]

Modified: trunk/frontend-web/parser_smileys.py
==============================================================================
--- trunk/frontend-web/parser_smileys.py	(original)
+++ trunk/frontend-web/parser_smileys.py	Thu Jul  5 11:59:18 2007
@@ -13,6 +13,8 @@
   import re
   # Everybody stand back!!!
   tokens = [(True, text, context)]
+  if context == "code":
+    return False, tokens
   for smiley in smiley_list:
     aux = []
     for j in tokens:
@@ -30,7 +32,6 @@
     tokens = aux
 
   return False, tokens
-  return False, [(True, text, context)]
   
 #import unittest
 #class Test(unittest.TestCase):



More information about the cpif mailing list