summaryrefslogtreecommitdiffstats
path: root/module/web/static/js/utils
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-01-06 19:45:09 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-01-06 19:45:09 +0100
commit821e26fa30372ad6e534a54134653d8f664c58dd (patch)
treeff9bd1a3d6755d4470937f0199aa804c815ac5a4 /module/web/static/js/utils
parentshow settings menu items (diff)
downloadpyload-821e26fa30372ad6e534a54134653d8f664c58dd.tar.xz
fixed the lexer rules
Diffstat (limited to 'module/web/static/js/utils')
-rw-r--r--module/web/static/js/utils/initHB.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/module/web/static/js/utils/initHB.js b/module/web/static/js/utils/initHB.js
index 6d9436835..784032ca0 100644
--- a/module/web/static/js/utils/initHB.js
+++ b/module/web/static/js/utils/initHB.js
@@ -1,8 +1,8 @@
// Loads all helper and set own handlebars rules
define(['underscore', 'handlebars', 'helpers/formatSize'],
function(_, Handlebars) {
- // TODO: create better lexer rules, these are just hacked
- Handlebars.Parser.lexer.rules = [/^(?:[^\x00]*?(?=(<%)))/, /^(?:[^\x00]+)/, /^(?:[^\x00]{2,}?(?=(<%|$)))/, /^(?:<%>)/, /^(?:<%#)/, /^(?:<%\/)/, /^(?:<%\^)/, /^(?:<%\s*else\b)/, /^(?:<%=)/, /^(?:<%&)/, /^(?:<%![\s\S]*?\}\})/, /^(?:<%)/, /^(?:=)/, /^(?:\.(?=[%> ]))/, /^(?:\.\.)/, /^(?:[\/.])/, /^(?:\s+)/, /^(?:=%>)/, /^(?:%>)/, /^(?:"(\\["]|[^"])*")/, /^(?:'(\\[']|[^'])*')/, /^(?:@[a-zA-Z]+)/, /^(?:true(?=[%>\s]))/, /^(?:false(?=[%>\s]))/, /^(?:[0-9]+(?=[%>\s]))/, /^(?:[a-zA-Z0-9_$-]+(?=[%>=}\s\/.]))/, /^(?:\[[^\]]*\])/, /^(?:.)/, /^(?:$)/];
+ // Replace with own lexer rules compiled from handlebars.l
+ Handlebars.Parser.lexer.rules = [/^(?:[^\x00]*?(?=(<%)))/, /^(?:[^\x00]+)/, /^(?:[^\x00]{2,}?(?=(\{\{|$)))/, /^(?:\{\{>)/, /^(?:<%=)/, /^(?:<%\/)/, /^(?:\{\{\^)/, /^(?:<%\s*else\b)/, /^(?:\{<%%)/, /^(?:\{\{&)/, /^(?:<%![\s\S]*?%>)/, /^(?:<%)/, /^(?:=)/, /^(?:\.(?=[%} ]))/, /^(?:\.\.)/, /^(?:[\/.])/, /^(?:\s+)/, /^(?:%%>)/, /^(?:%>)/, /^(?:"(\\["]|[^"])*")/, /^(?:'(\\[']|[^'])*')/, /^(?:@[a-zA-Z]+)/, /^(?:true(?=[%}\s]))/, /^(?:false(?=[%}\s]))/, /^(?:[0-9]+(?=[%}\s]))/, /^(?:[a-zA-Z0-9_$-]+(?=[=%}\s\/.]))/, /^(?:\[[^\]]*\])/, /^(?:.)/, /^(?:$)/];
_.compile = Handlebars.compile;
return Handlebars