Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing of HeadingBlockParser from pipeline.BlockParsers is not affect setext headings #83

Closed
magicxor opened this issue Dec 20, 2016 · 1 comment · Fixed by #327
Closed

Comments

@magicxor
Copy link

I'm trying to make stop markdig from parsing headers (h1-h6).

        public static MarkdownPipelineBuilder DisableHeadings(this MarkdownPipelineBuilder pipeline)
        {
            var headingBlockParser = pipeline.BlockParsers.Find<HeadingBlockParser>();
            if (headingBlockParser != null)
            {
                pipeline.BlockParsers.Remove(headingBlockParser);
            }
            return pipeline;
        }

But this code doesn't affect setext headings.
Is it normal behavior? How can I solve this problem?
Thanks.

@xoofx
Copy link
Owner

xoofx commented Dec 21, 2016

Unfortunately, disabling setext headings requires an internal change because the parsing is performed inside the ParagraphBlockParser. It is perfectly possible to do it by adding a boolean property on this parser, and provide an extension for it (PR welcome!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants