|
Add <pre> tags and convert
[Back]
Adds <pre> and </pre>
tags either side of the selection, and replaces <, >
and & with their HTML character entity references
(or entities for short), i.e <, >
and & respectively.
Requires selection
sel=get_selection()
if (search_string(sel, "&", 0) != -1)
replace_in_selection("&", "&")
if (search_string(sel, "<", 0) != -1)
replace_in_selection("<", "<")
if (search_string(sel, ">", 0) != -1)
replace_in_selection(">", ">")
s=$selection_start
e=$selection_end
select($cursor,$cursor)
set_cursor_pos(s)
insert_string("<pre>\n")
set_cursor_pos(e+6)
insert_string("</pre>\n")
[Back]
Released on Wed, 21 Nov 2001
by
C. Denat
|
|