Skip to content

Commit

Permalink
support: longer descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
henilp105 committed Apr 1, 2024
1 parent f528592 commit 097790f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import toml
from check_digests import check_digests
from typing import Union,List, Tuple, Dict, Any
import markdown


def run_command(command: str) -> Union[str, None]:
Expand Down Expand Up @@ -87,7 +88,7 @@ def process_package(packagename: str) -> Tuple[bool, Union[dict, None], str]:
if 'description' in parsed_toml and parsed_toml['description'] == "README.md":
try:
with open(f'static/temp/{packagename}/README.md', 'r') as file:
parsed_toml['description'] = html.escape(file.read()) # Sanitize HTML content
parsed_toml['description'] = markdown.markdown(file.read()) # Sanitize HTML content
except:
parsed_toml['description'] = "README.md not found."

Expand Down

0 comments on commit 097790f

Please sign in to comment.