private static void AddMarkupValue(this Paragraph paragraph, string value, XamlStyles styles) { var markupString = value.Substring(1, value.Length - 2); var indexOfSpace = markupString.IndexOf(' '); var markupType = indexOfSpace < 0 ? markupString : markupString.Substring(0, indexOfSpace); paragraph.AddRun("{", styles.DelimiterStyle); paragraph.AddRun(markupType, styles.NameStyle); if (indexOfSpace >= 0) { paragraph.AddMarkupBody(markupString.Substring(indexOfSpace), styles); } paragraph.AddRun("}", styles.DelimiterStyle); }