Skip to content

Commit

Permalink
cleaner
Browse files Browse the repository at this point in the history
  • Loading branch information
stavros-k committed Aug 16, 2024
1 parent 9d0d8ab commit 81c19ac
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions catalog_reader/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ def get_app_details_impl(

return item_data

def new_line_to_space(text: str) -> str:
return text.replace('\n', ' ')

def get_app_version_details(
version_path: str, questions_context: typing.Optional[dict], options: typing.Optional[dict] = None
Expand All @@ -155,8 +157,8 @@ def get_app_version_details(
for key, filename, parser, post_processor in (
("app_metadata", "app.yaml", yaml.safe_load, None),
("schema", "questions.yaml", yaml.safe_load, None),
("readme", "README.md", markdown.markdown, lambda x: x.replace('\n', ' ')),
("changelog", "CHANGELOG.md", markdown.markdown, None),
("readme", "README.md", markdown.markdown, new_line_to_space),
("changelog", "CHANGELOG.md", markdown.markdown, new_line_to_space),
):
if os.path.exists(os.path.join(version_path, filename)):
with open(os.path.join(version_path, filename), 'r') as f:
Expand Down

0 comments on commit 81c19ac

Please sign in to comment.