From ce9467e389a2776f3230cb31e596cf9e575cc0df Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Thu, 29 Dec 2022 15:19:22 +0530 Subject: [PATCH] fix(build): handle `-` in title of code blocks with line highlighting (#1743) --- src/node/markdown/plugins/highlight.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/markdown/plugins/highlight.ts b/src/node/markdown/plugins/highlight.ts index c2152438..186d9bc9 100644 --- a/src/node/markdown/plugins/highlight.ts +++ b/src/node/markdown/plugins/highlight.ts @@ -20,7 +20,7 @@ import type { ThemeOptions } from '../markdown' * [{ line: number, classes: string[] }] */ const attrsToLines = (attrs: string): HtmlRendererOptions['lineOptions'] => { - attrs = attrs.replace(/.*?([\d,-]+).*/, '$1').trim() + attrs = attrs.replace(/^(?:\[.*?\])?.*?([\d,-]+).*/, '$1').trim() const result: number[] = [] if (!attrs) { return []