This project is read-only.

htmlfilter : possible to use views?

Jan 31, 2011 at 9:53 PM


I have a question about htmlfilters. I created a email obfuscator by implementing the IHtmlFilter interface. The obfuscation is now done by a Regex.Replace

        public string Obfuscate(string html)
            return Regex.Replace(html, emailPatternStrict, Munge);       

Because I' m relatively new to ASP MVC and completely new to Orchard I am wondering, is there a clean way of doing this? Calling the resulting html of a view from inside a HtmlFilter or something. I know how ASP MVC normally works with views, but I don't know how I should use it in a HtmlFilter. No I ended up writing code like I did in php:

        private string Munge(Match match)
            text +="\n coded=\""+coded+"\";\n"+
                " key =\""+cipher+ "\";\n" +
                " shift=coded.length;\n"+
                " link = \"\";\n" +

I looked into the code from Orchard.Core.Commmon.Services.BdcodeFilter but that also used the Regex.Replace function.