private static void escapeInvalidHtml(object sender, TagFormattedEventArgs e)
 {
     if (e.IsExtension)
     {
         // Do not escape text within triple curly braces
         return;
     }
     e.Substitute = SecurityElement.Escape(e.Substitute);
 }
 private static void escapeInvalidHtml(object sender, TagFormattedEventArgs e)
 {
     if (e.IsExtension)
     {
         // Do not escape text within triple curly braces
         return;
     }
     e.Substitute = SecurityElement.Escape(e.Substitute);
 }
        private void postProcess(Substitution substitution)
        {
            if (TagFormatted == null)
            {
                return;
            }
            TagFormattedEventArgs args = new TagFormattedEventArgs(substitution.Key, substitution.Substitute, substitution.IsExtension);

            TagFormatted(this, args);
            substitution.Substitute = args.Substitute;
        }
        private static void escapeInvalidHtml(object sender, TagFormattedEventArgs e)
        {
            if (e.IsExtension)
            {
                // Do not escape text within triple curly braces
                return;
            }
#if NETCOREAPP1_1
            // TODO: Encontrar una mejor manera (And ugly way to escape chars but SecurityElement doesn't exist in core)
            e.Substitute = e.Substitute.Replace("&", "&amp;").Replace("<", "&lt;").Replace(">", "&gt;").Replace("\"", "&quot;").Replace("'", "&apos;");
#else
            e.Substitute = SecurityElement.Escape(e.Substitute);
#endif
        }
Exemple #5
0
 private void postProcess(Substitution substitution)
 {
     if (TagFormatted == null)
     {
         return;
     }
     TagFormattedEventArgs args = new TagFormattedEventArgs(substitution.Key, substitution.Substitute, substitution.IsExtension);
     TagFormatted(this, args);
     substitution.Substitute = args.Substitute;
 }