For example, you can't post this html directly into your blog:
<html>
<head>
<title>XLam</title>
</head>
<body>
<script language='javascript' src='xqx.web.xlam.XLam.nocache.js'></script>
<div id='uid'></div>
</body>
</html>
but you can convert it into this format:
<html>
<head>
<title>XLam</title>
</head>
<body>
<script language='javascript' src='xqx.web.xlam.XLam.nocache.js'></script>
<div id='uid'></div>
</body>
</html>
and then successfully publish it.
For this purpose, bloggers may use this script:
#!/bin/bash
#This simple shell script replaces symbols in the given xml/html file and writes it to file file.blog
#Symbols to replace:
# '<' with <
# '>' with >
# '&' with &
#
#Usage: html2blog.sh file
sed -e 's/\x26/\&/g;s/\x3c/\</g;s/\x3e/\>/g' $1 >$1.blog
It works on Linux/Unix platforms or under Cygwin environment.
No comments:
Post a Comment