ソースコードをブログ(MT)に貼り付けられる形式に変換するツール

| | Comments (0) | TrackBacks (0)
ソースコードをブログ(MT)に貼り付けられる形式に変換するツールを作成した。
ここ(mahata.net内)からツールに遷移できる。


ためしに、ツールそのもののコードを貼り付けて添付してみる。


(strip_tags.html)


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="ja">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="description" content="mahata.net">
<meta name="keywords" content="mahata, mahata.net, programming, tool">
<meta name="author" content="Yasunori MAHATA">
<title>mahata.net - strip tags</title>


<body>


<p>
ブログにソースコードを貼り付けるツール。
</p>

<p>
<form action="strip_tags_proc.html" method="post">
<textarea name="code" cols="96" rows="32"></textarea><br />
<input type="submit" />
</form>
</p>

</body>

</html>


(strip_tags_proc.html)


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="ja">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="description" content="mahata.net">
<meta name="keywords" content="mahata, mahata.net, programming, tool">
<meta name="author" content="Yasunori MAHATA">
<title>mahata.net - strip tags</title>


<body>


<p>
ブログに貼り付けられる形態に変換しました。
</p>


<p>
<textarea cols="96" rows="32"><?php echo str_replace('&', '&amp;', htmlspecialchars($_POST['code'])); ?></textarea><br />
</p>

<hr />

<p>
再度の変換を試したい場合は、次のテキストボックスを利用してください。
</p>

<p>
<form action="strip_tags_proc.html" method="post">
<textarea name="code"  cols="96" rows="32"><?php echo $_POST['code']; ?></textarea><br />
<input type="submit" />
</form>
</p>

</body>

</html>


何ていうことはしていなくて、ただ単にhtmlspecialcharsを通したものの&をさらに&amp(←本当は半角) に変換しただけ。

0 TrackBacks

Listed below are links to blogs that reference this entry: ソースコードをブログ(MT)に貼り付けられる形式に変換するツール.

TrackBack URL for this entry: http://mahata.net/movabletype/mt-tb.cgi/2975

Leave a comment

About this Entry

This page contains a single entry by mahata published on October 3, 2007 1:55 AM.

めぞん一刻 was the previous entry in this blog.

拡張子が.phpのファイルでxml宣言を記述する方法 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.