@@ -4,49 +4,10 @@ import { documentReady } from './util/async';
44
55Prism . components . add ( autoloader ) ;
66
7- export const PrismConfig = {
8- // TODO: Update docs
9- /**
10- * By default, Prism will attempt to highlight all code elements (by calling {@link Prism#highlightAll}) on the
11- * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
12- * additional languages or plugins yourself.
13- *
14- * By setting this value to `true`, Prism will not automatically highlight all code elements on the page.
15- *
16- * You obviously have to change this value before the automatic highlighting started. To do this, you can add an
17- * empty Prism object into the global scope before loading the Prism script like this:
18- *
19- * ```js
20- * window.Prism = window.Prism || {};
21- * Prism.manual = true;
22- * // add a new <script> to load Prism's script
23- * ```
24- *
25- * @default false
26- */
27- manual : false ,
28- } ;
29-
30- if ( typeof document !== 'undefined' && typeof window !== 'undefined' ) {
31- // Get current script and highlight
32- const script = document . currentScript as HTMLScriptElement | null ;
33- if ( script && script . hasAttribute ( 'data-manual' ) ) {
34- PrismConfig . manual = true ;
35- }
36-
37- void documentReady ( ) . then ( ( ) => {
38- if ( ! PrismConfig . manual ) {
39- Prism . highlightAll ( ) ;
40- }
41- } ) ;
42-
43- // Make Prism available globally
44- if ( typeof globalThis !== 'undefined' ) {
45- ( globalThis as any ) . Prism = Prism ;
7+ void documentReady ( ) . then ( ( ) => {
8+ if ( ! Prism . config . manual ) {
9+ Prism . highlightAll ( ) ;
4610 }
47- }
48- else {
49- PrismConfig . manual = true ;
50- }
11+ } ) ;
5112
5213export default Prism ;
0 commit comments