Permalink
Browse files

Allow filters within Liquid variable

Regexp should not be greedy
  • Loading branch information...
1 parent f848ae4 commit 7e6532e532a793f5da4d3f12d789c91ec8c52086 @carsonreinke committed Jan 12, 2014
Showing with 2 additions and 2 deletions.
  1. +2 −2 plugin.js
View
@@ -24,8 +24,8 @@ CKEDITOR.plugins.add('liquid', {
if (dataFilter) {
dataFilter.addRules({
text: function(text) {
- text = text.replace(/\{\{([\w\.]+)\}\}/g, "<liquidVariable>{{$1}}</liquidVariable>");
- text = text.replace(/\{%(.+)%\}/g, "<liquidBlock>{%$1%}</liquidBlock>");
+ text = text.replace(/\{\{(.+?)\}\}/g, "<liquidVariable>{{$1}}</liquidVariable>");
+ text = text.replace(/\{%(.+?)%\}/g, "<liquidBlock>{%$1%}</liquidBlock>");
return text;
}
});

0 comments on commit 7e6532e

Please sign in to comment.