On Sat, 25 Mar 2006 09:00:57 +0900, shelarcy <shelarcy@gmail.com> wrote:
I tried to wrote my web diary by HSXML
(I started web diary before blog boom. Web diary is like blog ... but in manycase, web diary isn't cgi or web application system, it is wrote plain html text file. Of cource, many people use generator and web diary based blog system exist now,)
I attatched yestaday's article that name diary.hs .
Oops, I forgot that. This file written in Japanese by euc-jp encode. So if you want to test it, you must chage HSXML_HTML to use Japanese text like this;
html_clean str = all good_char str where -- good_char c | not (isAscii c) = False good_char c | isSpace c = True -- good_char c | not (isPrint c) = False good_char c | c `elem` "<>\"&" = False good_char _ = True
html_encode_char :: Char -> String -- html_encode_char c | not (isAscii c) = error $ "non-ascii character" html_encode_char c | isSpace c = [c] -- html_encode_char c | not (isPrint c) = error $ "non-printable character" html_encode_char '<' = "<" html_encode_char '>' = ">" html_encode_char '"' = """ html_encode_char '&' = "&" html_encode_char c = [c]
Sorry for I posted this message for Haskell mailing list after that message.
Okay. We will move to Cafe for that. After this mail.
-- shelarcy <shelarcy capella.freemail.ne.jp> http://page.freett.com/shelarcy/