lib/trac-wiki/parser.rb in trac-wiki-0.3.10 vs lib/trac-wiki/parser.rb in trac-wiki-0.3.12

- old
+ new

@@ -54,10 +54,14 @@ # }, # ... # ] attr_accessor :headings + def env + env + end + # url base for links attr_writer :base # Disable url escaping for local links # Escaping: [[/Test]] --> %2FTest @@ -115,14 +119,16 @@ # template_handler(macroname) -> template_text # when macros enabled and {{myCoolMacro}} ocured, # result fo `template_handler('myCoolMacro') inserted attr_accessor :template_handler + + # macro {{$var}} | {{#comment}} | {{!cmd}} | {{template}} | {{/template}} # string begins with macro - MACRO_BEG_REX = /\A\{\{ ( \$[\$\.\w]+ | [\#!]\w* |\w+ ) /x - MACRO_BEG_INSIDE_REX = /\A(.*?)(?<!\{)\{\{ ( \$[\$\.\w]+ | [\#!]\w* | \w+ ) /xm + MACRO_BEG_REX = /\A\{\{ ( \$[\$\.\w]+ | [\#!\/]\w* |\w+ ) /x + MACRO_BEG_INSIDE_REX = /\A(.*?)(?<!\{)\{\{ ( \$[\$\.\w]+ | [\#!\/]\w* | \w+ ) /xm # find end of marcro or begin of inner macro - MACRO_END_REX = /\A(.*?) ( \}\} | \{\{ ( \$[\$\.\w]+ | [\#!]\w* | \w+) )/mx + MACRO_END_REX = /\A(.*?) ( \}\} | \{\{ ( \$[\$\.\w]+ | [\#!\/]\w* | \w+) )/mx # Create a new Parser instance. def initialize(options = nil) init_macros @macros = true