Posted 19 years ago
by Ryan
-
Camalot Designs

I recently noticed an issue with firefox 1.5.0.1 and Code Outlining. The generated code to collapse/expand a region uses something like
this does not work in firefox, in order for it to work I had to find the text and replace it with
this should work in all current browsers.
Here is the sample code that i used to change the output of the CodeHighlighterby the way, I love this product and the SyntaxEditor...
cf_108_186_Open_Text.style.display='none';
document.getElementById('cf_108_186_Open_Text').style.display='none';
Here is the sample code that i used to change the output of the CodeHighlighter
private void transformFormattedCode(string code) {
Regex rex = new Regex(@"(?:\s+)([a-zA-Z]*_.*?_(?:Closed|Open)_(?:Image|Text)*)",
RegexOptions.Compiled | RegexOptions.IgnorePatternWhitespace | RegexOptions.IgnoreCase);
code = rex.Replace (code, new MatchEvaluator (objectReplaceMatch));
}
private string objectReplaceMatch(Match m) {
return m.Result ("document.getElementById('$1')");
}