On Jul 21, 2010, at 7:32 PM, bennett von bennett wrote:
notice that the </h3> tag is on the next line - obviously this is undesirable and it slows down my coding way too much to have to then manually take my cursor over and insert a return after the closing tag - so much that it is obviously not worth it.
I understand what you’re saying, but “Select → Paragraph” was no doubt meant as a general purpose tool and not specifically for wrapping things in tags. Imagine if you were trying to delete the paragraph instead. You’d be annoyed that the newline at the end wasn’t included (or at least I would).
so for the sake of my being able to write readable code how do I accomplish this?
A couple of options:
* Use Find & Replace with a regular expression. * Use the HTML bundle’s “Wrap Each Selected line…” command (⌃⇧⌘W) instead of “Wrap Selection”. If no line is literally selected, it will just wrap the current line. * Use the Markdown bundle. (see http://daringfireball.net/projects/markdown/ if you’re not familiar)
I write almost everything in Markdown because it’s just boring, portable text, but if I do need HTML for whatever reason, it’s just a keystroke away. Your document may already be formatted to where Markdown will do what you want. If not, you can probably get it there with some small changes.