Giter VIP home page Giter VIP logo

Comments (4)

RafidMuhymin avatar RafidMuhymin commented on August 24, 2024

Minimal repro:

---
// Please view the code in VSCode. Highlighting in GitHub is different from VSCode
import { SEO } from "astro-seo";
---

<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width" />
    <!-- The the keys and child keys inside the openGraph object prop aren't highlighted. However, the GitHub highlighter properly highlights them. -->
    <SEO
      title="Francis York Morgan"
      description="Agent"
      canonical="Zach"
      openGraph={{
        basic: {
          title: "Tinker Tailor Soldier Spy",
          type: "book",
          image:
            "https://user-images.githubusercontent.com/5182256/131216951-8f74f425-f775-463d-a11b-0e01ad9fce8d.png",
          url: "smiley",
        },
        article: {
          publishedTime: "2021-09-22",
          modifiedTime: "2021-09-22",
          expirationTime: "2021-09-22",
          authors: ["Smiley", "Control"],
          section: "Literature",
          tags: ["Spy fiction", "Thriller"],
        },
      }}
    />
  </head>
  <body>Test</body>
</html>

from language-tools.

RafidMuhymin avatar RafidMuhymin commented on August 24, 2024

Another good example:

(Please view the code in VSCode. GitHub highlights Astro code blocks differently than the VSCode extension)

---
const src = "https://picsum.photos/200/300";
const alt = "A random image";
const placeholder = "tracedSVG";

const traceOptions = {
  background: "#fff",
  color: "#000",
  turnPolicy: "black",
  turdSize: 1,
  alphaMax: 1,
  optCurve: true,
  threshold: 100,
  blackOnWhite: false,
};

const posterizeOptions = {
  fill: "spread",
  steps: [0, 50, 100],
  ranges: "equal",
};
---

<Image
  {src}
  {alt}
  {placeholder}
  formatOptions={{
    tracedSVG: {
      options: {
        background: "#fff",
        color: "#000",
        turnPolicy: "black",
        turdSize: 1,
        alphaMax: 1,
        optCurve: true,
        threshold: 100,
        blackOnWhite: false,
      },
    },
  }}
/>

<Image
  {src}
  {alt}
  {placeholder}
  formatOptions={{
    tracedSVG: {
      options: traceOptions,
    },
  }}
/>

<Image
  {src}
  {alt}
  {placeholder}
  // tracing SVG
  formatOptions={{
    tracedSVG: {
      function: "trace",
      options: traceOptions,
    },
  }}
/>

<Image
  {src}
  {alt}
  {placeholder}
  // posterizing SVG
  formatOptions={{
    tracedSVG: {
      function: "posterize",
      options: {
        ...traceOptions,
        ...posterizeOptions,
      },
    },
  }}
/>

from language-tools.

Princesseuh avatar Princesseuh commented on August 24, 2024

This seems to have been fixed? There's still an issue with the usage of the word function, but you're not really supposed to use reserved names in general and that part I don't think is on us (inside expressions, we just use TSX's syntax)

Outside of that specific issue, the result shown is the same for me in both Astro and TSX files

from language-tools.

RafidMuhymin avatar RafidMuhymin commented on August 24, 2024

@Princesseuh confirming that this issue has been fixed.

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.