Skip to content

Commit

Permalink
fix: should not escape raw html
Browse files Browse the repository at this point in the history
  • Loading branch information
bytemain committed Sep 27, 2023
1 parent ec4e712 commit ff60538
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/api/controllers/configuration.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { html } from 'hono/html';
import { html, raw } from 'hono/html';

import { CommonKVManager } from '@/kv/admin';
import { DingKVManager } from '@/kv/ding';
Expand Down Expand Up @@ -120,11 +120,11 @@ export function route(hono: THono) {
}

return c.html(
ConfigurationHTML +
html` <script type="module">
html`${raw(ConfigurationHTML)}
<script type="module">
import defaultSchema from '${schemaUrl}' assert { type: 'json' };
window.starting_value = ${JSON.stringify(data ?? {})};
window.starting_value = ${raw(JSON.stringify(data ?? {}))};
window.submit_url =
'${c.origin}configuration/${id}/${type}?token=${token}';
window._options = {
Expand Down

0 comments on commit ff60538

Please sign in to comment.