RSS

 
WinEdt Macro Library  | HTML previous macro  | next macro

smartLink

Description

This macro attempts to recognize whether a selection is an e-mail address or a web address (http, https, ftp or ftps). It then creates a link depending on the format of the selection.

If an e-mail address is found, it is entered in the href attribute of the link and between the <A></A> tags, and the text between the tags is highlighted ready for editing.
The same is true of a web address starting with http://, ftp:// etc. If a web format is found without a starting protocol, the http:// is added to the href attribute, and the href text is highlighted ready for editing.
If a valid format is not found, a bullet is put in the href attribute and highlighted. If nothing is selected, then a bullet is placed both in the href, and between the tags, and the first is highlighted.

Installation

Put the macro in %b\Macros\HTML\, and assign a shortcut to it if you want.

Download

HTML/smartLink.edt

Macro contributed by Anthony Roy <progant-roy.co.uk>.

WinEdt Macro Library  | HTML previous macro  | next macro