fix: don't drop attribute_definitions on self-closed SPEC-*-TYPE unparse#215
Merged
stanislaw merged 1 commit intoMay 7, 2026
Merged
Conversation
Contributor
Author
|
@stanislaw contradicting my earlier statement, it would be good to get a release once this PR and #214 are on main. |
Contributor
|
Hey @fNBU, I have merged the #214 and reviewing this one now. Moving forward, could I ask you to always rebase your branches on top of latest main, not merge the latest main? Also, please squash the related commits to just one per branch for these small changes, i.e., instead of |
Bug C: when a SPEC-RELATION-TYPE / RELATION-GROUP-TYPE / SPECIFICATION-TYPE is parsed from a self-closed source tag (or constructed with is_self_closed=True) and then mutated to add attribute_definitions, the unparse path's `if is_self_closed: return output + '/>\n'` short-circuit fires before the SPEC-ATTRIBUTES block is emitted. Any attribute_definitions on the IR object are silently dropped. Fix: gate the self-closed shortcut on the absence of attributes. When the IR has attributes to emit, force the open form regardless of how the original source was shaped. Symmetric to PR strictdoc-project#214's parse-side fix; the unparse-side shortcut was not addressed there.
75df2e0 to
2285999
Compare
Contributor
Author
|
Sure, my bad. I also fixed up this branch. |
Contributor
|
Thanks! |
Contributor
I will release this tomorrow or on Saturday. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Symmetric to #214's parse-side fix. When a
SPEC-RELATION-TYPE/RELATION-GROUP-TYPE/SPECIFICATION-TYPEIR object hasis_self_closed=Truebut also carriesattribute_definitions, the unparser'sif is_self_closed: return "/>\n"short-circuit fires before the<SPEC-ATTRIBUTES>block emits, silently dropping the attributes.Fix: gate the shortcut on the absence of attributes in all three unparsers. Should merge after #214.