|
何でもできますが、タグを取り去るツールを探したほうが賢明かも ...
//*1 b1.mac
if( rightstr(basename,5) == ".html" || rightstr(basename,4) == ".htm" ){
call pp_pre_tag1;
}
endmacro;
// <pre> </pre> の考慮 - 完璧では在りません !!!
pp_pre_tag1:
if( updated ){ endmacro; } // 更新してる !!!
replaceallfast "<\\f/?\\f(pre|PRE)>", "<\\1pre>", regular;
replaceallfast "[^\\n]\\f<\\f/?\\fpre>", "\\0\\n<\\2pre>", regular;
replaceallfast "<\\f/?\\fpre>\\f[^\\n]", "<\\1pre>\\n\\3", regular;
gofiletop;
searchdown "^<pre>", regular;
while( result ){
escape; down; #x = x; #y = y; beginsel;
searchdown "</pre>", regular;
if( ! result ){
escape; message "</pre> not found !!!"; endmacro;
}
beginsel; moveto #x, #y;
replaceallfast "\\n", "<p>\\n", regular, inselect;
searchdown "^<pre>", regular;
}
gofiletop;
return;
//*1 b2.mac
// 3、全てのタグをとる
if( rightstr(basename,5) == ".html" || rightstr(basename,4) == ".htm" ){
call pp_del_tag1;
} else {
replaceallfast "<[^>]+>", "", regular, inselect;
// 動くかな ??? 疑問 !!!
}
endmacro;
pp_del_tag1: // 秀丸 依存版 !!!
gofiletop;
searchdown "<[^>]+>", regular;
while( result ){
#xs = seltopx; #ys = seltopy; #xe = selendx; #ye = selendy; escape;
if( colorcode == 13 ){ // HTML タグ全体部分
moveto #xe-1, #ye;
if( colorcode == 13 ){ // HTML タグ全体部分
right; beginsel; moveto #xs, #ys;
// menu str(colorcode);
delete; escape;
}
left;
}
finddown;
}
gofiletop;
return;
|
|