[PR #281] [MERGED] Render XML well-formed boolean attribute #909

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

📋 Pull Request Information

Original PR: https://github.com/xoofx/markdig/pull/281
Author: @FranklinWhale
Created: 1/3/2019
Status: Merged
Merged: 1/4/2019
Merged by: @xoofx

Base: masterHead: bool-attr


📝 Commits (5)

  • f932b3c Use attribute name as value if value is null
  • cde939f Update spec and test cases
  • 0920001 Remove the unnecessary EOL at the end
  • 02bd814 Use empty string instead of attribute name
  • 57692a5 controls attribute is also changed

📊 Changes

3 files changed (+14 additions, -17 deletions)

View changed files

📝 src/Markdig.Tests/Specs/MediaSpecs.md (+4 -4)
📝 src/Markdig.Tests/Specs/Specs.cs (+7 -7)
📝 src/Markdig/Renderers/HtmlRenderer.cs (+3 -6)

📄 Description

Although HTML boolean attribute can have its value assignment omitted, such omission is not supported in XHTML because the syntax is not XML well-formed. Being well-formed XML allows the content to be processed by XML API such as LINQ to XML. This PR changes the attribute rendering method so that the value assignment of a boolean attribute is always specified (https://www.w3.org/TR/html/infrastructure.html#boolean-attribute).

This PR, if approved, replaces #280.


🔄 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/281 **Author:** [@FranklinWhale](https://github.com/FranklinWhale) **Created:** 1/3/2019 **Status:** ✅ Merged **Merged:** 1/4/2019 **Merged by:** [@xoofx](https://github.com/xoofx) **Base:** `master` ← **Head:** `bool-attr` --- ### 📝 Commits (5) - [`f932b3c`](https://github.com/xoofx/markdig/commit/f932b3c87a0d9f13f606a097d7ce7bee80fccc79) Use attribute name as value if value is null - [`cde939f`](https://github.com/xoofx/markdig/commit/cde939f79c8059395540324610d34370afc83910) Update spec and test cases - [`0920001`](https://github.com/xoofx/markdig/commit/0920001f45bb456dca73b5d059ccf4cd59a3951b) Remove the unnecessary EOL at the end - [`02bd814`](https://github.com/xoofx/markdig/commit/02bd8149ac1a0e47e166d9fdc0f668a4f176f4ac) Use empty string instead of attribute name - [`57692a5`](https://github.com/xoofx/markdig/commit/57692a557be23a4c575117059bc653be04ba3a40) controls attribute is also changed ### 📊 Changes **3 files changed** (+14 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `src/Markdig.Tests/Specs/MediaSpecs.md` (+4 -4) 📝 `src/Markdig.Tests/Specs/Specs.cs` (+7 -7) 📝 `src/Markdig/Renderers/HtmlRenderer.cs` (+3 -6) </details> ### 📄 Description Although HTML boolean attribute can have its value assignment omitted, such omission is not supported in XHTML because the syntax is not XML well-formed. Being well-formed XML allows the content to be processed by XML API such as LINQ to XML. This PR changes the attribute rendering method so that the value assignment of a boolean attribute is always specified (https://www.w3.org/TR/html/infrastructure.html#boolean-attribute). This PR, if approved, replaces #280. --- <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:07 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#909