Skip to content

Commit 7f06637

Browse files
committed
Set JSON type attr on config script tag
Without this, the browser will try to parse the client's config script element as JS when it is inserted into the page, causing a syntax error to be reported in the console.
1 parent 3ba0d69 commit 7f06637

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

via/static/scripts/video_player/components/HypothesisClient.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ export default function HypothesisClient({
1919
const clientConfig = JSON.stringify(config);
2020
return (
2121
<>
22-
<script className="js-hypothesis-config">{clientConfig}</script>
22+
<script type="application/json" className="js-hypothesis-config">
23+
{clientConfig}
24+
</script>
2325
<script src={src} />
2426
</>
2527
);

0 commit comments

Comments
 (0)