We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<script> let caption = 'Lorem ipsum'; </script> <figure> <img src="https://placekitten.com/200/300" alt="kitty" /> {#if caption} <figcaption>{caption}</figcaption> {/if} </figure>
This outputs the following warning: A11y: <figcaption> must be an immediate child of <figure>
A11y: <figcaption> must be an immediate child of <figure>
REPL: https://svelte.dev/repl?version=3.1.0&gist=81856872f651e9f460d8f7497dedceb5
The text was updated successfully, but these errors were encountered:
I wonder what blocks should be discarded when checking the figure/figcaption relationship.
figure
figcaption
Possibly {#if}, {:else if}, {:else}, and {#await}, {:then}, {:catch}?
{#if}
{:else if}
{:else}
{#await}
{:then}
{:catch}
<script> let caption = 'foo'; let captionPromise = Promise.resolve('foo'); </script> <figure> <img src="https://placekitten.com/200/300" alt="kitty" /> {#if caption === 'foo'} <figcaption>{caption}</figcaption> {:else if caption === 'bar'} <figcaption>{caption}</figcaption> {:else} <figcaption>{caption}</figcaption> {/if} </figure> <figure> <img src="https://placekitten.com/200/300" alt="kitty" /> {#await captionPromise} <figcaption>Loading</figcaption> {:then c} <figcaption>{c}</figcaption> {:catch e} <figcaption>{e}</figcaption> {/await} </figure>
Sorry, something went wrong.
I think we should probably just be looking for the nearest ancestor of the Element node type, and making sure that it's a <figure>.
Element
<figure>
I know this is already closed, and I might be doing this wrong, but what do you guys think? Should this also be considered?
Successfully merging a pull request may close this issue.
This outputs the following warning:
A11y: <figcaption> must be an immediate child of <figure>
REPL: https://svelte.dev/repl?version=3.1.0&gist=81856872f651e9f460d8f7497dedceb5
The text was updated successfully, but these errors were encountered: