2007/11/08

HTMLサニタイズ用のマクロです。やはりサニタイズをかけたいところを選択して実行してください。

'サニタイズ
Set sel=document.selection
If Not sel.IsEmpty Then
 sText=sel.Text
 sText=Replace(sText,"&","&")
 sText=Replace(sText,"<","<")
 sText=Replace(sText,">",">")
 sText=Replace(sText,"""",""")
 sel.Text=sText
End If

これも何気に便利で良く使っています。このエントリを投稿するのにも使いましたw

元記事:http://blogs.wankuma.com/mutaguchi/archive/2007/11/08/106969.aspx

古い記事へ | 新しい記事へ


プライバシーポリシー

Twitter

Books