Closed oprypin closed 6 months ago
I'm quite happy and confident with this change, and actually it preserves prior behavior very well in cases that were already recognized as an attr_list. (As evidenced by not needing to change anything in existing test cases). But maybe we should give it time in case someone finds more edge cases.
I think the "legacy" approach is way more developer-friendly. I don't want to develop a new test file. If that's a blocker, I hope someone can help out with a commit based on this one.
The test file already exists. I even pointed to it, but here it is again test_syntax/extensions/test_attr_list.py
. You just need to add a test case. And yes, this would be a blocker.
In this comment I stated:
if someone were to submit a PR which consistently altered the attr_list behavior across all elements to allow curly braces, I would be wiling to give it consideration.
"All elements" includes fenced code blocks (which is clear if you read the proceeding paragraph). However, fenced code blocks have not been addressed here at all. Note that I have added a relevant test, which is currently failing. That test, and potentially some other similar (yet to be created) tests need to be passing before the stated requirements are met.
Thanks for the test. OK let me quickly check that out.
Alright, done!
Note:
Out of all the newly added tests, only these 3 tests don't pass with preexisting code:
testFencedCodeCurlyInAttrs
test_curly_in_double_quote
test_curly_in_single_quote
For all others, preexisting behavior is preserved.
How it worked before:
}
in it, and require that it ends with}
- for block elements anchored to the end of the line, otherwise not.}
can arise. If parsing is interrupted by some unrecognized token, discard the rest of the string.How it works now:
}
in it, and require that it ends with}
- for block elements it's anchored to the end of the line, otherwise not.}
only within the quoted parts, otherwise interrupt parsing like for any other unrecognized token. If parsing is interrupted, there is remaining unrecognized text. Ideally perhaps we would bail out at this point entirely (and not recognize it as an attr_list), but to preserve historic behavior, any extra text before}
is just discarded. If there is an extra}
in the remaining text:}
is just discarded.