Comments (4)
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.
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.
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.
@Princesseuh confirming that this issue has been fixed.
from language-tools.
Related Issues (20)
- 🐛 BUG: version 2.8.1 removes trailing comma on save HOT 6
- 🐛 BUG: Type annotation for Astro.props can fail with single property HOT 3
- 🐛 BUG: Using Vue component with optional properties in Astro file cause type error HOT 4
- 🐛 BUG: Astro VSCode extension crashing Typescript language server HOT 15
- Auto import of Astro's navigate() in VS Code defaults to astro/dist/transitions/router HOT 2
- 🐛 BUG: Missing trailing backslash in void elements breaks code highlighting when inside a map method HOT 1
- 💡 RFC: Add {} after =
- 🐛 BUG: The Astro syntax parser freezes Neovim when writing an opening curly brace HOT 1
- 🐛 BUG: extension not doing anything (no syntax color, no intellisense, etc) HOT 4
- 🐛 BUG: Comment shortcut generates `//` within a JSX expression HOT 1
- Is crashing my ts server HOT 1
- Extension causes the JS/TS language server to crash HOT 1
- 🐛 BUG: autocomplete does not work with inline style when Japanese text is included in an element. HOT 1
- 🐛 BUG: 2.8.6 breaks typescript server on VSCode
- 💡 RFC: Add code fix to replace quotes with curly braces
- 🐛 BUG: Moving files results in formatting issues in Svelte files HOT 8
- 🐛 BUG: astro check cannot parse file HOT 3
- 🐛 BUG: Go to problems after version 2.9.0 HOT 7
- 🐛 BUG: Astro check support for Object.groupBy() HOT 4
- 🐛 BUG: TS Tries To Parse Code In `<pre>` Tags HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from language-tools.