smartparens
smartparens copied to clipboard
Clarify HTML tag pairing
I'd like to be able to type <p> and have smartparens automatically add </p>.
smartparens-html.el seems to contain code that does this:
(sp-with-modes sp--html-modes
(sp-local-pair "<" ">")
(sp-local-tag "<" "<_>" "</_>" :transform 'sp-match-sgml-tags :post-handlers '(sp-html-post-handler)))
However, sp-match-sgml-tags is marked as deprecated as of f4c0f0da485f9bbbff39e51b4673b035ed1320a6. That commit says "remove tags", but sp-local-tag doesn't seem to be deprecated.
So, what are tags in smartparens? Are they still supported? Should smartparens be able to add a closing HTML </foo>?
They are in a somewhat weird state, it doesn't work but the code is there to keep working config working.
The long-term plan is to unify tags with normal pairs because they are really nothing special (we already support keyword pairs and other complicated things). The plan was to have the rewrite done by the end of february this year... apparently it didn't work out :/
Hi, what's the situation with this? Have html tags been abandoned for now?
I have a rather low priority plan to bring this back, I feel like html-mode or web-mode and similar do better job with the insertion, then can handle special cases like no-closing-tag tags and similar. The tag parsing in smartparens still works though, and you can use slupr/barf etc. just as ever.
FWIW https://github.com/magnars/tagedit can do this, if you need a solution today.
I haven't seen any functionality in html-mode for this: sgml-tag only creates the opening tag, then sgml-close-tag closes it (handy, but requires an extra command). @Fuco1 have I missed some awesome workflow?
@Wilfred no idea, I don't do html :)
Thanks both—I think you're right, tagedit and web-mode already provide great solutions. Maybe it's worth linking to those packages in the readme to help html people find what they're looking for?