Skip to content

Commit 5d1f242

Browse files
authored
Exempt script and style element contents from inspection (#511)
1 parent 0b1de69 commit 5d1f242

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/Spec.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,16 @@ const STANDARD_DATE_FORMAT: Intl.DateTimeFormatOptions = {
6363
month: 'long',
6464
timeZone: 'UTC',
6565
};
66-
const NO_EMD = new Set(['PRE', 'CODE', 'EMU-PRODUCTION', 'EMU-ALG', 'EMU-GRAMMAR', 'EMU-EQN']);
66+
const NO_EMD = new Set([
67+
'PRE',
68+
'CODE',
69+
'SCRIPT',
70+
'STYLE',
71+
'EMU-PRODUCTION',
72+
'EMU-ALG',
73+
'EMU-GRAMMAR',
74+
'EMU-EQN',
75+
]);
6776
const YES_EMD = new Set(['EMU-GMOD']); // these are processed even if they are nested in NO_EMD contexts
6877

6978
interface VisitorMap {

src/autolinker.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ const escape: (_: string) => string = require('html-escape');
1111
export const NO_CLAUSE_AUTOLINK = new Set([
1212
'PRE',
1313
'CODE',
14+
'SCRIPT',
15+
'STYLE',
1416
'EMU-CONST',
1517
'EMU-PRODUCTION',
1618
'EMU-GRAMMAR',

0 commit comments

Comments
 (0)