bin/gen_release_notes: escape at-symbols
If we don't do this, we end up with email-alike strings to be turned into mailto links. This is not what we want. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25712>
This commit is contained in:

committed by
Marge Bot

parent
9a3bd255b6
commit
a4845e9c43
@@ -168,6 +168,7 @@ class Inliner(states.Inliner):
|
|||||||
break
|
break
|
||||||
# Quote all original backslashes
|
# Quote all original backslashes
|
||||||
checked = re.sub('\x00', "\\\x00", checked)
|
checked = re.sub('\x00', "\\\x00", checked)
|
||||||
|
checked = re.sub('@', '\\@', checked)
|
||||||
return docutils.utils.unescape(checked, 1)
|
return docutils.utils.unescape(checked, 1)
|
||||||
|
|
||||||
inliner = Inliner();
|
inliner = Inliner();
|
||||||
|
@@ -198,3 +198,8 @@ async def test_parse_issues(content: str, bugs: typing.List[str]) -> None:
|
|||||||
mock.patch('bin.gen_release_notes.gather_commits', mock.AsyncMock(return_value='sha\n')):
|
mock.patch('bin.gen_release_notes.gather_commits', mock.AsyncMock(return_value='sha\n')):
|
||||||
ids = await parse_issues('1234 not used')
|
ids = await parse_issues('1234 not used')
|
||||||
assert set(ids) == set(bugs)
|
assert set(ids) == set(bugs)
|
||||||
|
|
||||||
|
@pytest.mark.asyncio
|
||||||
|
async def test_rst_escape():
|
||||||
|
out = inliner.quoteInline('foo@bar')
|
||||||
|
assert out == 'foo\@bar'
|
||||||
|
Reference in New Issue
Block a user