private void RemovePreviousText(IElementContext context) { context.AddMutation(new TextDeletion { Position = 0, Count = context.TextIndex }); }
public void InsertNoBreakHyphen(IElementContext context, NoBreakHyphen hyphen) { context.AddMutation(new TextInsertion { Position = context.TextIndex, Text = "‑" }); }
public void InsertSoftHyphen(IElementContext context, SoftHyphen hyphen) { context.AddMutation(new TextInsertion { Position = context.TextIndex, Text = "­" }); }
private static void DeleteAllText(IElementContext context, Table table) { context.AddMutation(new TextDeletion { Count = table.InnerText.Length, Position = 0 }); }
private void ReplaceCrossRefBySpacer(IElementContext context, Match m) { context.AddMutation(new TextDeletion { Position = m.Index, Count = m.Length, }); context.AddNode(GenerateSpaceNode(m.Index)); }
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 }); } }
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; } }