defnull/bottle — pull request #683 by njogun (2014-11-28 15:56:18+00:00)
Title: Fix end-of-code-block template token regex

If end-of-code-block template token (`%>`) is followed by a Windows-style newline (`\r\n`), bottle will report `SyntaxError: invalid syntax`.

Example:
```python
>>> tpl = '<%\r\nprint("hello")\r\n%>\r\nworld'
>>> bottle.template(tpl)
```
Output:
```
Traceback (most recent call last):
File "", line 1, in
File "bottle.py", line 3494, in template
return TEMPLATES[tplid].render(kwargs)
File "bottle.py", line 3320, in render
self.execute(stdout, env)
File "bottle.py", line 3307, in execute
eval(self.co, env)
File "bottle.py", line 205, in __get__
value = obj.__dict__[self.func.__name__] = self.func(obj)
File "bottle.py", line 3271, in co
return compile(self.code, self.filename or '', 'exec')
File "", line 3
%>
^
SyntaxError: invalid syntax
```
Output after fix:
```
hello
'world'
```
Took me a while to catch that bug as it didn't manifest if end-of-code-block is not followed by a newline (i.e. file ends immediately after `'%>'`).