Fix U4-6687: Can't add multiple instances of a macro in RTE in 7.2.6 without ruining RTE formatting
We found that the MacroTagParser.cs was being greedy and matching all UMBRACO_MACRO tags instead of getting them individually. macro.service.js was updated for posterity purposes to match the regex in the .cs side, but testing showed that it was functioning as expected without this change.
This commit is contained in:
@@ -15,7 +15,7 @@ function macroService() {
|
||||
|
||||
//This regex will match an alias of anything except characters that are quotes or new lines (for legacy reasons, when new macros are created
|
||||
// their aliases are cleaned an invalid chars are stripped)
|
||||
var expression = /(<\?UMBRACO_MACRO (?:.+)?macroAlias=["']([^\"\'\n\r]+?)["'][\s\S]+?)(\/>|>.*?<\/\?UMBRACO_MACRO>)/i;
|
||||
var expression = /(<\?UMBRACO_MACRO (?:.+?)?macroAlias=["']([^\"\'\n\r]+?)["'][\s\S]+?)(\/>|>.*?<\/\?UMBRACO_MACRO>)/i;
|
||||
var match = expression.exec(syntax);
|
||||
if (!match || match.length < 3) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user