Constant

BlueCloth::CodeBlockRegexp

Pattern for matching codeblocks

%r{
      (?:\n\n|\A)
      (                                                                     # $1 = the code block
        (?:
              (?:[ ]{#{TabWidth}} | \t)            # a tab or tab-width of spaces
              .*\n+
        )+
      )
      (^[ ]{0,#{TabWidth - 1}}\S|\Z)                # Lookahead for non-space at
                                                                              # line-start, or end of doc
}x
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.