Пример #1
0
 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);
 }
Пример #2
0
 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;
        }
Пример #4
0
        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
        }
Пример #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;
 }