.
.   
NEdit.org
   .

Home
 - News - Download - Documentation - Search - FTP     
.
.
  

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 &lt;, &gt; and &amp; respectively.

Requires selection

sel=get_selection()
if (search_string(sel, "&", 0) != -1)
   replace_in_selection("&", "&amp;")
if (search_string(sel, "<", 0) != -1)
   replace_in_selection("<", "&lt;")
if (search_string(sel, ">", 0) != -1)
   replace_in_selection(">", "&gt;")
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  

  
Visit our sponsor
Check Metrolink

© NEdit.org
1999-2001
All rights reserved


.