Skip to content

Commit

Permalink
fix(deployer): escape markdown markup in link text (#8996)
Browse files Browse the repository at this point in the history
  • Loading branch information
yin1999 authored Jul 20, 2023
1 parent 427b03a commit 810edfa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion deployer/src/deployer/analyze_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def post_about_deployment(build_directory: Path, **config):
for doc in get_built_docs(build_directory):
url = mdn_url_to_dev_url(config["prefix"], doc["mdn_url"])
mdn_url = doc["mdn_url"]
links.append(f"- [{mdn_url}]({url})")
links.append(f"- [`{mdn_url}`]({url})")
links.sort()

if links:
Expand Down
6 changes: 3 additions & 3 deletions deployer/src/deployer/test_analyze_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_analyze_pr_prefix():
comment = analyze_pr(build_directory, dict(DEFAULT_CONFIG, prefix="pr007"))
assert "<b>Preview URLs</b>" in comment
assert (
"- [/en-US/docs/Foo](https://pr007.content.dev.mdn.mozit.cloud/en-US/docs/Foo)"
"- [`/en-US/docs/Foo`](https://pr007.content.dev.mdn.mozit.cloud/en-US/docs/Foo)"
in comment
)

Expand All @@ -55,7 +55,7 @@ def test_analyze_pr_preview_urls():
comment = analyze_pr(build_directory, dict(DEFAULT_CONFIG, prefix="pr007"))
assert "<details><summary><b>Preview URLs</b> (6 pages)</summary>" in comment
assert (
"- [/en-US/docs/Foo6](https://pr007.content.dev.mdn.mozit.cloud/en-US/docs/Foo6)\n\n</details>"
"- [`/en-US/docs/Foo6`](https://pr007.content.dev.mdn.mozit.cloud/en-US/docs/Foo6)\n\n</details>"
in comment
)

Expand Down Expand Up @@ -207,7 +207,7 @@ def test_analyze_pr_prefix_and_postcomment(mocked_github):
)
assert "<b>Preview URLs</b>" in comment
assert (
"- [/en-US/docs/Foo](https://pr007.content.dev.mdn.mozit.cloud/en-US/docs/Foo)"
"- [`/en-US/docs/Foo`](https://pr007.content.dev.mdn.mozit.cloud/en-US/docs/Foo)"
in comment
)

Expand Down

0 comments on commit 810edfa

Please sign in to comment.