Skip to content

Commit a41d116

Browse files
committed
Update global Prism README docs
1 parent c14fe61 commit a41d116

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ By default `prism-react-renderer` only includes a [base set of languages](https:
128128
```js
129129
import { Highlight, Prism } from "prism-react-renderer";
130130

131-
typeof window !== "undefined" && (window.Prism = Prism)
131+
(typeof global !== "undefined" ? global : window).Prism = Prism
132132
await import("prismjs/components/prism-applescript")
133133
/** or **/
134134
require("prismjs/components/prism-applescript")

packages/demo/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { useState } from "react"
66
import { sampleCode } from "./sample-code"
77

88
// Example of importing a custom language directly from Prism
9-
typeof window !== "undefined" && (window.Prism = Prism)
9+
;(typeof global !== "undefined" ? global : window).Prism = Prism
1010
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
1111
// @ts-ignore
1212
await import("prismjs/components/prism-applescript")

0 commit comments

Comments
 (0)