parseMacroSyntax accepts other characters than a-z

I had problems with parseMacroSyntax when `syntax` included Swedish characters. Now it works with other characters than a-z as well.
This commit is contained in:
Anton Gildebrand
2015-01-05 17:13:50 +01:00
parent d4c0ea9c48
commit fec70fcf47

View File

@@ -12,8 +12,8 @@ function macroService() {
/** parses the special macro syntax like <?UMBRACO_MACRO macroAlias="Map" /> and returns an object with the macro alias and it's parameters */
parseMacroSyntax: function (syntax) {
var expression = /(<\?UMBRACO_MACRO macroAlias=["']([\w\.]+?)["'][\s\S]+?)(\/>|>.*?<\/\?UMBRACO_MACRO>)/i;
var expression = /(<\?UMBRACO_MACRO macroAlias=["']([\s\S.]+?)["'][\s\S]+?)(\/>|>.*?<\/\?UMBRACO_MACRO>)/i;
var match = expression.exec(syntax);
if (!match || match.length < 3) {
return null;
@@ -157,4 +157,4 @@ function macroService() {
}
angular.module('umbraco.services').factory('macroService', macroService);
angular.module('umbraco.services').factory('macroService', macroService);