Skip to content

Commit

Permalink
fix: pygments prestyles formatting (#687)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasvinclav committed Aug 19, 2024
1 parent e2a8e3e commit 723fdea
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/unfold/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,12 @@ def prettify_json(data: Any) -> Optional[str]:
return None

def format_response(response: str, theme: str) -> str:
formatter = HtmlFormatter(style=theme, noclasses=True, nobackground=True)
formatter = HtmlFormatter(
style=theme,
noclasses=True,
nobackground=True,
prestyles="white-space: pre-wrap; word-wrap: break-word;",
)
return highlight(response, JsonLexer(), formatter)

response = json.dumps(data, sort_keys=True, indent=4)
Expand Down

0 comments on commit 723fdea

Please sign in to comment.