[PR #315] [MERGED] Fix ToPlainText with htmlentity #939

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

📋 Pull Request Information

Original PR: https://github.com/xoofx/markdig/pull/315
Author: @OpportunityLiu
Created: 3/7/2019
Status: Merged
Merged: 3/7/2019
Merged by: @xoofx

Base: masterHead: patch-1


📝 Commits (5)

  • 5a63008 Update HtmlEntityInlineRenderer.cs
  • f542fd0 Update LiteralInlineRenderer.cs
  • 5a73c2b Update HtmlEntityInlineRenderer.cs
  • 41e8d5e Update LiteralInlineRenderer.cs
  • 3af4f33 Update TestPlainText.cs

📊 Changes

3 files changed (+20 additions, -4 deletions)

View changed files

📝 src/Markdig.Tests/TestPlainText.cs (+2 -0)
📝 src/Markdig/Renderers/Html/Inlines/HtmlEntityInlineRenderer.cs (+9 -2)
📝 src/Markdig/Renderers/Html/Inlines/LiteralInlineRenderer.cs (+9 -2)

📄 Description

The ToPlainText should not resulted in html entities.

Current version:

> Markdig.Markdown.ToPlainText("foo<bar")
"foo&lt;bar\n"
> Markdig.Markdown.ToPlainText("foo&lt;bar")
"foo&lt;bar\n"

Expacted:

> Markdig.Markdown.ToPlainText("foo<bar")
"foo<bar\n"
> Markdig.Markdown.ToPlainText("foo&lt;bar")
"foo<bar\n"

🔄 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/315 **Author:** [@OpportunityLiu](https://github.com/OpportunityLiu) **Created:** 3/7/2019 **Status:** ✅ Merged **Merged:** 3/7/2019 **Merged by:** [@xoofx](https://github.com/xoofx) **Base:** `master` ← **Head:** `patch-1` --- ### 📝 Commits (5) - [`5a63008`](https://github.com/xoofx/markdig/commit/5a6300823c3f10a76b04355484d59c9200a0a52f) Update HtmlEntityInlineRenderer.cs - [`f542fd0`](https://github.com/xoofx/markdig/commit/f542fd0a88d6eead63519507e93a560ee6bfdd3e) Update LiteralInlineRenderer.cs - [`5a73c2b`](https://github.com/xoofx/markdig/commit/5a73c2bf2b192291565a2b7cd8699b80096652ff) Update HtmlEntityInlineRenderer.cs - [`41e8d5e`](https://github.com/xoofx/markdig/commit/41e8d5e5fc3e43bfb045151070d7f9b51b6c3491) Update LiteralInlineRenderer.cs - [`3af4f33`](https://github.com/xoofx/markdig/commit/3af4f33b5d483898e00fa1503e791176e7e361e6) Update TestPlainText.cs ### 📊 Changes **3 files changed** (+20 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `src/Markdig.Tests/TestPlainText.cs` (+2 -0) 📝 `src/Markdig/Renderers/Html/Inlines/HtmlEntityInlineRenderer.cs` (+9 -2) 📝 `src/Markdig/Renderers/Html/Inlines/LiteralInlineRenderer.cs` (+9 -2) </details> ### 📄 Description The `ToPlainText` should not resulted in html entities. Current version: ```cs > Markdig.Markdown.ToPlainText("foo<bar") "foo&lt;bar\n" > Markdig.Markdown.ToPlainText("foo&lt;bar") "foo&lt;bar\n" ``` Expacted: ```cs > Markdig.Markdown.ToPlainText("foo<bar") "foo<bar\n" > Markdig.Markdown.ToPlainText("foo&lt;bar") "foo<bar\n" ``` --- <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:47:35 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#939