diff --git a/CHANGES.md b/CHANGES.md index 8c1e67b20e..327cdc8c4f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,11 @@ +## Version 11.2.0 (pending) + +Parser: + +- fix(types) Fix some type definition issues (#3274) [Josh Goebel][] + +[Josh Goebel]: https://github.com/joshgoebel + ## Version 11.1.0 Grammars: diff --git a/src/highlight.js b/src/highlight.js index deb545bd11..29ef8a8713 100644 --- a/src/highlight.js +++ b/src/highlight.js @@ -428,7 +428,7 @@ const HLJS = function(hljs) { } } do { - if (top.scope && !top.isMultiClass) { + if (top.scope) { emitter.closeNode(); } if (!top.skip && !top.subLanguage) { diff --git a/types/index.d.ts b/types/index.d.ts index 0dd8534f8f..d53ee2d515 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -74,7 +74,7 @@ declare module 'highlight.js' { RE_STARTERS_RE: string } - export type LanguageFn = (hljs?: HLJSApi) => Language + export type LanguageFn = (hljs: HLJSApi) => Language export type CompilerExt = (mode: Mode, parent: Mode | Language | null) => void export interface HighlightResult { @@ -201,7 +201,6 @@ declare module 'highlight.js' { illegalRe: RegExp matcher: any isCompiled: true - isMultiClass?: boolean starts?: CompiledMode parent?: CompiledMode beginScope?: Record & {_emit?: Record, _multi?: boolean, _wrap?: string} @@ -209,13 +208,14 @@ declare module 'highlight.js' { } interface ModeDetails { - begin?: RegExp | string - match?: RegExp | string - end?: RegExp | string + begin?: RegExp | string | (RegExp | string)[] + match?: RegExp | string | (RegExp | string)[] + end?: RegExp | string | (RegExp | string)[] + // deprecated in favor of `scope` className?: string - _emit?: Record scope?: string | Record beginScope?: string | Record + endScope?: string | Record contains?: ("self" | Mode)[] endsParent?: boolean endsWithParent?: boolean