Setting ImplicitParagraph has no effect
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 5.3k
- Forks
- 510
- Avg merge
- 8d 5h
- Merged PRs (30d)
- 5
Description
As far as I understand, setting ImplicitParagraph to false should prevent markdig from wrapping rendered HTML in a <p>.
However, the following test does not behave as expected
var pipeline = new MarkdownPipelineBuilder().Build();
var writer = new StringWriter();
var renderer = new Markdig.Renderers.HtmlRenderer(writer);
renderer.ImplicitParagraph = false;
pipeline.Setup(renderer);
var foo = Markdown.ToHtml("test", pipeline);
// foo is "<p>test</p>\n" and not "test"
Furthermore, this parameter (and the couple more similar) are only interesting at render time and as such, they should be directly settable -- the user should not be forced to go through 5 lines of setup to set a basic option, such as when rendering a snippet. This also makes them basically undiscoverable.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the supplied C# reproduction using MarkdownPipelineBuilder, HtmlRenderer, ImplicitParagraph, and Markdown.ToHtml. Trace why setting HtmlRenderer.ImplicitParagraph to false still produces paragraph tags, and review the other render-time options mentioned in the issue. Done means the reproduction omits the wrapping tags and render-time options can be set directly as requested.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100