Can I disable automatically adding closing HTML tags?

When I’m writing HTML in Replit, Replit constantly adds closing tags, even when I don’t want them.

For example, let’s say I have this content:

My Website

Welcome to my website!

Now when I try to make My Website a heading, I type <h1> before it:

<h1>My Website

Welcome to my website!

However, as soon as I type the > character, Replit adds a closing </h1> tag right after my cursor:

<h1></h1>My Website

Welcome to my website!

So now I have to delete the closing </h1> and add it in the right place.

<h1>My Website</h1>

Welcome to my website!

I have disabled the Code intelligence setting for my repl, but I still get this same behavior. This is pretty frustrating, especially because I’m using Replit to teach a class, and this constantly trips the students up. I’m almost to a point where I’m thinking I should switch away from Replit.

Is there a setting I’m missing, or some other way to disable this feature?

4 Likes

Hi @KevinWorkman interesting issue. I was convinced that changing a setting in the .replit file would resolve this but… it didn’t (yet).

[languages.html]
pattern = "**/*.html"
  [languages.html.languageServer]
start = "vscode-html-language-server --stdio"
  [languages.html.languageServer.initializationOptions]
  provideFormatter = true
  [languages.html.languageServer.configuration.html]
  customData = [ ]
  autoCreateQuotes = false
  autoClosingTags = true ** <-- this is the line I was going to suggest changing to false
  mirrorCursorOnMatchingTag = false
...

I’ve moved this to #bug-reports as I think there is an issue applying the config to the code editor.

2 Likes