Skip to content

Commit

Permalink
Tidy up whitespace (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Oct 22, 2022
1 parent 7531757 commit abfc315
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions sphinxext/opengraph/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
def make_tag(property: str, content: str) -> str:
# Parse quotation, so they won't break html tags if smart quotes are disabled
content = content.replace('"', """)
return f'<meta property="{property}" content="{content}" />\n '
return f'<meta property="{property}" content="{content}" />'


def get_tags(
Expand Down Expand Up @@ -158,8 +158,11 @@ def get_tags(
# arbitrary tags and overrides
tags.update({k: v for k, v in fields.items() if k.startswith("og:")})

return "\n" + "\n".join(
[make_tag(p, c) for p, c in tags.items()] + config["ogp_custom_meta_tags"]
return (
"\n".join(
[make_tag(p, c) for p, c in tags.items()] + config["ogp_custom_meta_tags"]
)
+ "\n"
)


Expand Down

0 comments on commit abfc315

Please sign in to comment.