|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
email formattingI've got a block of script that does a few operations so that I can output an email to screen. One operation will take any line over 80 characters and wrap it. Another operation will take any url and places it within an anchor tag. The problem is that when the url is very long, the first operation cuts it before the second operation can turn it into an anchor. Can anyone think of an efficient way to make sure that an url will not be cut before its turned into an anchor? I've tried putting the url operation first, but that cuts the anchor in half which disables it.
Any ideas? (and I'm getting one as I type this) Thanks ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:21:893 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/21 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:21 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.21 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54 |
|
|
Re: email formattingYou know what characters you are putting into the center of a URL (CR,
LF), so just allow for that when searching for hrefs. (allow urls to have linefeeds in the middle, and remove them when turning them into links.) On 7/22/05, Michael Dinowitz <mdinowit@...> wrote: > I've got a block of script that does a few operations so that I can output an email to screen. One operation will take any line over 80 characters and wrap it. Another operation will take any url and places it within an anchor tag. The problem is that when the url is very long, the first operation cuts it before the second operation can turn it into an anchor. Can anyone think of an efficient way to make sure that an url will not be cut before its turned into an anchor? I've tried putting the url operation first, but that cuts the anchor in half which disables it. > Any ideas? (and I'm getting one as I type this) > Thanks > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:21:894 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/21 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:21 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.21 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54 |
|
|
Re: email formattingIf the link is longer than 80 chars, shorten it with your magical HoF
link shortener! --Ben "quick and dirty" Doom Michael Dinowitz wrote: > I've got a block of script that does a few operations so that I can output an email to screen. One operation will take any line over 80 characters and wrap it. Another operation will take any url and places it within an anchor tag. The problem is that when the url is very long, the first operation cuts it before the second operation can turn it into an anchor. Can anyone think of an efficient way to make sure that an url will not be cut before its turned into an anchor? I've tried putting the url operation first, but that cuts the anchor in half which disables it. > Any ideas? (and I'm getting one as I type this) > Thanks > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Stay Ahead of Hackers - Download ZoneAlarm Pro http://www.houseoffusion.com/banners/view.cfm?bannerid=65 Message: http://www.houseoffusion.com/lists.cfm/link=i:21:895 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/21 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:21 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.21 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54 |
|
|
Re: email formattingHm. Basically, setting the anchor first, then shortening the line, then
finding all anchors that have been shortened and repairing them. That would work. As would Ben's suggestion to just make them into shortlinks with my pre-existing code. I'll play with both. Thanks > You know what characters you are putting into the center of a URL (CR, > LF), so just allow for that when searching for hrefs. (allow urls to > have linefeeds in the middle, and remove them when turning them into > links.) > > On 7/22/05, Michael Dinowitz <mdinowit@...> wrote: >> I've got a block of script that does a few operations so that I can >> output an email to screen. One operation will take any line over 80 >> characters and wrap it. Another operation will take any url and places it >> within an anchor tag. The problem is that when the url is very long, the >> first operation cuts it before the second operation can turn it into an >> anchor. Can anyone think of an efficient way to make sure that an url >> will not be cut before its turned into an anchor? I've tried putting the >> url operation first, but that cuts the anchor in half which disables it. >> Any ideas? (and I'm getting one as I type this) >> Thanks >> >> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:21:896 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/21 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:21 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.21 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54 |
| Free embeddable forum powered by Nabble | Forum Help |