Hi all,
The Hyperlink Helper bundle is fun, but it would be more useful for me to have a macro that would auto-convert all urls in a text document to active hyperlinks--eg, replacing:
Please visit my home page at http://mysite.net/home.html today!
with
Please visit my home page at <a href="http://mysite.net/home.html">mysite.net/home.html</a> today!
or some variation on this.
I could write this macro as a RegExp global replace, but I was thinking someone else may have already scripted it. If you know of a pre-existing macro, please let me know.
BTW this forum has been very helpful and quick to respond in the past--thanks for the support!
jon
Jon Ippolito <ron_elicit@...> writes:
Hi all,
The Hyperlink Helper bundle is fun, but it would be more useful for me
to have a
macro that would auto-convert all urls in a text document to active hyperlinks--eg, replacing:
Please visit my home page at http://mysite.net/home.html today!
with
Please visit my home page at <a href="http://mysite.net/home.html">mysite.net/home.html</a> today!
or some variation on this.
I could write this macro as a RegExp global replace, but I was thinking someone else may have already scripted it. If you know of a pre-existing macro,
please
let me know.
BTW this forum has been very helpful and quick to respond in the past--thanks for the support!
Also, it would be helpful to know if there is a way to turn off the automated title attribute lookup feature when choosing Wrap Selection as Link (Ctrl-Shift-L).
It's a nifty feature but slows me down when I'm coding on a slow Internet connection.
Thanks!
jon
On 9/4/07, Jon Ippolito ron_elicit@yahoo.com wrote:
Also, it would be helpful to know if there is a way to turn off the automated title attribute lookup feature when choosing Wrap Selection as Link (Ctrl-Shift-L).
It's a nifty feature but slows me down when I'm coding on a slow Internet connection.
I doubles this request.
When making image tags into links you get the entire image tag duplicated into the title attribute. Would be nice if the tags were stripped from this and just the filename minus extension was used.
James Hicks t. +44 (0)161 834 9889
____________________________________________________________________________ _________
The information transmitted in this email is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. ____________________________________________________________________________ _________ -----Original Message----- From: textmate-bounces@lists.macromates.com [mailto:textmate-bounces@lists.macromates.com] On Behalf Of Alexey Blinov Sent: 04 September 2007 11:24 AM To: TextMate users Subject: Re: [TxMt] Re: HTML autoconversion of urls to hyperlinks
On 9/4/07, Jon Ippolito ron_elicit@yahoo.com wrote:
Also, it would be helpful to know if there is a way to turn off the
automated
title attribute lookup feature when choosing Wrap Selection as Link (Ctrl-Shift-L).
It's a nifty feature but slows me down when I'm coding on a slow Internet connection.
I doubles this request.
______________________________________________________________________ For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On Sep 4, 2007, at 12:34 PM, James Hicks wrote:
When making image tags into links you get the entire image tag duplicated into the title attribute. Would be nice if the tags were stripped from this and just the filename minus extension was used.
Can you give an example of this?
He's right. If you just highlight a full image tag and choose Wrap as Link, it will insert the full image tag into the title attribute. I have a regex to strip that, I'll upload tonight.
Brett
On Sep 4, 2007, at 7:27 PM, Allan Odgaard wrote:
On Sep 4, 2007, at 12:34 PM, James Hicks wrote:
When making image tags into links you get the entire image tag duplicated into the title attribute. Would be nice if the tags were stripped from this and just the filename minus extension was used.
Can you give an example of this?
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
This is a modification of the command in the Hyperlink bundle as a new command. It just adds code that checks to see if there is a title, and if not, checks to see if it's linking an image (HTML) and grabs, in order, it's alt or src attribute for the title. It's rough, but it does need to be done. The linking bundle frequently sticks entire html tags into the title attribute. I'm a huge fan/ proponent of proper title attributes, so I'd like to make them as convenient as possible.
Also, I'm pretty sure that I made this version too HTML specific to be worth much to the Hyperlink Helper bundle. But I only had about 5 minutes to spend on it, so I'm offering what I can.
Brett
On Sep 5, 2007, at 8:10 AM, Brett Terpstra wrote:
He's right. If you just highlight a full image tag and choose Wrap as Link, it will insert the full image tag into the title attribute. I have a regex to strip that, I'll upload tonight.
Brett
On Sep 4, 2007, at 7:27 PM, Allan Odgaard wrote:
On Sep 4, 2007, at 12:34 PM, James Hicks wrote:
When making image tags into links you get the entire image tag duplicated into the title attribute. Would be nice if the tags were stripped from this and just the filename minus extension was used.
Can you give an example of this?
_ For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On Sep 5, 2007, at 3:10 PM, Brett Terpstra wrote:
He's right. If you just highlight a full image tag and choose Wrap as Link, it will insert the full image tag into the title attribute. [...]
Not for me. If I have a URL on the clipboard, it inserts the page title in the title attribute, otherwise it does not insert any title attribute at all (for the a tag).
This was already in my HTML bundle, but I can't remember if it was default or not. I have both pop up on Ctrl-Shift-L so that I can choose.
Brett
On Sep 4, 2007, at 5:23 AM, Alexey Blinov wrote:
On 9/4/07, Jon Ippolito ron_elicit@yahoo.com wrote:
Also, it would be helpful to know if there is a way to turn off the automated title attribute lookup feature when choosing Wrap Selection as Link (Ctrl-Shift-L).
It's a nifty feature but slows me down when I'm coding on a slow Internet connection.
I doubles this request.
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On Sep 4, 2007, at 12:01 PM, Jon Ippolito wrote:
[...] it would be helpful to know if there is a way to turn off the automated title attribute lookup feature when choosing Wrap Selection as Link (Ctrl-Shift-L).
Presently only be editing the command. I see Brent sent an additional command w/o the feature, which would let you pick which each time.
Probably that is better than a setting.
On Sep 4, 2007, at 4:09 AM, Jon Ippolito wrote:
[...] it would be more useful for me to have a macro that would auto-convert all urls in a text document to active hyperlinks [...]
I could write this macro as a RegExp global replace, but I was thinking someone else may have already scripted it. If you know of a pre-existing macro, please let me know.
Are you familiar with Markdown? Perhaps it would be more effective for you to write the first draft of your text in Markdown and press ⌃⇧H to generate the HTML -- Markdown will convert <http:// macromates.com/> into <a href="http://macromates.com/">http://macromates.com/</a>