Merge branch 'master' into test-speedup

This commit is contained in:
Sam Rose 2025-03-05 13:31:59 +00:00 committed by GitHub
commit 735ec39cfc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 8 deletions

View File

@ -1,6 +1,6 @@
{ {
"$schema": "node_modules/lerna/schemas/lerna-schema.json", "$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "3.4.23", "version": "3.4.24",
"npmClient": "yarn", "npmClient": "yarn",
"concurrency": 20, "concurrency": 20,
"command": { "command": {

View File

@ -145,9 +145,11 @@
return return
} }
popoverAnchor = target popoverAnchor = target
const doc = new DOMParser().parseFromString(helper.description, "text/html")
hoverTarget = { hoverTarget = {
type: "helper", type: "helper",
description: helper.description, description: doc.body.textContent || "",
code: getHelperExample(helper, mode === BindingMode.JavaScript), code: getHelperExample(helper, mode === BindingMode.JavaScript),
} }
popover.show() popover.show()
@ -241,20 +243,19 @@
> >
{#if hoverTarget.description} {#if hoverTarget.description}
<div> <div>
<!-- eslint-disable-next-line svelte/no-at-html-tags--> {hoverTarget.description}
{@html hoverTarget.description}
</div> </div>
{/if} {/if}
{#if hoverTarget.code} {#if hoverTarget.code}
{#if mode === BindingMode.JavaScript} {#if mode === BindingMode.Text || (mode === BindingMode.JavaScript && hoverTarget.type === "binding")}
<!-- eslint-disable-next-line svelte/no-at-html-tags-->
<pre>{@html hoverTarget.code}</pre>
{:else}
<CodeEditor <CodeEditor
value={hoverTarget.code?.trim()} value={hoverTarget.code?.trim()}
mode={EditorModes.JS} mode={EditorModes.JS}
readonly readonly
/> />
{:else if mode === BindingMode.Text}
<!-- eslint-disable-next-line svelte/no-at-html-tags-->
<pre>{@html hoverTarget.code}</pre>
{/if} {/if}
{/if} {/if}
</div> </div>