mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 04:09:28 +00:00
Fix: Markdown Preview scroll remains same after clicking on some other link #78465
Improves the behavior on how markdown preview behaves when clicking a link
This commit is contained in:
@@ -134,3 +134,12 @@ export function getEditorLineNumberForPageOffset(offset: number) {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to find the html element by using a fragment id
|
||||
*/
|
||||
export function getLineElementForFragment(fragment: string): CodeLineElement | undefined {
|
||||
return getCodeLineElements().find((element) => {
|
||||
return element.element.id === fragment;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user