()
| 410 | } |
| 411 | |
| 412 | async function render() { |
| 413 | const pluginSettings = settings.uiSettings[`plugin-${plugin.id}`]; |
| 414 | $page.body = view({ |
| 415 | ...plugin, |
| 416 | body: markdownIt({ |
| 417 | html: true, |
| 418 | xhtmlOut: true, |
| 419 | }) |
| 420 | .use(MarkdownItGitHubAlerts) |
| 421 | .use(anchor, { |
| 422 | slugify: (s) => |
| 423 | s |
| 424 | .trim() |
| 425 | .toLowerCase() |
| 426 | .replace(/[^a-z0-9]+/g, "-"), |
| 427 | }) |
| 428 | .use(markdownItTaskLists) |
| 429 | .use(markdownItFootnote) |
| 430 | .render(plugin.description), |
| 431 | changelogs: plugin.changelogs |
| 432 | ? markdownIt({ html: true, xhtmlOut: true }) |
| 433 | .use(MarkdownItGitHubAlerts) |
| 434 | .use(anchor, { |
| 435 | slugify: (s) => |
| 436 | s |
| 437 | .trim() |
| 438 | .toLowerCase() |
| 439 | .replace(/[^a-z0-9]+/g, "-"), |
| 440 | }) |
| 441 | .use(markdownItTaskLists) |
| 442 | .use(markdownItFootnote) |
| 443 | .render(plugin.changelogs) |
| 444 | : null, |
| 445 | purchased, |
| 446 | installed, |
| 447 | update, |
| 448 | isPaid, |
| 449 | price, |
| 450 | buy, |
| 451 | refund, |
| 452 | install, |
| 453 | uninstall, |
| 454 | currentVersion, |
| 455 | minVersionCode, |
| 456 | isSupported, |
| 457 | unsupportedEditor, |
| 458 | showEditorSupportWarning: !isSupported, |
| 459 | }); |
| 460 | |
| 461 | // Handle anchor links |
| 462 | $page.body.querySelectorAll("a[href^='#']").forEach((link) => { |
| 463 | const originalHref = link.getAttribute("href"); |
| 464 | link.setAttribute("data-href", originalHref); |
| 465 | link.style.cursor = "pointer"; |
| 466 | // Remove default click behavior |
| 467 | link.removeAttribute("href"); |
| 468 | |
| 469 | // Add custom click handler |
no test coverage detected