Repository navigation
Conversation
…is off Boolean options such as `linenums` set in an `attr_list` raised `TypeError` when `codehilite` was not enabled. Attributes are passed on to the output unchanged and serialized the way the serializer does: `None` as a bare key, `True` as a bare key for HTML boolean attributes in `html` output and `key="key"` otherwise, and `False` as nothing. Fixes Python-Markdown#1713. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Co-authored-by: jeej1k <[email protected]>
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.
Fixes #1713. Replaces #1716, which took the wrong approach (it dropped the attributes).
As @waylan explained in #1713, without
codehilitethe attributes may be meant for a JS highlighting library and must not be removed.fenced_codebypasses the serializer, so it now reproduces the serializer's handling (#1674) for the values it keeps as Python booleans:None=>keyTrue=>keyif output format ishtmlandkeyis inBOOLEAN_ATTRIBUTES['html'], otherwisekey="key"False=> nothing is outputkey="escaped value"as beforeTests cover
None/True/False,htmlandxhtmloutput, and with and withoutcodehilite. Changelog entry added. Full test suite passes locally.One point I'd like confirmed: I read "
value == False=> (an empty string)" as the attribute being omitted entirely, not rendered askey="". Easy to change if you meant the latter.AI disclosure: Claude Code (Claude Sonnet 5.5) wrote the code change, tests, changelog entry, commit message and this description. I reviewed them and can explain every change.
jeej3000 and jeej1k are both my accounts; jeej1k is credited as co-author as a backup in case one account is lost.
🤖 Generated with Claude Code