This probably needs some explaining...

While snippets are great fun, user-friendly and real time savers, there is one situation where I hate them...

When I've written my text and want to add some extra style, like bold, italic or whatever, or maybe I need to make some word a link, the tags are expanded just before or just after the chosen word or text. Like so, for example:

<a href="_">_</a>text

Not only completely useless, but the needed intervention makes me feel rather clumsy...either the text has to be cut and pasted in between the opening and the closing tags, or the closing tag has to be moved to its correct position, just behind the text. Hmm, time for some creative thinking...

I know wrapping snippets can be coded, I've seen some javascript for it, that I understood..almost. But that way is too complicated for my purposes, I need a simple and totally reliable solution. So here is my way...

Why use one snippet, when you could use two?

If we chop up each snippet into two parts, one being the opening tag and the other the closing tag, everything becomes possible!

a1 text a2
Expanded:
<a href="_"> text </a>

Notice that the text forming the visible (clickable) part of the link, is already there, in the correct place. All that is needed, is entering the web address (url) at the cursor position.

Before you say this is too primitive and too time-consuming, consider this:

Don't take my word for it. Just try it yourself.

It's fun and one of the easiest ways of web writing.

You are in control again, both of the process and the result, not hindered by a script's iron logic...

A further bonus is that it allows writing "modern" html5, with its "ommitable" or optional (end)tags. I've written about that in the past.

One thing to remember: there has to be a space between the text and the closing tag snippet, to allow for the expansion to happen. This quickly becomes a habit . As far as I could see, this space has no negative effect on anything.

I truly hope you'll enjoy using this "invention", as much as I enjoyed creating it!

bertvee, 2024
Back to main page

arrow-up-circle