Some times ago I thought about how to color my source-codes posted here at Tek-Tips.
The possible way consists of 2 steps:
1. Converting syntax highlighted source into HTML.
2. Translating HTML into TGML.
The 1.step will be done with my editor Vim, which I use for almost all coding.
The 2.step is a task for a scripting language.
I first wrote such a script in Perl, but then I thought: Why not do it in REXX? It would be a good exercise to look at the regular expression supported in ooREXX.
So, I done it and here is the script tek_tips_poster.rex:
Now how it works?
For example I wrote this simple script io.rexx:
Then I convert it into HTML in my editor Vim and save this into the file named io.rexx.htm:
Then I run the script I wrote on the last html-file redirecting the output to a text-file
Then I open the resulting txt-file post.txt copy all from it and paste it here the code-tags.
That's all. It seems a little bit complicated, but it's simple.
The possible way consists of 2 steps:
1. Converting syntax highlighted source into HTML.
2. Translating HTML into TGML.
The 1.step will be done with my editor Vim, which I use for almost all coding.
The 2.step is a task for a scripting language.
I first wrote such a script in Perl, but then I thought: Why not do it in REXX? It would be a good exercise to look at the regular expression supported in ooREXX.
So, I done it and here is the script tek_tips_poster.rex:
Code:
[COLOR=#0000ff]/*****************************************************************************/[/color]
[COLOR=#0000ff]/* Usage example: */[/color]
[COLOR=#0000ff]/* [rexx] tek_tips_poster.rex < matrices.rex.html > post.txt */[/color]
[COLOR=#0000ff]/*****************************************************************************/[/color]
[COLOR=#0000ff]/* define regular expressions for tags which should be skipped */[/color]
re_doc [COLOR=#804040][b]=[/b][/color][COLOR=#ff00ff].RegularExpression[/color][COLOR=#804040][b]~[/b][/color][COLOR=#008080]new[/color][COLOR=#008080]([/color][COLOR=#ff00ff]'<!DOCTYPE HTML?+">'[/color][COLOR=#008080])[/color]
re_html[COLOR=#804040][b]=[/b][/color][COLOR=#ff00ff].RegularExpression[/color][COLOR=#804040][b]~[/b][/color][COLOR=#008080]new[/color][COLOR=#008080]([/color][COLOR=#ff00ff]'<\/*html>'[/color][COLOR=#008080])[/color]
re_head[COLOR=#804040][b]=[/b][/color][COLOR=#ff00ff].RegularExpression[/color][COLOR=#804040][b]~[/b][/color][COLOR=#008080]new[/color][COLOR=#008080]([/color][COLOR=#ff00ff]'<\/*head>'[/color][COLOR=#008080])[/color]
re_title[COLOR=#804040][b]=[/b][/color][COLOR=#ff00ff].RegularExpression[/color][COLOR=#804040][b]~[/b][/color][COLOR=#008080]new[/color][COLOR=#008080]([/color][COLOR=#ff00ff]'<\/*title>?*'[/color][COLOR=#008080])[/color]
re_meta[COLOR=#804040][b]=[/b][/color][COLOR=#ff00ff].RegularExpression[/color][COLOR=#804040][b]~[/b][/color][COLOR=#008080]new[/color][COLOR=#008080]([/color][COLOR=#ff00ff]'<meta?+">'[/color][COLOR=#008080])[/color]
re_body[COLOR=#804040][b]=[/b][/color][COLOR=#ff00ff].RegularExpression[/color][COLOR=#804040][b]~[/b][/color][COLOR=#008080]new[/color][COLOR=#008080]([/color][COLOR=#ff00ff]'?*<\/*body?*>'[/color][COLOR=#008080])[/color]
[COLOR=#0000ff]/* define regular expression for <font color="#804040"> */[/color]
re_font [COLOR=#804040][b]=[/b][/color][COLOR=#ff00ff].RegularExpression[/color][COLOR=#804040][b]~[/b][/color][COLOR=#008080]new[/color][COLOR=#008080]([/color][COLOR=#ff00ff]'<font color="#[:XDIGIT:]+">'[/color][COLOR=#008080])[/color]
[COLOR=#0000ff]/* define regular expression for <span style="background-color: #ffff00"> */[/color]
re_span [COLOR=#804040][b]=[/b][/color][COLOR=#ff00ff].RegularExpression[/color][COLOR=#804040][b]~[/b][/color][COLOR=#008080]new[/color][COLOR=#008080]([/color][COLOR=#ff00ff]'<span style="background-color: #[:XDIGIT:]+">'[/color][COLOR=#008080])[/color]
re_xdigit [COLOR=#804040][b]=[/b][/color][COLOR=#ff00ff].RegularExpression[/color][COLOR=#804040][b]~[/b][/color][COLOR=#008080]new[/color][COLOR=#008080]([/color][COLOR=#ff00ff]'#[:XDIGIT:]+'[/color][COLOR=#008080])[/color]
[COLOR=#804040][b]do[/b][/color][COLOR=#804040][b] while [/b][/color][COLOR=#008080]lines()[/color] [COLOR=#804040][b]\=[/b][/color] 0
[COLOR=#804040][b]parse linein[/b][/color] line
res[COLOR=#804040][b]=[/b][/color]re_doc[COLOR=#804040][b]~[/b][/color][COLOR=#008080]match[/color][COLOR=#008080]([/color]line[COLOR=#008080])[/color] [COLOR=#804040][b]|[/b][/color] re_html[COLOR=#804040][b]~[/b][/color][COLOR=#008080]match[/color][COLOR=#008080]([/color]line[COLOR=#008080])[/color] [COLOR=#804040][b]|[/b][/color] re_head[COLOR=#804040][b]~[/b][/color][COLOR=#008080]match[/color][COLOR=#008080]([/color]line[COLOR=#008080])[/color] [COLOR=#804040][b]|[/b][/color][highlight #ffff00][COLOR=#000000],[/color][/highlight]
re_title[COLOR=#804040][b]~[/b][/color][COLOR=#008080]match[/color][COLOR=#008080]([/color]line[COLOR=#008080])[/color] [COLOR=#804040][b]|[/b][/color] re_meta[COLOR=#804040][b]~[/b][/color][COLOR=#008080]match[/color][COLOR=#008080]([/color]line[COLOR=#008080])[/color] [COLOR=#804040][b]|[/b][/color] re_body[COLOR=#804040][b]~[/b][/color][COLOR=#008080]match[/color][COLOR=#008080]([/color]line[COLOR=#008080])[/color]
[COLOR=#804040][b] if res = 1 then do[/b][/color]
[COLOR=#0000ff]/* skip document definition, header, footer, .. etc */[/color]
[COLOR=#804040][b]iterate[/b][/color]
[COLOR=#804040][b]end[/b][/color]
[COLOR=#0000ff]/* process other lines */[/color]
[COLOR=#804040][b]call[/b][/color][COLOR=#008080] process_line[/color]
[COLOR=#804040][b]end[/b][/color]
[COLOR=#804040][b]exit[/b][/color]
[COLOR=#0000ff]/*************************** Procedures/Functions ****************************/[/color]
[COLOR=#008080]process_line[/color]:
font_not_found [COLOR=#804040][b]=[/b][/color] [COLOR=#ff00ff]'FALSE'[/color]
[COLOR=#0000ff]/* do until <font color="#..."> not found */[/color]
[COLOR=#804040][b]do[/b][/color][COLOR=#804040][b] until [/b][/color]font_not_found [COLOR=#804040][b]=[/b][/color] [COLOR=#ff00ff]'TRUE'[/color]
font_first[COLOR=#804040][b]=[/b][/color]re_font[COLOR=#804040][b]~[/b][/color][COLOR=#008080]pos[/color][COLOR=#008080]([/color]line[COLOR=#008080])[/color] [COLOR=#0000ff]/* first position of <font color="#..."> */[/color]
[COLOR=#804040][b] if font_first > 0 then do[/b][/color]
font_last[COLOR=#804040][b]=[/b][/color]re_font[COLOR=#804040][b]~[/b][/color][COLOR=#008080]position[/color] [COLOR=#0000ff]/* last position of <font color="#..."> */[/color]
[COLOR=#0000ff]/* extract font_str substring from line */[/color]
len [COLOR=#804040][b]=[/b][/color] font_last [COLOR=#804040][b]-[/b][/color] font_first [COLOR=#804040][b]+[/b][/color] 1
font_str[COLOR=#804040][b]=[/b][/color][COLOR=#008080]substr([/color]line[COLOR=#804040][b],[/b][/color] font_first[COLOR=#804040][b],[/b][/color] len[COLOR=#008080])[/color]
[COLOR=#0000ff]/* extract xdigit substring from font_str */[/color]
xdigit_first [COLOR=#804040][b]=[/b][/color] re_xdigit[COLOR=#804040][b]~[/b][/color][COLOR=#008080]pos[/color][COLOR=#008080]([/color]font_str[COLOR=#008080])[/color] [COLOR=#0000ff]/* first position of xdigit */[/color]
[COLOR=#804040][b] if xdigit_first > 0 then do[/b][/color]
xdigit_last [COLOR=#804040][b]=[/b][/color] re_xdigit[COLOR=#804040][b]~[/b][/color][COLOR=#008080]position[/color] [COLOR=#0000ff]/* last position of xdigit */[/color]
len [COLOR=#804040][b]=[/b][/color] xdigit_last [COLOR=#804040][b]-[/b][/color] xdigit_first [COLOR=#804040][b]+[/b][/color] 1
xdigit_str[COLOR=#804040][b]=[/b][/color][COLOR=#008080]substr([/color]font_str[COLOR=#804040][b],[/b][/color] xdigit_first[COLOR=#804040][b],[/b][/color] len[COLOR=#008080])[/color]
[COLOR=#0000ff]/* construct new_font_str for replacing */[/color]
new_font_str [COLOR=#804040][b]=[/b][/color] [COLOR=#ff00ff]"[COLOR="[/color][COLOR=#804040][b]||[/b][/color]xdigit_str[COLOR=#804040][b]||[/b][/color][COLOR=#ff00ff]"]"[/color]
[COLOR=#0000ff]/* replace <font color="#..."> with [COLOR=#...] */[/color]
line[COLOR=#804040][b]=[/b][/color][COLOR=#008080]changestr([/color]font_str[COLOR=#804040][b],[/b][/color] line[COLOR=#804040][b],[/b][/color] new_font_str[COLOR=#008080])[/color]
[COLOR=#804040][b]end[/b][/color]
[COLOR=#804040][b]end[/b][/color]
[COLOR=#804040][b] else [/b][/color]do
[COLOR=#0000ff]/* no more <font color="#..."> in the line */[/color]
font_not_found [COLOR=#804040][b]=[/b][/color] [COLOR=#ff00ff]'TRUE'[/color]
[COLOR=#804040][b]end[/b][/color]
[COLOR=#804040][b]end[/b][/color] [COLOR=#0000ff]/* do until */[/color]
span_not_found [COLOR=#804040][b]=[/b][/color] [COLOR=#ff00ff]'FALSE'[/color]
[COLOR=#0000ff]/* do until <span style="background-color: #..."> not found */[/color]
[COLOR=#804040][b]do[/b][/color][COLOR=#804040][b] until [/b][/color]span_not_found [COLOR=#804040][b]=[/b][/color] [COLOR=#ff00ff]'TRUE'[/color]
span_first[COLOR=#804040][b]=[/b][/color]re_span[COLOR=#804040][b]~[/b][/color][COLOR=#008080]pos[/color][COLOR=#008080]([/color]line[COLOR=#008080])[/color] [COLOR=#0000ff]/* first position of <span style="..."> */[/color]
[COLOR=#804040][b] if span_first > 0 then do[/b][/color]
span_last[COLOR=#804040][b]=[/b][/color]re_span[COLOR=#804040][b]~[/b][/color][COLOR=#008080]position[/color] [COLOR=#0000ff]/* last position of <span style="..."> */[/color]
[COLOR=#0000ff]/* extract span_str substring from line */[/color]
len [COLOR=#804040][b]=[/b][/color] span_last [COLOR=#804040][b]-[/b][/color] span_first [COLOR=#804040][b]+[/b][/color] 1
span_str[COLOR=#804040][b]=[/b][/color][COLOR=#008080]substr([/color]line[COLOR=#804040][b],[/b][/color] span_first[COLOR=#804040][b],[/b][/color] len[COLOR=#008080])[/color]
[COLOR=#0000ff]/* extract xdigit substring from span_str */[/color]
xdigit_first [COLOR=#804040][b]=[/b][/color] re_xdigit[COLOR=#804040][b]~[/b][/color][COLOR=#008080]pos[/color][COLOR=#008080]([/color]span_str[COLOR=#008080])[/color] [COLOR=#0000ff]/* first position of xdigit */[/color]
[COLOR=#804040][b] if xdigit_first > 0 then do[/b][/color]
xdigit_last [COLOR=#804040][b]=[/b][/color] re_xdigit[COLOR=#804040][b]~[/b][/color][COLOR=#008080]position[/color] [COLOR=#0000ff]/* last position of xdigit */[/color]
len [COLOR=#804040][b]=[/b][/color] xdigit_last [COLOR=#804040][b]-[/b][/color] xdigit_first [COLOR=#804040][b]+[/b][/color] 1
xdigit_str[COLOR=#804040][b]=[/b][/color][COLOR=#008080]substr([/color]span_str[COLOR=#804040][b],[/b][/color] xdigit_first[COLOR=#804040][b],[/b][/color] len[COLOR=#008080])[/color]
[COLOR=#0000ff]/* construct new_span_str for replacing */[/color]
new_span_str [COLOR=#804040][b]=[/b][/color] [COLOR=#ff00ff]"[highlight "[/color][COLOR=#804040][b]||[/b][/color]xdigit_str[COLOR=#804040][b]||[/b][/color][COLOR=#ff00ff]"]"[/color]
[COLOR=#0000ff]/* replace <span style="background-color: #..."> with [COLOR=#...] */[/color]
line[COLOR=#804040][b]=[/b][/color][COLOR=#008080]changestr([/color]span_str[COLOR=#804040][b],[/b][/color] line[COLOR=#804040][b],[/b][/color] new_span_str[COLOR=#008080])[/color]
[COLOR=#804040][b]end[/b][/color]
[COLOR=#804040][b]end[/b][/color]
[COLOR=#804040][b] else [/b][/color]do
[COLOR=#0000ff]/* no more <span style="..."> in the line */[/color]
span_not_found [COLOR=#804040][b]=[/b][/color] [COLOR=#ff00ff]'TRUE'[/color]
[COLOR=#804040][b]end[/b][/color]
[COLOR=#804040][b]end[/b][/color] [COLOR=#0000ff]/* do until */[/color]
[COLOR=#0000ff]/* replace strings */[/color]
line[COLOR=#804040][b]=[/b][/color][COLOR=#008080]changestr([/color][COLOR=#ff00ff]'</font>'[/color][COLOR=#804040][b],[/b][/color] line[COLOR=#804040][b],[/b][/color] [COLOR=#ff00ff]'[/color]'[/color][COLOR=#008080])[/color]
line[COLOR=#804040][b]=[/b][/color][COLOR=#008080]changestr([/color][COLOR=#ff00ff]'</span>'[/color][COLOR=#804040][b],[/b][/color] line[COLOR=#804040][b],[/b][/color] [COLOR=#ff00ff]'[/highlight]'[/color][COLOR=#008080])[/color]
line[COLOR=#804040][b]=[/b][/color][COLOR=#008080]changestr([/color][COLOR=#ff00ff]'<b>'[/color][COLOR=#804040][b],[/b][/color] line[COLOR=#804040][b],[/b][/color] [COLOR=#ff00ff]'[b]'[/color][COLOR=#008080])[/color]
line[COLOR=#804040][b]=[/b][/color][COLOR=#008080]changestr([/color][COLOR=#ff00ff]'</b>'[/color][COLOR=#804040][b],[/b][/color] line[COLOR=#804040][b],[/b][/color] [COLOR=#ff00ff]'[/b]'[/color][COLOR=#008080])[/color]
line[COLOR=#804040][b]=[/b][/color][COLOR=#008080]changestr([/color][COLOR=#ff00ff]' '[/color][COLOR=#804040][b],[/b][/color] line[COLOR=#804040][b],[/b][/color] [COLOR=#ff00ff]' '[/color][COLOR=#008080])[/color]
line[COLOR=#804040][b]=[/b][/color][COLOR=#008080]changestr([/color][COLOR=#ff00ff]'<br>'[/color][COLOR=#804040][b],[/b][/color] line[COLOR=#804040][b],[/b][/color] [COLOR=#ff00ff]''[/color][COLOR=#008080])[/color]
line[COLOR=#804040][b]=[/b][/color][COLOR=#008080]changestr([/color][COLOR=#ff00ff]'"'[/color][COLOR=#804040][b],[/b][/color] line[COLOR=#804040][b],[/b][/color] [COLOR=#ff00ff]'"'[/color][COLOR=#008080])[/color]
line[COLOR=#804040][b]=[/b][/color][COLOR=#008080]changestr([/color][COLOR=#ff00ff]'<'[/color][COLOR=#804040][b],[/b][/color] line[COLOR=#804040][b],[/b][/color] [COLOR=#ff00ff]'<'[/color][COLOR=#008080])[/color]
line[COLOR=#804040][b]=[/b][/color][COLOR=#008080]changestr([/color][COLOR=#ff00ff]'>'[/color][COLOR=#804040][b],[/b][/color] line[COLOR=#804040][b],[/b][/color] [COLOR=#ff00ff]'>'[/color][COLOR=#008080])[/color]
line[COLOR=#804040][b]=[/b][/color][COLOR=#008080]changestr([/color][COLOR=#ff00ff]'&'[/color][COLOR=#804040][b],[/b][/color] line[COLOR=#804040][b],[/b][/color] [COLOR=#ff00ff]'&'[/color][COLOR=#008080])[/color]
[COLOR=#804040][b]say[/b][/color] line
[COLOR=#804040][b]return[/b][/color]
[COLOR=#0000ff]/****************************** Required Packages ****************************/[/color]
[COLOR=#804040][b]::requires [/b][/color][COLOR=#a020f0]"rxregexp.cls"[/color]
Now how it works?
For example I wrote this simple script io.rexx:
Code:
[COLOR=#804040][b]do[/b][/color][COLOR=#804040][b] while [/b][/color][COLOR=#008080]lines()[/color] [COLOR=#804040][b]\=[/b][/color] 0
[COLOR=#804040][b]parse linein[/b][/color] line
[COLOR=#804040][b]say[/b][/color] line
[COLOR=#804040][b]end[/b][/color]
[COLOR=#804040][b]exit[/b][/color]
Then I convert it into HTML in my editor Vim and save this into the file named io.rexx.htm:
Code:
[COLOR=#0000ff]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "<a href="[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">http://www.w3.org/TR/html4/loose.dtd</a>">[/URL][/color]
[COLOR=#008080]<[/color][COLOR=#804040][b]html[/b][/color][COLOR=#008080]>[/color]
[COLOR=#008080]<[/color][COLOR=#804040][b]head[/b][/color][COLOR=#008080]>[/color]
[COLOR=#008080]<[/color][COLOR=#804040][b]title[/b][/color][COLOR=#008080]>[/color][COLOR=#ff00ff][b]~\Work\io.rex.html[/b][/color][COLOR=#008080]</[/color][COLOR=#804040][b]title[/b][/color][COLOR=#008080]>[/color]
[COLOR=#008080]<[/color][COLOR=#804040][b]meta[/b][/color][COLOR=#008080] [/color][COLOR=#2e8b57][b]name[/b][/color][COLOR=#008080]=[/color][COLOR=#ff00ff]"Generator"[/color][COLOR=#008080] [/color][COLOR=#2e8b57][b]content[/b][/color][COLOR=#008080]=[/color][COLOR=#ff00ff]"Vim/7.1"[/color][COLOR=#008080]>[/color]
[COLOR=#008080]<[/color][COLOR=#804040][b]meta[/b][/color][COLOR=#008080] [/color][COLOR=#2e8b57][b]http-equiv[/b][/color][COLOR=#008080]=[/color][COLOR=#ff00ff]"content-type"[/color][COLOR=#008080] [/color][COLOR=#2e8b57][b]content[/b][/color][COLOR=#008080]=[/color][COLOR=#ff00ff]"text/html; charset=windows-1250"[/color][COLOR=#008080]>[/color]
[COLOR=#008080]</[/color][COLOR=#804040][b]head[/b][/color][COLOR=#008080]>[/color]
[COLOR=#008080]<[/color][COLOR=#804040][b]body[/b][/color][COLOR=#008080] [/color][COLOR=#2e8b57][b]bgcolor[/b][/color][COLOR=#008080]=[/color][COLOR=#ff00ff]"#ffffff"[/color][COLOR=#008080] [/color][COLOR=#2e8b57][b]text[/b][/color][COLOR=#008080]=[/color][COLOR=#ff00ff]"#000000"[/color][COLOR=#008080]><[/color][COLOR=#804040][b]font[/b][/color][COLOR=#008080] [/color][COLOR=#2e8b57][b]face[/b][/color][COLOR=#008080]=[/color][COLOR=#ff00ff]"monospace"[/color][COLOR=#008080]>[/color]
[COLOR=#008080]<[/color][COLOR=#804040][b]font[/b][/color][COLOR=#008080] [/color][COLOR=#2e8b57][b]color[/b][/color][COLOR=#008080]=[/color][COLOR=#ff00ff]"#804040"[/color][COLOR=#008080]><[/color][COLOR=#804040][b]b[/b][/color][COLOR=#008080]>[/color][b]do[/b][COLOR=#008080]</[/color][COLOR=#804040][b]b[/b][/color][COLOR=#008080]></[/color][COLOR=#804040][b]font[/b][/color][COLOR=#008080]>[/color][COLOR=#008080]<[/color][COLOR=#804040][b]font[/b][/color][COLOR=#008080] [/color][COLOR=#2e8b57][b]color[/b][/color][COLOR=#008080]=[/color][COLOR=#ff00ff]"#804040"[/color][COLOR=#008080]><[/color][COLOR=#804040][b]b[/b][/color][COLOR=#008080]>[/color][COLOR=#6a5acd] [/color][b]while [/b][COLOR=#008080]</[/color][COLOR=#804040][b]b[/b][/color][COLOR=#008080]></[/color][COLOR=#804040][b]font[/b][/color][COLOR=#008080]>[/color][COLOR=#008080]<[/color][COLOR=#804040][b]font[/b][/color][COLOR=#008080] [/color][COLOR=#2e8b57][b]color[/b][/color][COLOR=#008080]=[/color][COLOR=#ff00ff]"#008080"[/color][COLOR=#008080]>[/color]lines()[COLOR=#008080]</[/color][COLOR=#804040][b]font[/b][/color][COLOR=#008080]>[/color][COLOR=#6a5acd] [/color][COLOR=#008080]<[/color][COLOR=#804040][b]font[/b][/color][COLOR=#008080] [/color][COLOR=#2e8b57][b]color[/b][/color][COLOR=#008080]=[/color][COLOR=#ff00ff]"#804040"[/color][COLOR=#008080]><[/color][COLOR=#804040][b]b[/b][/color][COLOR=#008080]>[/color][b]\=[/b][COLOR=#008080]</[/color][COLOR=#804040][b]b[/b][/color][COLOR=#008080]></[/color][COLOR=#804040][b]font[/b][/color][COLOR=#008080]>[/color][COLOR=#6a5acd] [/color]0[COLOR=#008080]<[/color][COLOR=#804040][b]br[/b][/color][COLOR=#008080]>[/color]
[COLOR=#6a5acd] [/color][COLOR=#008080]<[/color][COLOR=#804040][b]font[/b][/color][COLOR=#008080] [/color][COLOR=#2e8b57][b]color[/b][/color][COLOR=#008080]=[/color][COLOR=#ff00ff]"#804040"[/color][COLOR=#008080]><[/color][COLOR=#804040][b]b[/b][/color][COLOR=#008080]>[/color][b]parse linein[/b][COLOR=#008080]</[/color][COLOR=#804040][b]b[/b][/color][COLOR=#008080]></[/color][COLOR=#804040][b]font[/b][/color][COLOR=#008080]>[/color][COLOR=#6a5acd] [/color]line[COLOR=#008080]<[/color][COLOR=#804040][b]br[/b][/color][COLOR=#008080]>[/color]
[COLOR=#6a5acd] [/color][COLOR=#008080]<[/color][COLOR=#804040][b]font[/b][/color][COLOR=#008080] [/color][COLOR=#2e8b57][b]color[/b][/color][COLOR=#008080]=[/color][COLOR=#ff00ff]"#804040"[/color][COLOR=#008080]><[/color][COLOR=#804040][b]b[/b][/color][COLOR=#008080]>[/color][b]say[/b][COLOR=#008080]</[/color][COLOR=#804040][b]b[/b][/color][COLOR=#008080]></[/color][COLOR=#804040][b]font[/b][/color][COLOR=#008080]>[/color][COLOR=#6a5acd] [/color]line[COLOR=#008080]<[/color][COLOR=#804040][b]br[/b][/color][COLOR=#008080]>[/color]
[COLOR=#008080]<[/color][COLOR=#804040][b]font[/b][/color][COLOR=#008080] [/color][COLOR=#2e8b57][b]color[/b][/color][COLOR=#008080]=[/color][COLOR=#ff00ff]"#804040"[/color][COLOR=#008080]><[/color][COLOR=#804040][b]b[/b][/color][COLOR=#008080]>[/color][b]end[/b][COLOR=#008080]</[/color][COLOR=#804040][b]b[/b][/color][COLOR=#008080]></[/color][COLOR=#804040][b]font[/b][/color][COLOR=#008080]>[/color][COLOR=#008080]<[/color][COLOR=#804040][b]br[/b][/color][COLOR=#008080]>[/color]
[COLOR=#008080]<[/color][COLOR=#804040][b]font[/b][/color][COLOR=#008080] [/color][COLOR=#2e8b57][b]color[/b][/color][COLOR=#008080]=[/color][COLOR=#ff00ff]"#804040"[/color][COLOR=#008080]><[/color][COLOR=#804040][b]b[/b][/color][COLOR=#008080]>[/color][b]exit[/b][COLOR=#008080]</[/color][COLOR=#804040][b]b[/b][/color][COLOR=#008080]></[/color][COLOR=#804040][b]font[/b][/color][COLOR=#008080]>[/color][COLOR=#008080]<[/color][COLOR=#804040][b]br[/b][/color][COLOR=#008080]>[/color]
[COLOR=#008080]</[/color][COLOR=#804040][b]font[/b][/color][COLOR=#008080]></[/color][COLOR=#804040][b]body[/b][/color][COLOR=#008080]>[/color]
[COLOR=#008080]</[/color][COLOR=#804040][b]html[/b][/color][COLOR=#008080]>[/color]
Then I run the script I wrote on the last html-file redirecting the output to a text-file
Code:
tek_tips_poster.rex < io.rex.html > post.txt
Then I open the resulting txt-file post.txt copy all from it and paste it here the code-tags.
That's all. It seems a little bit complicated, but it's simple.