Changeset 1342


Ignore:
Timestamp:
02/05/07 17:00:14 (13 years ago)
Author:
jukka
Message:

Worked on #1126. Cannot get embed tags to work with kupu without modifying kupu source (kupu/common/kupucontentfilters.js to be precise).

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/ConfigurationMethods.py

    r1319 r1342  
    415415    k.configure_kupu(1, '',  #linkbyuid, table_classnames 
    416416            [   # html exclusion. list tags you don't want to be in HTML code 
    417                 {'tags':['center', 'span', 'tt', 'big', 'small', 'u', 's', 'strike', 'basefont', 'font', 'table', 'th', 'td', 'tbody', 'thead', 'tr', 'div', 'img'], 
     417                {'tags':TAGS_BLACKLIST, 
    418418                 'attributes':'', 
    419419                 'keep':1, 
  • trunk/Validators.py

    r1289 r1342  
    1818 
    1919import sre 
    20  
    21 ALLOWED_TAGS = ['strong', 'b', 'p', 'li', 'ul', 'ol', 'blockquote', 'a', 'h2', 'pre', 'code', 'br', 'i'] 
    22 INVALID_ATTRIBUTES = ['dir', 'lang', 'valign', 'halign', 'border', 'frame', 'rules', 'cellspacing', 'cellpadding', 'bgcolor', 'style'] 
     20from config import TAGS_BLACKLIST, INVALID_ATTRIBUTES 
    2321 
    2422def validate_html_tags(s): 
    2523    tags = sre.findall('</?([^> ]+).*?>', s) 
    26     invalid_tags = [tag for tag in tags if tag not in ALLOWED_TAGS] 
     24    invalid_tags = [tag for tag in tags if tag in TAGS_BLACKLIST] 
    2725 
    2826    attributes = [attr[1] for attr in sre.findall('<.*?(\s(\w+)\s*=.*?)+>', s)] 
     
    3331def remove_invalid_html_tags(s): 
    3432    tags = sre.findall('</?([^> ]+).*?>', s) 
    35     invalid_tags = [tag for tag in tags if tag not in ALLOWED_TAGS] 
     33    invalid_tags = [tag for tag in tags if tag in TAGS_BLACKLIST] 
    3634     
    3735    for invalid_tag in invalid_tags: 
  • trunk/config.py

    r1318 r1342  
    7272 'All': ('All','All'), 
    7373} 
     74 
     75TAGS_BLACKLIST= ['center', 'span', 'tt', 'big', 'small', 'u', 's', 'strike', 'basefont', 'font', 'table', 'th', 'td', 'tbody', 'thead', 'tr', 'div', 'img'] 
     76 
     77INVALID_ATTRIBUTES = ['dir', 'lang', 'valign', 'halign', 'border', 'frame', 'rules', 'cellspacing', 'cellpadding', 'bgcolor', 'style'] 
    7478 
    7579# when translating resources values of these fields are copied to translation 
Note: See TracChangeset for help on using the changeset viewer.