Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Allow filters within Liquid variable #2

Merged
merged 1 commit into from

2 participants

@carsonreinke

Just changed the regular expression to allow anything within the variable block, so it could handle filters within it.

@corny corny merged commit 7f7bc37 into digineo:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 12, 2014
  1. @carsonreinke

    Allow filters within Liquid variable

    carsonreinke authored
    Regexp should not be greedy
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 plugin.js
View
4 plugin.js
@@ -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;
}
});
Something went wrong with that request. Please try again.