Пример #1
0
        public static void ProcessStage2(Syntax.Block document, PandocMarkSettings settings = null)
        {
            if (document is null)
            {
                throw new ArgumentNullException(nameof(document));
            }

            if (document.Tag != Syntax.BlockTag.Document)
            {
                throw new ArgumentException("The block element passed to this method must represent a top level document.", nameof(document));
            }

            if (settings is null)
            {
                settings = PandocMarkSettings.Default;
            }

            try
            {
                BlockMethods.ProcessInlines(document, document.Document, settings);
            }
            catch (PandocMarkException)
            {
                throw;
            }
            catch (Exception ex)
            {
                throw new PandocMarkException("An error occurred during inline parsing.", ex);
            }
        }
Пример #2
0
        public static void ProcessStage2(Syntax.Block document, CommonMarkSettings settings = null)
        {
            if (document == null)
            {
                throw new ArgumentNullException("document");
            }

            if (document.Tag != Syntax.BlockTag.Document)
            {
                throw new ArgumentException("The block element passed to this method must represent a top level document.", "document");
            }

            if (settings == null)
            {
                settings = CommonMarkSettings.Default;
            }

            try
            {
                BlockMethods.ProcessInlines(document, document.ReferenceMap, settings);
            }
            catch (CommonMarkException)
            {
                throw;
            }
            catch (Exception ex)
            {
                throw new CommonMarkException("An error occurred during inline parsing.", ex);
            }
        }
Пример #3
0
        public static void ProcessStage2(Syntax.Block document, CommonMarkSettings settings = null)
        {
            if (document == null)
            {
                throw new ArgumentNullException(document.ToString());
            }

            if (document.Tag != Syntax.BlockTag.Document)
            {
                throw new ArgumentException("Блочный элемент, предоставляемый методу, должен быть высокоуровневым документом.", document.ToString());
            }

            if (settings == null)
            {
                settings = CommonMarkSettings.Default;
            }

            try
            {
                BlockMethods.ProcessInlines(document, document.ReferenceMap, settings);
            }
            catch (CommonMarkException)
            {
                throw;
            }
            catch (Exception ex)
            {
                throw new CommonMarkException("Ошибка при инлайн-парсинге.", ex);
            }
        }