public EMListParserMatch(int index, string text, EMListType type, string content)
 {
     Index   = index;
     Text    = text;
     Type    = type;
     Content = content;
 }
        private static EMElement CreateItem(EMListType type, EMDocument doc, Match match, EMElementOrigin origin, EMElement parent, TransformationData data)
        {
            var itemGroup = match.Groups[4];

            var item = new EMListItem(doc, origin, parent, type);

            // adding offset to text map
            item.Elements.TextMap.ApplyChanges(new List<PreprocessingTextChange>() { new PreprocessingTextChange(0, itemGroup.Index - match.Index, 0) });

            item.Elements.Parse(0, Markdown.Outdent(itemGroup.Value, item.Elements.TextMap), data);

            return item;
        }
        private static EMElement CreateItem(EMListType type, EMDocument doc, Match match, EMElementOrigin origin, EMElement parent, TransformationData data)
        {
            var itemGroup = match.Groups[4];

            var item = new EMListItem(doc, origin, parent, type);

            // adding offset to text map
            item.Elements.TextMap.ApplyChanges(new List <PreprocessingTextChange>()
            {
                new PreprocessingTextChange(0, itemGroup.Index - match.Index, 0)
            });

            item.Elements.Parse(0, Markdown.Outdent(itemGroup.Value, item.Elements.TextMap), data);

            return(item);
        }
        private static IParser GetParserByType(EMListType type)
        {
            switch (type)
            {
            case EMListType.Ordered:
                return(EMListItem.GetOrderedParser());

            case EMListType.Unordered:
                return(EMListItem.GetUnorderedParser());

            case EMListType.Definition:
                return(EMDefinitionListItem.GetParser());

            default:
                throw new NotSupportedException("List type not supported.");
            }
        }
 private EMListItem(EMDocument doc, EMElementOrigin origin, EMElement parent, EMListType type)
     : base(doc, origin, parent, 0, origin.Length)
 {
 }
 private EMListItem(EMDocument doc, EMElementOrigin origin, EMElement parent, EMListType type)
     : base(doc, origin, parent, 0, origin.Length)
 {
 }
 protected EMList(EMDocument doc, EMElementOrigin origin, EMElement parent, EMListType type)
     : base(doc, origin, parent)
 {
     this.type = type;
 }
 public EMListElements(EMDocument doc, EMElementOrigin origin, EMElement parent, EMListType type)
     : base(doc, origin, parent)
 {
     parser = GetParserByType(type);
 }