Exemple #1
0
        private IEnumerable<Inline> GetInlines(HtmlNode node) {
            var result = new List<Inline>();
            foreach (var childNode in node.ChildNodes) {
                var wrapper = new InlineWrapper(GetInlines(childNode), childNode.InnerText);
                var item = Selector == null
                    ? wrapper
                    : Selector.SetBase(wrapper).Select(childNode);
                result.Add(item.Unwrap());
            }

            return result;
        }
Exemple #2
0
        public static Inline StandartConverter(InlineWrapper wrapper) {
            Inline inline;
            if (wrapper.Children?.Count > 0) {
                inline = wrapper.CreateSpanWithChildren();
            } else {
                string text;
                try {
                    text = HtmlEntity.DeEntitize(wrapper.Text);
                } catch (Exception) {
                    text = wrapper.Text;
                }

                inline = new Run {Text = text ?? string.Empty};
            }

            return inline;
        }
Exemple #3
0
 private static Inline ConvertToUnderline(InlineWrapper wrapper) {
     return new Underline {
         Inlines = {
             InlineWrapper.StandartConverter(wrapper)
         }
     };
 }