mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 18:49:00 +01:00
Fix #173869 marking active line for code elements too in markdown preview
This commit is contained in:
@@ -11,6 +11,7 @@ const codeLineClass = 'code-line';
|
||||
export interface CodeLineElement {
|
||||
element: HTMLElement;
|
||||
line: number;
|
||||
codeElement?: HTMLElement;
|
||||
}
|
||||
|
||||
const getCodeLineElements = (() => {
|
||||
@@ -27,9 +28,9 @@ const getCodeLineElements = (() => {
|
||||
}
|
||||
|
||||
if (element.tagName === 'CODE' && element.parentElement && element.parentElement.tagName === 'PRE') {
|
||||
// Fenched code blocks are a special case since the `code-line` can only be marked on
|
||||
// Fenced code blocks are a special case since the `code-line` can only be marked on
|
||||
// the `<code>` element and not the parent `<pre>` element.
|
||||
cachedElements.push({ element: element.parentElement as HTMLElement, line });
|
||||
cachedElements.push({ element: element.parentElement as HTMLElement, line: line, codeElement: element as HTMLElement });
|
||||
} else if (element.tagName === 'UL' || element.tagName === 'OL') {
|
||||
// Skip adding list elements since the first child has the same code line (and should be preferred)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user