forked from mikeboers/PyHAML
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request mikeboers#10 from epegzz/master
pull request: unicode support in haml function arguments
- Loading branch information
Showing
3 changed files
with
24 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
|
||
def extract_haml(fileobj, keywords, comment_tags, options): | ||
""" babel translation token extract function for haml files """ | ||
|
||
import haml | ||
from mako import lexer, parsetree | ||
from mako.ext.babelplugin import extract_nodes | ||
|
||
encoding = options.get('input_encoding', options.get('encoding', None)) | ||
template_node = lexer.Lexer(haml.preprocessor(fileobj.read()), input_encoding=encoding).parse() | ||
for extracted in extract_nodes(template_node.get_children(), keywords, comment_tags, options): | ||
yield extracted | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters