Пример #1
0
        public void EscapeCharacters(IElementContext context, Paragraph p)
        {
            string text      = p.InnerText;
            var    mutations = FindEscapeChar(context.TextIndex, text);

            if (mutations.Any())
            {
                context.AddMutations(mutations);
            }
        }
Пример #2
0
 public void Initialize()
 {
     _elementContext = new RootElementContext(
         Substitute.For <IGlobalContext>(),
         new Paragraph(
             new Run(
                 new Text("This is the text")))
         );
     _elementContext.AddNodes(new HtmlNode[] // Force a node colisison
     {
         new HtmlNode {
             Start = 0, End = 5, Z = 1
         },
         new HtmlNode {
             Start = 3, End = 7, Z = 0
         },
     });
     _elementContext.AddMutations(new Mutation[]
     {
         Substitute.For <Mutation>(),
         Substitute.For <Mutation>()
     });
 }