mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
#123: use JS raw strings
This commit is contained in:
parent
04e8bdb02a
commit
103e6ea4b5
1 changed files with 1 additions and 3 deletions
|
@ -37,8 +37,6 @@ class DocsStar(PageStar):
|
|||
}
|
||||
})
|
||||
|
||||
escaped_spec = spec.replace(r"'", r"\'")
|
||||
|
||||
return HTMLResponse(
|
||||
f"""
|
||||
<html lang="en">
|
||||
|
@ -52,7 +50,7 @@ class DocsStar(PageStar):
|
|||
<div id="docs"/>
|
||||
<script>
|
||||
const ui = SwaggerUIBundle({{
|
||||
spec: JSON.parse('{escaped_spec}'),
|
||||
spec: JSON.parse(r`{spec}`),
|
||||
dom_id: '#docs',
|
||||
presets: [
|
||||
SwaggerUIBundle.presets.apis,
|
||||
|
|
Loading…
Reference in a new issue