(targetId)
| 349 | } |
| 350 | |
| 351 | function scrollToHash(targetId) { |
| 352 | const target = getTargetElement(previewState.content, targetId); |
| 353 | if (!target) return; |
| 354 | |
| 355 | const topOffset = 12; |
| 356 | const top = |
| 357 | getOffsetTopWithinContainer(target, previewState.content) - topOffset; |
| 358 | |
| 359 | previewState.content.scrollTo({ |
| 360 | top: Math.max(0, top), |
| 361 | behavior: "smooth", |
| 362 | }); |
| 363 | } |
| 364 | |
| 365 | async function enhanceCodeBlocks(version) { |
| 366 | const codeBlocks = Array.from(previewState.content.querySelectorAll("pre")); |
no test coverage detected