Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Properly indent after optional close tag #188

Open
fulldecent opened this issue Jan 11, 2018 · 1 comment
Open

Properly indent after optional close tag #188

fulldecent opened this issue Jan 11, 2018 · 1 comment

Comments

@fulldecent
Copy link

fulldecent commented Jan 11, 2018

Description

Auto indentation should use knowledge of optional closing tags

Steps to Reproduce

  1. Blank document
  2. Save as bob.html
  3. Type:
<!doctype html>
<html>
<head>
  <title>Yo</title>
  <body>

Expected behavior: [What you expect to happen]

Upon typing the last > in <body> (or, alternatively, typing the space in <body class=...) that <body> line should be indented left. In other words, the same indentation level as the <head> line.

Actual behavior: [What actually happens]

The <body> line is indented as a subordinate (one level deeper of indentation) than the <head> line.

Reproduces how often: [What percentage of the time does it reproduce?]

100%.

Versions

Atom : 1.23.3
Electron: 1.6.15
Chrome : 56.0.2924.87
Node : 7.4.0

macOS 10.13.2 (17C205)

Additional Information

<head> => <body> is only one such scenario included in this issue. For a full list of optional close HTML tags, see O in the "End tag" column of https://www.w3.org/TR/html4/index/elements.html (I can't find the HTML5 version of this document).

See also https://www.w3.org/TR/html51/syntax.html#in-head for more discussion of HTML5 tokenization and tree building.

See also https://www.w3.org/TR/html51/syntax.html#the-stack-of-open-elements for discussion of special HTML5 elements.

@fulldecent fulldecent changed the title Properly handle Properly indent after optional close tag Jan 11, 2018
@revelt
Copy link

revelt commented Apr 19, 2018

Does the requested solution involve adding missing </head>?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants