EmEditorのマクロで選択範囲をソースコード用のタグ<pre class="prettyprint"></pre>で囲んで、&類を実体参照化するマクロ。preの中だと自動で実体参照に変換してくれないようなので。
Blogger投稿用デス。
- Dim strData
- Dim intSCount
- intSCount = 4 'tab→半角スペース置換えの際のスペースの数
- strData = document.selection.Text
- strData = Replace(strData, vbTab, String(intSCount," "))
- strData = Replace(strData, "&", "&")
- strData = Replace(strData, "<", "<")
- strData = Replace(strData, ">", ">")
- strData = Replace(strData, """", """)
- strData = Replace(strData, "'", "'")
- document.selection.Text = "<pre class=""prettyprint"">"
- document.selection.NewLine
- document.selection.Text = strData
- document.selection.Text = "</pre>"
0 件のコメント:
コメントを投稿