Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct extra indentation on block close tag #220

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
# Auto Close HTML package for Atom Text Editor

Will automatically add closing tags when you complete the opening tag.
Updated to correct extra indentation of closing tags on block elements.

# Installation

Install using

`apm install autoclose-html`

Until merge of this fork, install using temporary installation process as follows:

1. Uninstall autoclose-html 0.24.0
2. open a terminal and ...
3. > cd ~/.atom/packages
4. > git clone https://github.com/Ordinal-Data-Inc/autoclose-html.git
5. > cd autoclose-html
6. > npm install
7. > restart Atom
8. Check that Atom > preferences > packages shows autoclose-html 0.24.1
9. (Optional) Have a sip of coffee

# Usage

Under normal circumstances ending tags will be inserted on the same line for inline elements and with `\n\t\n` in between for block elements. This is determined by attaching an element of the given type to the window and checking it's calculated `display` value.
Expand Down Expand Up @@ -71,3 +84,6 @@ be removed.

#### 0.24.0
- Stopped self closing tags from auto closing

#### 0.24.1
- Fixes extra indentation on block close tags. Presumes the use of autoindent.
1 change: 1 addition & 0 deletions lib/autoclose-html.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ module.exports =

if not isInline
editor.insertNewline()
editor.backspace() # corrects extra indentation on block close
editor.insertNewline()
editor.insertText('</' + eleTag + '>')
if isInline
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "Matt Berkowitz"
},
"main": "./lib/autoclose-html",
"version": "0.24.0",
"version": "0.24.1",
"private": true,
"description": "Automates closing of HTML Tags",
"repository": {
Expand Down