Changeset b25817 in indico
- Timestamp:
- 05/12/10 15:30:48 (3 years ago)
- Branches:
- master, burotel, hello-world-walkthrough, ipv6, new-webex, v0.97-series, v0.98-series, v0.98.2, v0.98.3, v0.98b1, v0.98b2, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, d9941f8582b36b24821a11ea5ba16fda6a457fb1
- Children:
- 53b65f
- Parents:
- a217dc
- git-author:
- Jose Benito <jose.benito.gonzalez@…> (05/12/10 15:09:31)
- git-committer:
- Jose Benito <jose.benito.gonzalez@…> (05/12/10 15:30:48)
- File:
-
- 1 edited
-
indico/MaKaC/webinterface/common/tools.py (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
indico/MaKaC/webinterface/common/tools.py
rbdd862 rb25817 45 45 notAllowedTags = [ "applet", 46 46 "base", "basefont", "button", 47 "form", "frame", "frameset", 47 "form", "frame", "frameset", 48 48 "head", 49 49 "iframe", "input", "isindex", 50 50 "label", "link", 51 "meta", 51 "meta", 52 52 "noframe", "noscript", 53 53 "object", "optgroup", "option" … … 55 55 "script", "select", 56 56 "textarea", 57 "title" ]58 57 "title", "embed"] 58 59 59 60 60 # Generate the regular expression objects to found the not allowed tags … … 167 167 " => " 168 168 " => ' 169 169 170 170 Also replaces '\xc2\xa0' (a kind of space char) by ' ' 171 171 """ … … 174 174 # Routine by Micah D. Cochran 175 175 # Submitted on 26 Aug 2005 176 # This routine is allowed to be put under any license Open Source (GPL, BSD, LGPL, etc.) License 176 # This routine is allowed to be put under any license Open Source (GPL, BSD, LGPL, etc.) License 177 177 # or any Propriety License. Effectively this routine is in public domain. Please attribute where appropriate. 178 178 … … 181 181 Inputs: s --> string of text 182 182 Outputs: text string without the tags 183 183 184 184 # doctest unit testing framework 185 185 … … 188 188 'Keep this Text KEEP 123' 189 189 """ 190 190 191 191 # convert in_text to a mutable object (e.g. list) 192 192 s_list = list(in_text) 193 193 i = 0 194 194 195 195 while i < len(s_list): 196 196 # iterate until a left-angle bracket is found … … 203 203 Logger.get('strip_ml_tags').debug("Not found '>' (the end of the html tag): %s"%e) 204 204 continue 205 205 206 206 # pops the right-angle bracket, too 207 207 s_list.pop(i) 208 208 else: 209 209 i=i+1 210 210 211 211 # convert the list back into text 212 212 join_char=''
Note: See TracChangeset
for help on using the changeset viewer.
