U4-3074 - replaceMacroTags() method problems at umbraco.editorControls.tinymce.TinyMCE class

Created by wtct 09 Oct 2013, 09:59:40 Updated by Sebastiaan Janssen 29 Dec 2013, 12:38:59

I have found that sometimes this method doesn't work correctly. I have modified this method and here is the new code which probably is more efficient than original (less string operations).

    //Modified by WTC 28-11-2011
    private string replaceMacroTags(string text)
    {
        Regex regEx = new Regex("<div[^>]*ismacro=\"true\"[^>]*>.*?</div>", RegexOptions.IgnoreCase);

        string macroTags = string.Empty;

        while (regEx.IsMatch(text))
        {
            Match match = regEx.Match(text);
            macroTags = match.Groups[0].Value;

            text = regEx.Replace(text, generateMacroTag(macroTags));
        }

        return text;
    }

Comments

Sebastiaan Janssen 29 Dec 2013, 12:38:56

I've not heard of the old code not working. Do you have some examples where it does not work?


Priority: Normal

Type: Bug

State: Can't Reproduce

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions:

Due in version:

Sprint:

Story Points:

Cycle: