tag2content
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -5,3 +5,3 @@ "use strict"; | ||
var variables = {}; | ||
var regExp = /(\S+)=["']?((?:.(?!["']?\s+(?:\S+)=|[>"']))+.)?["']?/gi; | ||
var regExp = /(\S+)="["']?((?:.(?!["']?\s+(?:\S+)=|[>"']))+.)?["']?/gi; | ||
var temp; | ||
@@ -8,0 +8,0 @@ while ((temp = regExp.exec(text))) { |
@@ -14,5 +14,5 @@ "use strict"; | ||
}); | ||
test('It should return "src" and "title" variables', function () { | ||
test('It should return "father" variable', function () { | ||
// Given | ||
var text = '[img src="image.jpg" title="My image"]'; | ||
var text = '[family father="name=John;city=Liverpool"]'; | ||
// When | ||
@@ -22,5 +22,4 @@ var variables = utils_1.getVariables(text); | ||
expect(variables).toEqual({ | ||
src: 'image.jpg', | ||
title: 'My image', | ||
father: 'name=John;city=Liverpool', | ||
}); | ||
}); |
{ | ||
"name": "tag2content", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Replace a tag with content in a configurable way", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
9041
186