fauxparse / close-tags Goto Github PK
View Code? Open in Web Editor NEWAtom plugin to close HTML tags in text and source code.
License: MIT License
Atom plugin to close HTML tags in text and source code.
License: MIT License
Use activationCommands
instead of activationEvents
in your package.json
Commands should be grouped by selector as follows:
"activationCommands": {
"atom-workspace": ["foo:bar", "foo:baz"],
"atom-text-editor": ["foo:quux"]
}
Package.getActivationCommands (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:808:9)
Package.hasActivationCommands (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:733:20)
<unknown> (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:185:24)
Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:163:15)
Package.load (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:177:12)
PackageManager.loadPackage (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:355:14)
[Enter steps to reproduce below:]
Atom Version: 0.190.0
System: Mac OS X 10.10.2
Thrown From: close-tags package, v0.2.0
Failed to activate the close-tags package
At Cannot read property 'split' of undefined
TypeError: Cannot read property 'split' of undefined
at /Users/thibaultmaekelbergh/Dropbox/Mackup/.atom/packages/close-tags/lib/close-tags.coffee:11:23
at Config.module.exports.Config.observeKeyPath (/Applications/Atom.app/Contents/Resources/app/src/config.js:544:7)
at Config.module.exports.Config.observe (/Applications/Atom.app/Contents/Resources/app/src/config.js:126:21)
at Object.module.exports.activate (/Users/thibaultmaekelbergh/Dropbox/Mackup/.atom/packages/close-tags/lib/close-tags.coffee:8:19)
at Package.module.exports.Package.activateNow (/Applications/Atom.app/Contents/Resources/app/src/package.js:225:19)
at /Applications/Atom.app/Contents/Resources/app/src/package.js:206:30
at Package.module.exports.Package.measure (/Applications/Atom.app/Contents/Resources/app/src/package.js:152:15)
at Package.module.exports.Package.activate (/Applications/Atom.app/Contents/Resources/app/src/package.js:199:14)
at PackageManager.module.exports.PackageManager.activatePackage (/Applications/Atom.app/Contents/Resources/app/src/package-manager.js:435:21)
at /Applications/Atom.app/Contents/Resources/app/src/package-manager.js:419:29
at Config.module.exports.Config.transact (/Applications/Atom.app/Contents/Resources/app/src/config.js:302:16)
at PackageManager.module.exports.PackageManager.activatePackages (/Applications/Atom.app/Contents/Resources/app/src/package-manager.js:414:19)
at PackageManager.module.exports.PackageManager.activate (/Applications/Atom.app/Contents/Resources/app/src/package-manager.js:395:46)
at Atom.module.exports.Atom.startEditorWindow (/Applications/Atom.app/Contents/Resources/app/src/atom.js:634:21)
at Object.<anonymous> (/Applications/Atom.app/Contents/Resources/app/src/window-bootstrap.js:12:8)
at Object.<anonymous> (/Applications/Atom.app/Contents/Resources/app/src/window-bootstrap.js:23:4)
{
"core": {
"disabledPackages": [
"jslint",
"emmet",
"unregistered",
"compass",
"quippet",
"autocomplete-paths",
"autocomplete-plus"
],
"themes": [
"yeti-ui",
"kimbie-light"
],
"ignoredNames": [
"node_modules",
".DS_Store",
"npm-debug.log"
]
},
"close-tags": {}
}
# User
Atom-Syntax-highlighting-for-Sass, v0.5.0
atom-bootstrap3, v1.2.0
atom-html-preview, v0.1.6
atom-spotify, v1.2.0
atom-terminal, v0.7.0
backbonejs-snippets, v0.4.1
close-tags, v0.2.0
compare-files, v0.4.1
editor-stats, v0.17.0
editorconfig, v0.3.3
error-status, v0.3.3
file-icons, v1.5.3
git-log, v0.3.0
git-plus, v4.4.12
gulp-helper, v2.0.0
gulp-snippets, v0.6.1
iTunes, v0.2.0
jsonlint, v1.0.2
kimbie-light, v1.0.1
language-swift, v0.3.0
laravel, v0.4.2
linter, v0.12.0
linter-flow, v0.1.4
linter-jshint, v0.1.1
linter-php, v0.0.12
linter-scss-lint, v0.0.14
open-in, v3.1.0
open-in-browser, v0.4.3
path, v0.4.1
remote-edit, v1.7.2
remote-sync, v2.4.1
ssh-config, v0.10.0
swift-playground, v0.2.0
travis-ci-status, v0.13.0
uglify, v1.2.0
weather-package, v1.5.1
web-browser, v1.4.3
yeti-ui, v0.1.6
# Dev
No dev packages
<toptag>
<autoclose/>
<autoclose/>
If I press Alt-Ctrl-. at the end of this script it inserts </autoclose> instead of </toptag>
Store package style sheets in the styles/
directory instead of stylesheets/
in the close-tags
package
Package.getStylesheetsPath (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:460:9)
Package.getStylesheetPaths (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:471:32)
Package.loadStylesheets (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:453:38)
<unknown> (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:183:19)
Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:163:15)
Package.load (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:177:12)
XML allows tag and attribute names to have dashes, colons and dots. The web framework angular uses dashes a lot. The colon is essential for all XML documents with different name spaces. Unfortunately, close-tags does not recognize this. For the following open tags, no close tags are inserted:
http://www.xml.com/pub/a/2001/07/25/namingparts.html
Thanks for fixing,
Stefan
Thanks for this excellent package! Just one bug I've found:
<div><span><img>|</div> <!-- when the cursor is here -->
<div><span><img></img></div> <!-- this happens -->
In HTML rather than XHTML <span><img></span>
is valid and therefore should preferably be handled by this package.
It would be nice to have the ending tag automatically inserted either when typing the opening one, or when typing </
.
The context menu CSON format has changed. Please see
https://atom.io/docs/api/latest/ContextMenuManager
Hi,
thank you so much for fixing the previous bug. I found another one:
<toptag>
<xx attrib="123"/>
The autoclosing nature of the xx tag is recognized if it has attributes, or to be more precise, if it has a space.
Thanks for fixing!
In keymaps/close-tags.cson: Use the atom-text-editor
tag instead of the editor
class.
Use a config schema instead. See the configuration section
of https://atom.io/docs/latest/hacking-atom-package-word-count and
https://atom.io/docs/api/latest/Config for more details
Package.activateConfig (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:263:11)
Package.activateNow (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:234:14)
<unknown> (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:770:25)
Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:82:11)
CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:219:20)
<unknown> (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61)
This works:
<div>
<footer></footer> /* <-- closes as expected */
</div>
This doesn't:
<div>
<footer>
<div> /* <-- doesn't close */
</footer>
</div>
It doesn't matter what type of tag it is, as long as it's a tag that has an ancestor of the same type it won't close. This bug only happens if all the ancestors are already closed, and the parent is of a different type.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.