[PR #214] [MERGED] Add ConfigureNewLineExtension markdown extension #869

Open
opened 2026-01-29 14:46:38 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/xoofx/markdig/pull/214
Author: @augustoproiete
Created: 2/21/2018
Status: Merged
Merged: 4/4/2018
Merged by: @xoofx

Base: masterHead: add-configure-new-line-extension


📝 Commits (2)

  • e2f0f00 Add ConfigureNewLineExtension markdown extension
  • c68a488 Add ConfigureNewLine extension method to MarkdownPipelineBuilder

📊 Changes

2 files changed (+47 additions, -0 deletions)

View changed files

src/Markdig/Extensions/TextRenderer/ConfigureNewLineExtension.cs (+34 -0)
📝 src/Markdig/MarkdownExtensions.cs (+13 -0)

📄 Description

This PR adds an extension which allows devs to define what string to use for line-endings when writing.

As per my comment in #211, Markdig always uses \n for line-breaks. This extension exposes an easy way to override the default behavior when defining the pipeline.

Below is an example on how to define that line-endings should use Environment.NewLine:

var pipeline = new MarkdownPipelineBuilder()
	.ConfigureNewLine(Environment.NewLine)
	.UseAdvancedExtensions()
	.Build();

ps: This PR builds on #213, which should be merged first.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/xoofx/markdig/pull/214 **Author:** [@augustoproiete](https://github.com/augustoproiete) **Created:** 2/21/2018 **Status:** ✅ Merged **Merged:** 4/4/2018 **Merged by:** [@xoofx](https://github.com/xoofx) **Base:** `master` ← **Head:** `add-configure-new-line-extension` --- ### 📝 Commits (2) - [`e2f0f00`](https://github.com/xoofx/markdig/commit/e2f0f0083173f3f3bb47f294b94935621d3109c6) Add `ConfigureNewLineExtension` markdown extension - [`c68a488`](https://github.com/xoofx/markdig/commit/c68a488717d15d5e6878a7db7ce5724b83e6cb8f) Add `ConfigureNewLine` extension method to `MarkdownPipelineBuilder` ### 📊 Changes **2 files changed** (+47 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `src/Markdig/Extensions/TextRenderer/ConfigureNewLineExtension.cs` (+34 -0) 📝 `src/Markdig/MarkdownExtensions.cs` (+13 -0) </details> ### 📄 Description This PR adds an extension which allows devs to define what string to use for line-endings when writing. As per my comment in #211, [`Markdig` always uses `\n` for line-breaks](https://github.com/lunet-io/markdig/blob/master/src/Markdig/Renderers/TextRendererBase.cs#L32). This extension exposes an easy way to override the default behavior when defining the pipeline. Below is an example on how to define that line-endings should use `Environment.NewLine`: ```csharp var pipeline = new MarkdownPipelineBuilder() .ConfigureNewLine(Environment.NewLine) .UseAdvancedExtensions() .Build(); ``` --- ps: This PR builds on #213, which should be merged first. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 14:46:38 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#869