Navigation Menu

Skip to content

Commit

Permalink
Fixed #58, Added tests for blockquote
Browse files Browse the repository at this point in the history
  • Loading branch information
syrusakbary committed Jan 2, 2013
1 parent 88c68be commit 6a51095
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions pyjade/lexer.py
Expand Up @@ -25,7 +25,7 @@ class Lexer(object):
RE_EXTENDS = re.compile(r'^extends? +([^\n]+)')
RE_PREPEND = re.compile(r'^prepend +([^\n]+)')
RE_APPEND = re.compile(r'^append +([^\n]+)')
RE_BLOCK = re.compile(r'^block +(?:(prepend|append) +)?([^\n]*)')
RE_BLOCK = re.compile(r'''^block(( +(?:(prepend|append) +)?([^\n]*))|\n)''')
RE_YIELD = re.compile(r'^yield *')
RE_INCLUDE = re.compile(r'^include +([^\n]+)')
RE_ASSIGNMENT = re.compile(r'^(\w+) += *([^;\n]+)( *;? *)')
Expand Down Expand Up @@ -172,8 +172,8 @@ def block(self):
captures = regexec(self.RE_BLOCK,self.input)
if captures:
self.consume(len(captures[0]))
mode = captures[1] or 'replace'
name = captures[2]
mode = captures[3] or 'replace'
name = captures[4] or ''
tok = self.tok('block',name)
tok.mode = mode
return tok
Expand Down
2 changes: 2 additions & 0 deletions pyjade/testsuite/cases/block-expansion.html
Expand Up @@ -4,5 +4,7 @@
<li><a href="#">bar</a>
</li>
</ul>
<blockquote>block
</blockquote>
<p>baz
</p>
2 changes: 2 additions & 0 deletions pyjade/testsuite/cases/block-expansion.jade
Expand Up @@ -2,4 +2,6 @@ ul
li: a(href='#') foo
li: a(href='#') bar

blockquote block

p baz
6 changes: 3 additions & 3 deletions pyjade/testsuite/cases/mixin.blocks.jade
Expand Up @@ -4,7 +4,7 @@ mixin form(method, action)
form(method=method, action=action)
csrf_token_from_somewhere = 'hey'
input(type='hidden', name='_csrf', value=csrf_token_from_somewhere)
block
block

html
body
Expand All @@ -24,12 +24,12 @@ html

mixin bar()
#bar
block
block

mixin foo()
#foo
+bar
block
block

+foo
p one
Expand Down

0 comments on commit 6a51095

Please sign in to comment.