Skip to content

Commit

Permalink
Fix bold formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
hoodmane committed Sep 28, 2023
1 parent 2a6c5c0 commit 18e9966
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sphinx_js/renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,12 @@ def __init__(
self._directive = directive
self._app = app
self._set_type_xref_formatter(app.config.ts_type_xref_formatter)
def bold_formatter(conf, text):
parts = ["**" + part + "**" for part in text.split(" ") if part]
return " ".join(parts).strip()

if app.config.ts_type_bold:
self._set_type_text_formatter(lambda conf, text: "**" + text + "**")
self._set_type_text_formatter(bold_formatter)
else:
self._set_type_text_formatter(None)

Expand Down

0 comments on commit 18e9966

Please sign in to comment.