Ejemplo n.º 1
0
 private void RemovePreviousText(IElementContext context)
 {
     context.AddMutation(new TextDeletion {
         Position = 0,
         Count    = context.TextIndex
     });
 }
Ejemplo n.º 2
0
 public void InsertNoBreakHyphen(IElementContext context, NoBreakHyphen hyphen)
 {
     context.AddMutation(new TextInsertion
     {
         Position = context.TextIndex,
         Text     = "‑"
     });
 }
Ejemplo n.º 3
0
 public void InsertSoftHyphen(IElementContext context, SoftHyphen hyphen)
 {
     context.AddMutation(new TextInsertion
     {
         Position = context.TextIndex,
         Text     = "­"
     });
 }
Ejemplo n.º 4
0
 private static void DeleteAllText(IElementContext context, Table table)
 {
     context.AddMutation(new TextDeletion
     {
         Count    = table.InnerText.Length,
         Position = 0
     });
 }
Ejemplo n.º 5
0
 private void ReplaceCrossRefBySpacer(IElementContext context, Match m)
 {
     context.AddMutation(new TextDeletion
     {
         Position = m.Index,
         Count    = m.Length,
     });
     context.AddNode(GenerateSpaceNode(m.Index));
 }
Ejemplo n.º 6
0
 public void RemoveCrossRefs(IElementContext context, Paragraph p)
 {
     foreach (Match match in crossReferenceRegex.Matches(p.InnerText))
     {
         context.AddMutation(new TextDeletion
         {
             Position = context.TextIndex + match.Index,
             Count    = match.Length
         });
     }
 }
Ejemplo n.º 7
0
        public void ProcessElement(IElementContext context, Paragraph paragraph)
        {
            var ti = 0;

            foreach (var r in paragraph.Elements <Run>())
            {
                int l = r.InnerText.Length;
                if (r.LastChild is FieldCode f)
                {
                    context.AddMutation(new TextDeletion
                    {
                        Count    = l,
                        Position = ti
                    });
                }
                ti += l;
            }
        }