Skip to content

Commit cae0bf9

Browse files
committed
update readme
1 parent aeaa0c7 commit cae0bf9

File tree

1 file changed

+35
-3
lines changed

1 file changed

+35
-3
lines changed

README.md

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# SuperHTML
2-
HTML Language Server and Templating Language Library
2+
HTML Linter, Formatter, LSP, and Templating Language Library
33

4-
5-
## HTML Language Server
4+
## SuperHTML CLI Tool
65
The SuperHTML CLI Tool offers **validation** and **autoformatting** features for HTML files.
76

87
The tool can be used either directly (for example by running it on save), or through a LSP client implementation.
@@ -174,6 +173,39 @@ Follow your editor specific instructions on how to define a new Language Server
174173

175174
*(Also feel free to contribute more specific instructions to this readme / add files under the `editors/` subdirectory).*
176175

176+
177+
## FAQs
178+
### Why doesn't SuperHTML support self-closing tags?
179+
Because self-closing tags don't exist in HTML and, while harmless when used with void elements, it just keeps misleating people into thinking that you can self-close HTML tags.
180+
181+
In particular, given this HTML code:
182+
183+
```html
184+
<!doctype html>
185+
<html>
186+
<head></head>
187+
<body>
188+
<div/>
189+
<p></p>
190+
</body>
191+
</html>
192+
```
193+
194+
You might think that `<div>` and `<p>` are siblings, while in reality browsers are required **by the spec** to ignore the self-closing slash in `<div/>`, making `<p>` a child, not a sibling of it.
195+
196+
Add to that the fact that tooling like the default HTML formatter in VSCode will provide misleading autoformatting (try it yourself, disable SuperHTML in VSCode and autoformat the snippet above), to this day people are way more confused about HTML than they need to be.
197+
198+
Related: [#100](https://github.com/kristoff-it/superhtml/pull/100).
199+
200+
### Why doesn't SuperHTML report duplicate values in `[class]` as an error?
201+
The HTML spec defines the global `class` attribute as a space-separated list of tokens, as opposed to a space-separated list of *unique* tokens, like some other attributes are (e.g. `accesskey`).
202+
203+
### Why is `<style>` under `<body>` an error? It works in all browsers!
204+
As far as I'm concerned, there is no good reason to forbid `<style>` in body, but that's what the HTML spec does.
205+
206+
Related upstream issue: https://github.com/whatwg/html/issues/1605
207+
208+
177209
## Templating Language Library
178210
SuperHTML is also a HTML templating language. More on that soon.
179211

0 commit comments

Comments
 (0)