Skip to content

Commit 66d2251

Browse files
committed
fix: remove empty anchor tags from rendered markdown
Fixes #4237 Signed-off-by: Vasu <[email protected]>
1 parent 2bcecde commit 66d2251

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

gcp/website/frontend_emulator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ def _dict_to_vuln(data: object,
9090
if not vuln_id:
9191
return None
9292

93+
vulnerability = vulnerability_pb2.Vulnerability()
9394
try:
94-
vulnerability = sources.parse_vulnerability_from_dict(
95-
data, strict=False)
95+
json_format.ParseDict(data, vulnerability, ignore_unknown_fields=True)
9696
except Exception as error:
9797
print(f'[emulator] Failed to convert entry in {path}: {error}')
9898
return None

gcp/website/frontend_handlers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,8 @@ def markdown(text):
855855
# space rather than %2B
856856
# See: https://github.com/trentm/python-markdown2/issues/621
857857
md = _URL_MARKDOWN_REPLACER.sub(r'\1/+/\3', md)
858+
# Remove empty anchor tags that cause visual artifacts in rendered markdown.
859+
# See: https://github.com/google/osv.dev/issues/<issue-number>
858860
md = _ANCHOR_TAG_REPLACER.sub('', md)
859861

860862
return md

0 commit comments

Comments
 (0)