You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Approaches for Supporting Paragraph Attributes in Pandoc AST
Problem Statement
Currently, Pandoc's AST supports attributes for various block elements (like Header, CodeBlock, and Div), but not for paragraphs. This inconsistency leads to information loss when converting between formats that support paragraph attributes (such as HTML with classes, IDs, or custom attributes on <p> tags).
This issue is part of a broader architectural consideration regarding attribute handling in Pandoc. Related discussions include:
I'm willing to work on implementing whichever approach is deemed most appropriate, but wanted to gather thoughts before proceeding with development work.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Approaches for Supporting Paragraph Attributes in Pandoc AST
Problem Statement
Currently, Pandoc's AST supports attributes for various block elements (like
Header
,CodeBlock
, andDiv
), but not for paragraphs. This inconsistency leads to information loss when converting between formats that support paragraph attributes (such as HTML with classes, IDs, or custom attributes on<p>
tags).This issue is part of a broader architectural consideration regarding attribute handling in Pandoc. Related discussions include:
Current Workarounds and Limitations
Currently, to preserve attributes on paragraphs, users must wrap them in
Div
elements. This creates:Potential Solutions
I see three main approaches to addressing this issue, each with different trade-offs:
1. Direct Attribute Extension
Pros:
Cons:
2. Node-based Architecture (like Djot)
Pros:
Cons:
3. Intermediate Solutions
There might be intermediate solutions that provide paragraph attribute support without massive architectural changes:
a) Wrapper Types with Backward Compatibility:
b) Extension Framework:
Creating an extension mechanism that allows attaching metadata to existing AST nodes without changing their structure.
Questions for Discussion
I'm willing to work on implementing whichever approach is deemed most appropriate, but wanted to gather thoughts before proceeding with development work.
Related Issues and Discussions
Beta Was this translation helpful? Give feedback.
All reactions