Changeset 1769 for trunk/pylucid_project/PyLucid/system/markups/creole.py
- Timestamp:
- 09/16/08 13:31:56 (18 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/pylucid_project/PyLucid/system/markups/creole.py
r1766 r1769 50 50 ]] 51 51 )''' 52 53 # link = r'''(?P<link1> 54 # \[\[ 55 # (?P<link_target1>.+?)\|(?P<link_text1>.+?) 56 # ]] 57 # )|(?P<link2> 58 # \[\[ 59 # (?P<link_target2> (%s)://[^ ]+) \s* (?P<link_text2>.+?) 60 # ]] 61 # )| 62 # \[\[(?P<internal_link>.+)\]\] 63 # ''' % proto 52 64 53 65 #-------------------------------------------------------------------------- … … 113 125 114 126 # Pass-through all django template blocktags 115 passthrough = r'''^ \s*(?P<passthrough>127 passthrough_block = r'''^ \s*(?P<passthrough_block> 116 128 {%.*?%} 117 129 (.|\n)+? … … 119 131 ) \s*$ 120 132 ''' 133 passthrough_line = r'''(?P<passthrough_line> 134 ({%.*?%})| 135 ({{.*?}}) 136 )''' 121 137 #Pass-through html code lines 122 138 html = r'''(?P<html> … … 141 157 blockelements = ( 142 158 "head", "list", "pre", "code", "table", "separator", "macro", 143 "passthrough ", "html"159 "passthrough_block", "html" 144 160 ) 145 161 … … 161 177 block_re = re.compile( 162 178 '|'.join([ 163 Rules.passthrough, Rules.html, 179 Rules.passthrough_block, 180 Rules.html, 164 181 Rules.line, Rules.head, Rules.separator, Rules.pre, Rules.list, 165 182 Rules.table, Rules.text, … … 168 185 ) 169 186 # For inline elements: 170 inline_re = re.compile('|'.join([Rules.link, Rules.url, Rules.macro, 171 Rules.code, Rules.image, Rules.strong, Rules.emph, Rules.linebreak, 172 Rules.escape, Rules.char]), re.X | re.U) 187 inline_re = re.compile( 188 '|'.join([ 189 Rules.link, Rules.url, Rules.macro, 190 Rules.code, Rules.image, 191 Rules.passthrough_line, 192 Rules.strong, Rules.emph, Rules.linebreak, 193 Rules.escape, Rules.char 194 ]), 195 re.X | re.U 196 ) 173 197 174 198 def __init__(self, raw): … … 197 221 # same method needs several names, because of group names in regexps. 198 222 199 def _passthrough_ repl(self, groups):223 def _passthrough_block_repl(self, groups): 200 224 """ Pass-through all django template blocktags """ 201 225 self._upto_block() 202 DocNode("passthrough", self.root, groups["passthrough"]) 226 DocNode("passthrough_block", self.root, groups["passthrough_block"]) 227 self.text = None 228 229 def _passthrough_line_repl(self, groups): 230 """ Pass-through all django tags """ 231 DocNode("passthrough_line", self.cur, groups["passthrough_line"]) 203 232 self.text = None 204 233