Hi all,
Rudimentary editing inquiry here. I need to be able to append alt="foo" to about 30 <img> tags on my HTML document which resembles the following:
<img width="30" height="30" src="<?= base_url() ?>/media/img/patientedit.png">
Is there a quick way to do this in TextMate?
Cheers,
- sf
On 31 Oct 2007, at 17:09, Steve Finkelstein wrote:
Hi all,
Rudimentary editing inquiry here. I need to be able to append alt="foo" to about 30 <img> tags on my HTML document which resembles the following:
<img width="30" height="30" src="<?= base_url()
?>/media/img/patientedit.png">
Is there a quick way to do this in TextMate?
Search and replace?
On Oct 31, 2007, at 1:09 PM, Steve Finkelstein wrote:
Hi all,
Rudimentary editing inquiry here. I need to be able to append alt="foo" to about 30 <img> tags on my HTML document which resembles the following:
<img width="30" height="30" src="<?= base_url()
?>/media/img/patientedit.png">
Is there a quick way to do this in TextMate?
Cheers,
- sf
Sounds like you just need a simple search and replace. Unless those alt tags need to be unique or something.
SEARCH: <img width="30" height="30" src
REPLACE: <img alt="foo" width="30" height="30" src
—Thomas Aylott – subtleGradient—
well, how about:
find: "<img" replace with: "<img alt="foo"
On Oct 31, 2007, at Oct 31, 10:09 AM, Steve Finkelstein wrote:
Hi all,
Rudimentary editing inquiry here. I need to be able to append alt="foo" to about 30 <img> tags on my HTML document which resembles the following:
<img width="30" height="30" src="<?= base_url()
?>/media/img/patientedit.png">
Is there a quick way to do this in TextMate?
Cheers,
- sf
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 31/10/2007, Steve Finkelstein sf@stevefink.net wrote:
Rudimentary editing inquiry here. I need to be able to append alt="foo" to about 30 <img> tags on my HTML document which resembles the following:
<img width="30" height="30" src="<?= base_url()
?>/media/img/patientedit.png">
Is there a quick way to do this in TextMate?
Do a search and replace. Search for the regular expression
<(img([^">]|"[^"]*")*)>
and replace with
<$1 alt="foo">
Does that do what you wanted?
Robin
On 31/10/2007, at 18:09, Steve Finkelstein wrote:
Hi all,
Rudimentary editing inquiry here. I need to be able to append alt="foo" to about 30 <img> tags on my HTML document
Another option (and a damn nice shortcut to learn, ultra cool for HTML editing) though only usefull if your tags are on contiguous lines:
- Select all lines - Hit Command + Option + A (Text » Edit All Lines in Selection) - Go to the end of the first line and type away
Also, a cool trick is using the Multiple Arbitrary Simultaneous Carets from Duane Johnson's Bundle: <http://blog.inquirylabs.com/my-textmate-bundle/
Hope it helps...
-- Ale Muñoz http://sofanaranja.com http://bomberstudios.com