[PR #47] [MERGED] Fixes issue where trailing text after an inline math block is both included in the math block and appended after the math block. #780

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

📋 Pull Request Information

Original PR: https://github.com/xoofx/markdig/pull/47
Author: @christophano
Created: 8/19/2016
Status: Merged
Merged: 8/23/2016
Merged by: @xoofx

Base: masterHead: bugfix/inline-maths-with-trailing-text


📝 Commits (1)

  • fd813e3 Fixes issue where trailing text after an inline math block is both included in the math block and appended after the math block.

📊 Changes

3 files changed (+35 additions, -7 deletions)

View changed files

📝 src/Markdig.Tests/Specs/MathSpecs.md (+7 -0)
📝 src/Markdig.Tests/Specs/Specs.cs (+25 -5)
📝 src/Markdig/Extensions/Mathematics/MathInlineParser.cs (+3 -2)

📄 Description

I found an issue where inline math with trailing text both included the text inside the maths block and outside the maths block.

For example:

This is a $math block$ with text on both sides.

Should render as

<p>This is a <span class="math">math block</span> with text on both sides.</p>

But instead we get

<p>This is a <span class="math">math block$ with text on both sides.</span> with text on both sides.</p>

🔄 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/47 **Author:** [@christophano](https://github.com/christophano) **Created:** 8/19/2016 **Status:** ✅ Merged **Merged:** 8/23/2016 **Merged by:** [@xoofx](https://github.com/xoofx) **Base:** `master` ← **Head:** `bugfix/inline-maths-with-trailing-text` --- ### 📝 Commits (1) - [`fd813e3`](https://github.com/xoofx/markdig/commit/fd813e3c5a1c3da3aa2c92a4f3bbacd43ec3454c) Fixes issue where trailing text after an inline math block is both included in the math block and appended after the math block. ### 📊 Changes **3 files changed** (+35 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `src/Markdig.Tests/Specs/MathSpecs.md` (+7 -0) 📝 `src/Markdig.Tests/Specs/Specs.cs` (+25 -5) 📝 `src/Markdig/Extensions/Mathematics/MathInlineParser.cs` (+3 -2) </details> ### 📄 Description I found an issue where inline math with trailing text both included the text _inside_ the maths block and _outside_ the maths block. For example: ``` This is a $math block$ with text on both sides. ``` Should render as ``` html <p>This is a <span class="math">math block</span> with text on both sides.</p> ``` But instead we get ``` html <p>This is a <span class="math">math block$ with text on both sides.</span> with text on both sides.</p> ``` --- <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:45:25 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#780