-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Problem
A .astro file is a component file used in the Astro web framework.
Currently this is not recognised by strings utility but would be helpful if it this is supported, for a project like groupincome.org that uses this framework to build the website.
There is one thing to note about .astro file regarding curly braces({}). .astro file uses JSX-like syntax to inject Javascript expressions into its HTML template and uses curly braces for it. For example:
---
const name = "Astro";
---
<div>
<h1>Hello {name}!</h1> <!-- Outputs <h1>Hello Astro!</h1> -->
</div>Or for specifying html attributes like:
---
const name = "Astro";
---
<h1 class={name}>Attribute expressions are supported</h1>This means if {} is used for variable replacements like below i18n.vue usage:
i18n(:args='{ name: chatRoomAttributes.name, ...LTags("strong") }') Yes, I want to {strong_}delete {name} permanently{_strong}.This will results in a compile error if used in .astro file.
Solution
- Making the utility recognise
.astrofile as well. - Unless there is a better idea, could the pipe symbol
|be used for variable replacements too? For example,.astroversion of the abovei18nexample would be like this:
i18n(args={{ name: chatRoomAttributes.name, ...LTags("strong") }}) Yes, I want to |strong_|delete |name| permanently|_strong|.This is my own idea for the solution but if there is a better alternative, please go ahead with it.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels