I want to output it as a single quotation after entering emmet in vscode.

Asked 2 years ago, Updated 2 years ago, 59 views

I am typing emmet in vscode, but I want the output to be single quotation, so I wrote this in settings.json.

"emmet.syntaxProfiles": {
    "html": {
        "attr_quotes": "single"
    }
}

This will be a single for now.

For example, if you type a and press tab, this is what happens.

<a href='>>/a>

However, when you start typing from class or href, it becomes a double quotation.
For example, if the div tag is already written and you insert a class into it or insert a href into the a tag with emmet, it becomes double like this.

<div class="">
<a href="">

Is there a way to output this as a single as shown below?

<div class='">
<a href='>

vscode

2022-09-29 22:39

1 Answers

Inserting only class and href is not a feature of Emmet, so that is not enough configuration (Note: Emmet Feature Matrix https://docs.emmet.io/abbreviations/syntax/).

In settings.json, try adding:

"javascript.preferences.quoteStyle": "single",
"typescript.preferences.quoteStyle": "single"

Of course, Emmet settings are also required.

"emmet.syntaxProfiles": {
    "html": {
        "attr_quotes": "single"
    }
}


2022-09-29 22:39

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.