Skip to content
New issue

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

tutorial: buggy code snippets #467

Open
manuel3108 opened this issue Oct 19, 2024 · 4 comments
Open

tutorial: buggy code snippets #467

manuel3108 opened this issue Oct 19, 2024 · 4 comments

Comments

@manuel3108
Copy link
Member

number 1

https://svelte-omnisite.vercel.app/tutorial/svelte/html-tags
image
According to the code, the whole @html should be highlighted in green, but currently only the @ is highlighted.

number 2

https://svelte-omnisite.vercel.app/tutorial/svelte/universal-reactivity
image
wth?

number 3 (similar to number 1)

http://localhost:5173/tutorial/svelte/each-blocks
image

style="background: +++{color}+++"
aria-label="+++{color}+++"
aria-current={selected === +++color+++}
on:click={() => selected = +++color+++}

number x

There are a few more cases like number 1 and 3, but im not going to list them all here, as it's probably going to be just one fix for all of them

@dummdidumm
Copy link
Member

I think the highlighting only works on tokens, and therefore is too long or cut off depending on where they start/end

@dummdidumm dummdidumm added this to the post-launch milestone Oct 19, 2024
@Conduitry
Copy link
Member

Number 2 isn't happening for me. What device/browser are you on?

@manuel3108
Copy link
Member Author

Windows and Edge.
Just checked, this only happens for me after loading the page, going to the previous one, and then to the original one.

@Rich-Harris
Copy link
Member

When stuff gets highlighted incorrectly it's likely because the two ends of the range don't have the same parent element. there's some munging that happens to try and make it behave but it's clearly not sophisticated enough

@linear linear bot added the svelte.dev label Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants