Giter Club home page Giter Club logo

Comments (5)

dummdidumm avatar dummdidumm commented on July 17, 2024 5

Things like this make me think that we may be better off by having a special attribute like data-enhanced which signals the preprocessor to preprocess the image? That way we can keep using the img tag and all the checks that come with it work.

from language-tools.

benmccann avatar benmccann commented on July 17, 2024 1

The workaround I've been using is to just define a class directly on the enhanced:img and use that. It'd be cool if we could support this, but I don't have enough experience with language-tools to know what's possible

This is because there isn't a preprocess config defined

Is the problem that we use vite-plugin-svelte to add the preprocessor instead of setting it up in the svelte.config.js file? We do that to simplify setup - you just install the Vite plugin and that's all you need to do.

I don't know what you guys need exposed exactly. The preprocessor depends on Vite, so I'm not sure if that might cause any difficulty?

from language-tools.

jasonlyu123 avatar jasonlyu123 commented on July 17, 2024

This is because there isn't a preprocess config defined. I am not sure if it makes sense if @sveltejs/enhanced-img should expose the preprocessor or if we should add simplify one in the language server that simply replaces "<enhanced:img" to
"<img" + ' '.repeat('enhanced:'.length)

from language-tools.

eltigerchino avatar eltigerchino commented on July 17, 2024

CC: @benmccann I'm not sure what the effects of exposing the preprocessor would mean for the enhanced-img package. What do you think would be best here?

from language-tools.

benmccann avatar benmccann commented on July 17, 2024

we may be better off by having a special attribute like data-enhanced

<enhanced:img src="./myimage.png" alt="an avocado" />

vs

<img src="./myimage.png" data-enhanced alt="an avocado" />

The former looks nicer and is fewer characters. There's some possibility we could consider the latter, but it's not my first choice.

This is because there isn't a preprocess config defined.

Could language-tools support sveltePreprocess from vite-plugin-svelte? This isn't just an issue that affects enhanced:img, but affects everything using that API. And even if we switch to data-enhanced, it will break again if we add any custom attributes.

from language-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.