Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1.  
  2. /*=============================================================================
  3.    GNU UnRTF, a command-line program to convert RTF documents to other formats.
  4.    Copyright (C) 2000,2001 Zachary Thayer Smith
  5.  
  6.    This program is free software; you can redistribute it and/or modify
  7.    it under the terms of the GNU General Public License as published by
  8.    the Free Software Foundation; either version 2 of the License, or
  9.    (at your option) any later version.
  10.  
  11.    This program is distributed in the hope that it will be useful,
  12.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.    GNU General Public License for more details.
  15.  
  16.    You should have received a copy of the GNU General Public License
  17.    along with this program; if not, write to the Free Software
  18.    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  19.  
  20.    The author is reachable by electronic mail at tuorfa@yahoo.com.
  21. =============================================================================*/
  22.  
  23.  
  24. /*----------------------------------------------------------------------
  25.  * Module name:    html
  26.  * Author name:    Zach Smith
  27.  * Create date:    18 Sep 01
  28.  * Purpose:        HTML-specific output module
  29.  *----------------------------------------------------------------------
  30.  * Changes:
  31.  * 01 Aug 01, tuorfa@yahoo.com: code moved over from convert.c
  32.  * 03 Aug 01, tuorfa@yahoo.com: removed null entries to save space
  33.  * 08 Aug 01, tuorfa@yahoo.com, gommer@gmx.net: fixed/added some ANSI chars
  34.  * 18 Sep 01, tuorfa@yahoo.com: moved character sets into html.c etc
  35.  * 22 Sep 01, tuorfa@yahoo.com: added function-level comment blocks
  36.  *--------------------------------------------------------------------*/
  37.  
  38.  
  39. #include <stdio.h>
  40. #include <string.h>
  41. #include "malloc.h"
  42. #include "defs.h"
  43. #include "error.h"
  44. #include "main.h"
  45. #include "output.h"
  46.  
  47.  
  48. static char* ascii [96] = {
  49.         /* 0x20 */ " ", "!", "\"", "#", "$", "%", "&amp;", "'",
  50.         /* 0x28 */ "(", ")", "*", "+", ",", "-", ".", "/",
  51.         /* 0x30 */ "0", "1", "2", "3", "4", "5", "6", "7",
  52.         /* 0x38 */ "8", "9", ":", ";", "&lt;", "=", "&gt;", "?",
  53.         /* 0x40 */ "@", "A", "B", "C", "D", "E", "F", "G",
  54.         /* 0x48 */ "H", "I", "J", "K", "L", "M", "N", "O",
  55.         /* 0x50 */ "P", "Q", "R", "S", "T", "U", "V", "W",
  56.         /* 0x58 */ "X", "Y", "Z", "[", "\\", "]", "^", "_",
  57.         /* 0x60 */ "`", "a", "b", "c", "d", "e", "f", "g",
  58.         /* 0x68 */ "h", "i", "j", "k", "l", "m", "n", "o",
  59.         /* 0x70 */ "p", "q", "r", "s", "t", "u", "v", "w",
  60.         /* 0x78 */ "x", "y", "z", "{", "|", "}", "~", "",
  61. };
  62.  
  63.  
  64. static char* ansi [] = {
  65. /* 0x82 */ "&lsquor;", "&fnof;",
  66.         "&ldquor;", "&hellip;", "&dagger;", "&Dagger;",
  67.         "&circ;", "&permil;", "&Scaron;", "&lsaquo;",
  68.         "&OElig;", NULL, NULL, NULL,
  69. /* 0x90 */ NULL,"`","'","``","''","&bull;","&ndash;","&mdash;",
  70. /* 0x98 */ NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
  71. /* 0xa0 */ "&nbsp;","&iexcl;","&cent;","&pound;","&curren;","&yen;","&brvbar;","&sect;",
  72. /* 0xa8 */ "&uml;","&copy;","&ordf;","&laquo;","&not;","&shy;","&reg;","&macr;",
  73. /* 0xb0 */ "&deg;", "&plusmn;","&sup2;","&sup3;","&acute;","&micro;","&para;","&middot;",
  74. /* 0xb8 */ "&cedil;","&sup1", "&ordm;","&raquo", "&frac14", "&frac12;","&frac34;","&iquest;",
  75. /* 0xc0 */ "&Agrave;","&Aacute;","&Acirc;","&Atilde;","&Auml;","&Aring;","&AElig;","&Ccedil;",
  76. /* 0xc8 */ "&Egrave;","&Eacute;","&Ecirc;","&Euml;","&Igrave;","&Iacute;","&Icirc;","&Iuml;",
  77. /* 0xd0 */ "&ETH;","&Ntilde;","&Ograve;","&Oacute;","&Ocirc;","&Otilde;","&Ouml;","&times;",
  78. /* 0xd8 */ "&Oslash;","&Ugrave;","&Uacute;","&Ucirc;","&Uuml;","&Yacute;","&THORN;","&szlig;",
  79. /* 0xe0 */ "&agrave;","&aacute;","&acirc;","&atilde;","&auml;","&aring;","&aelig;","&ccedil;",
  80. /* 0xe8 */ "&egrave;","&eacute;","&ecirc;","&euml;","&igrave;","&iacute;","&icirc;","&iuml;",
  81. /* 0xf0 */ "&eth;","&ntilde;","&ograve;","&oacute;","&ocirc;","&otilde;","&ouml;","&divide;",
  82. /* 0xf8 */ "&oslash;","&ugrave;","&uacute;","&ucirc;","&uuml;","&yacute;","&thorn;","&yuml;",
  83. };
  84.  
  85. static char* mac [] = {
  86. /* 0xa4 */ "&bull;", NULL,NULL,NULL,NULL,NULL,NULL,NULL,
  87. /* 0xb0 */ NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
  88. /* 0xc0 */ NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
  89. /* 0xd0 */ "&mdash;","&ndash;","&ldquo;","&rdquo;","&lquo;","&rquo;",
  90. };
  91.  
  92. static char* cp437 [] = {
  93. /* 0x80 */ "&ccedil;",
  94. /* 0x81 */ "&uuml;",
  95. /* 0x82 */ "&eacute;",
  96. /* 0x83 */ "&acirc;",
  97. /* 0x84 */ "&auml;",
  98. /* 0x85 */ "&agrave;",
  99. /* 0x86 */ "&aring;",
  100. /* 0x87 */ "&ccedil;",
  101. /* 0x88 */ "&ecirc;",
  102. /* 0x89 */ "&euml;",
  103. /* 0x8a */ "&egrave;",
  104. /* 0x8b */ "&iuml;",
  105. /* 0x8c */ "&icirc;",
  106. /* 0x8d */ "&igrave;",
  107. /* 0x8e */ "&auml;",
  108. /* 0x8f */ "&aring;",
  109. /* 0x90 */ "&eacute;",
  110. /* 0x91 */ "&aelig;",
  111. /* 0x92 */ "&aelig;",
  112. /* 0x93 */ "&ocirc;",
  113. /* 0x94 */ "&ouml;",
  114. /* 0x95 */ "&ograve;",
  115. /* 0x96 */ "&ucirc;",
  116. /* 0x97 */ "&ugrave;",
  117. /* 0x98 */ "&yuml;",
  118. /* 0x99 */ "&ouml;",
  119. /* 0x9a */ "&uuml;",
  120. /* 0x9b */ "&cent;",
  121. /* 0x9c */ "&pound;",
  122. /* 0x9d */ "&yen;",
  123. /* 0x9e */ "&#8359", /* peseta */
  124. /* 0x9f */ "&#402", /* small f with hook */
  125. /* 0xa0 */ "&aacute;",
  126. /* 0xa1 */ "&iacute;",
  127. /* 0xa2 */ "&oacute;",
  128. /* 0xa3 */ "&uacute;",
  129. /* 0xa4 */ "&ntilde;",
  130. /* 0xa5 */ "&ntilde;",
  131. /* 0xa6 */ "&ordf;",
  132. /* 0xa7 */ "&frac14;",
  133. /* 0xa8 */ "&iquest;",
  134. /* 0xa9 */ "&#8976", /* reversed not */
  135. /* 0xaa */ "&not;",
  136. /* 0xab */ "&frac12;",
  137. /* 0xac */ "&raquo;",
  138. /* 0xad */ "&iexcl;",
  139. /* 0xae */ "&laquo;",
  140. /* 0xaf */ "&ordm;",
  141. /* 0xb0 */ "&#9617;", /* light shade */
  142. /* 0xb1 */ "&#9618;", /* med. shade */
  143. /* 0xb2 */ "&#9619;", /* dark shade */
  144. /* 0xb3 */ "&#9474;", /* box-draw light vert. */
  145. /* 0xb4 */ "&#9508;", /* box-draw light vert. + lt. */
  146. /* 0xb5 */ "&#9569;", /* box-draw vert. sgl. + lt. dbl. */
  147. /* 0xb6 */ "&#9570;", /* box-draw vert. dbl. + lt. sgl. */
  148. /* 0xb7 */ "&#9558;", /* box-draw dn. dbl. + lt. sgl. */
  149. /* 0xb8 */ "&#9557;", /* box-draw dn. sgl. + lt. dbl. */
  150. /* 0xb9 */ "&#9571;", /* box-draw dbl. vert. + lt. */
  151. /* 0xba */ "&#9553;", /* box-draw dbl. vert. */
  152. /* 0xbb */ "&#9559;", /* box-draw dbl. dn. + lt. */
  153. /* 0xbc */ "&#9565;", /* box-draw dbl. up + lt. */
  154. /* 0xbd */ "&#9564;", /* box-draw up dbl. + lt. sgl. */
  155. /* 0xbe */ "&#9563;", /* box-draw up sgl. + lt. dbl. */
  156. /* 0xbf */ "&#9488;", /* box-draw light dn. + lt. */
  157. /* 0xc0 */ "&#9492;", /* box-draw light up + rt. */
  158. /* 0xc1 */ "&#9524;", /* box-draw light up + horiz. */
  159. /* 0xc2 */ "&#9516;", /* box-draw light dn. + horiz. */
  160. /* 0xc3 */ "&#9500;", /* box-draw light vert. + rt. */
  161. /* 0xc4 */ "&#9472;", /* box-draw light horiz. */
  162. /* 0xc5 */ "&#9532;", /* box-draw light vert. + horiz. */
  163. /* 0xc6 */ "&#9566;", /* box-draw vert. sgl. + rt. dbl. */
  164. /* 0xc7 */ "&#9567;", /* box-draw vert. dbl. + rt. sgl. */
  165. /* 0xc8 */ "&#9562;", /* box-draw dbl. up + rt. */
  166. /* 0xc9 */ "&#9556;", /* box-draw dbl. dn. + rt. */
  167. /* 0xca */ "&#9577;", /* box-draw dbl. up + horiz. */
  168. /* 0xcb */ "&#9574;", /* box-draw dbl. dn. + horiz. */
  169. /* 0xcc */ "&#9568;", /* box-draw dbl. vert. + rt. */
  170. /* 0xcd */ "&#9552;", /* box-draw dbl. horiz. */
  171. /* 0xce */ "&#9580;", /* box-draw dbl. vert. + horiz. */
  172. /* 0xcf */ "&#9575;", /* box-draw up sgl. + horiz. dbl. */
  173. /* 0xd0 */ "&#9576;", /* box-draw up dbl. + horiz. sgl. */
  174. /* 0xd1 */ "&#9572;", /* box-draw dn. sgl. + horiz. dbl. */
  175. /* 0xd2 */ "&#9573;", /* box-draw dn. dbl. + horiz. sgl. */
  176. /* 0xd3 */ "&#9561;", /* box-draw up dbl. + rt. sgl. */
  177. /* 0xd4 */ "&#9560;", /* box-draw up sgl. + rt. dbl. */
  178. /* 0xd5 */ "&#9554;", /* box-draw dn. sgl. + rt. dbl. */
  179. /* 0xd6 */ "&#9555;", /* box-draw dn. dbl. + rt. sgl. */
  180. /* 0xd7 */ "&#9579;", /* box-draw vert. dbl. + horiz. sgl. */
  181. /* 0xd8 */ "&#9578;", /* box-draw vert. sgl. + horiz. dbl. */
  182. /* 0xd9 */ "&#9496;", /* box-draw light up + lt. */
  183. /* 0xda */ "&#9484;", /* box-draw light dn. + rt. */
  184. /* 0xdb */ "&#9608;", /* full block */
  185. /* 0xdc */ "&#9604;", /* lower 1/2 block */
  186. /* 0xdd */ "&#9612;", /* lt. 1/2 block */
  187. /* 0xde */ "&#9616;", /* rt. 1/2 block */
  188. /* 0xdf */ "&#9600;", /* upper 1/2 block */
  189. /* 0xe0 */ "&#945;", /* greek small alpha */
  190. /* 0xe1 */ "&szlig;",
  191. /* 0xe2 */ "&#915;", /* greek cap gamma */
  192. /* 0xe3 */ "&#960;", /* greek small pi */
  193. /* 0xe4 */ "&#931;", /* greek cap sigma */
  194. /* 0xe5 */ "&#963;", /* greek small sigma */
  195. /* 0xe6 */ "&micro;",
  196. /* 0xe7 */ "&#964;", /* greek small tau */
  197. /* 0xe8 */ "&#934;", /* greek cap phi */
  198. /* 0xe9 */ "&#920;", /* greek cap theta */
  199. /* 0xea */ "&#937;", /* greek cap omega */
  200. /* 0xeb */ "&#948;", /* greek small delta */
  201. /* 0xec */ "&#8734;", /* inf. */
  202. /* 0xed */ "&#966;", /* greek small phi */
  203. /* 0xee */ "&#949;", /* greek small epsilon */
  204. /* 0xef */ "&#8745;", /* intersect */
  205. /* 0xf0 */ "&#8801;", /* identical */
  206. /* 0xf1 */ "&plusmn;",
  207. /* 0xf2 */ "&#8805;", /* greater-than or equal to */
  208. /* 0xf3 */ "&#8804;", /* less-than or equal to */
  209. /* 0xf4 */ "&#8992;", /* top 1/2 integral */
  210. /* 0xf5 */ "&#8993;", /* bottom 1/2 integral */
  211. /* 0xf6 */ "&divide;",
  212. /* 0xf7 */ "&#8776;", /* almost = */
  213. /* 0xf8 */ "&plus;",
  214. /* 0xf9 */ "&#8729;", /* bullet op */
  215. /* 0xfa */ "&middot;",
  216. /* 0xfb */ "&#8730;", /* sqrt */
  217. /* 0xfc */ "&#8319;", /* super-script small n */
  218. /* 0xfd */ "&sup2;",
  219. /* 0xfe */ "&#9632;", /* black square */
  220. /* 0xff */ "&nbsp;",
  221. };
  222.  
  223. static char* cp850 [] = {
  224. /* 0x80 */  "&ccedil;",
  225. /* 0x81 */  "&uuml;",
  226. /* 0x82 */  "&eacute;",
  227. /* 0x83 */  "&acirc;",
  228. /* 0x84 */  "&auml;",
  229. /* 0x85 */  "&agrave;",
  230. /* 0x86 */  "&aring;",
  231. /* 0x87 */  "&ccedil;",
  232. /* 0x88 */  "&ecirc;",
  233. /* 0x89 */  "&euml;",
  234. /* 0x8a */  "&egrave;",
  235. /* 0x8b */  "&iuml;",
  236. /* 0x8c */  "&icirc;",
  237. /* 0x8d */  "&igrave;",
  238. /* 0x8e */  "&auml;",
  239. /* 0x8f */  "&aring;",
  240. /* 0x90 */  "&eacute;",
  241. /* 0x91 */  "&aelig;",
  242. /* 0x92 */  "&aelig;",
  243. /* 0x93 */  "&ocirc;",
  244. /* 0x94 */  "&ouml;",
  245. /* 0x95 */  "&ograve;",
  246. /* 0x96 */  "&ucirc;",
  247. /* 0x97 */  "&ugrave;",
  248. /* 0x98 */  "&yuml;",
  249. /* 0x99 */  "&ouml;",
  250. /* 0x9a */  "&uuml;",
  251. /* 0x9b */  "&oslash;",
  252. /* 0x9c */  "&pound;",
  253. /* 0x9d */  "&oslash;",
  254. /* 0x9e */  "&times;",
  255. /* 0x9f */  "&#402;", /* small f with hook */
  256. /* 0xa0 */  "&aacute;",
  257. /* 0xa1 */  "&iacute;",
  258. /* 0xa2 */  "&oacute;",
  259. /* 0xa3 */  "&uacute;",
  260. /* 0xa4 */  "&ntilde;",
  261. /* 0xa5 */  "&ntilde;",
  262. /* 0xa6 */  "&ordf;",
  263. /* 0xa7 */  "&frac14;",
  264. /* 0xa8 */  "&iquest;",
  265. /* 0xa9 */  "&reg;",
  266. /* 0xaa */  "&not;",
  267. /* 0xab */  "&frac12;",
  268. /* 0xac */  "&raquo;",
  269. /* 0xad */  "&iexcl;",
  270. /* 0xae */  "&laquo;",
  271. /* 0xaf */  "&ordm;",
  272. /* 0xb0 */  "&#9617;", /* light shade */
  273. /* 0xb1 */  "&#9618;", /* med. shade */
  274. /* 0xb2 */  "&#9619;", /* dark shade */
  275. /* 0xb3 */  "&#9474;", /* box-draw light vert. */
  276. /* 0xb4 */  "&#9508;", /* box-draw light vert. + lt. */
  277. /* 0xb5 */  "&aacute;",
  278. /* 0xb6 */  "&acirc;",
  279. /* 0xb7 */  "&agrave;",
  280. /* 0xb8 */  "&copy;",
  281. /* 0xb9 */  "&#9571;", /* box-draw dbl. vert. + lt. */
  282. /* 0xba */  "&#9553;", /* box-draw dbl. vert. */
  283. /* 0xbb */  "&#9559;", /* box-draw dbl. dn. + lt. */
  284. /* 0xbc */  "&#9565;", /* box-draw dbl. up + lt. */
  285. /* 0xbd */  "&cent;",
  286. /* 0xbe */  "&yen;",
  287. /* 0xbf */  "&#9488;", /* box-draw light dn. + lt. */
  288. /* 0xc0 */  "&#9492;", /* box-draw light up + rt. */
  289. /* 0xc1 */  "&#9524;", /* box-draw light up + horiz. */
  290. /* 0xc2 */  "&#9516;", /* box-draw light dn. + horiz. */
  291. /* 0xc3 */  "&#9500;", /* box-draw light vert. + rt. */
  292. /* 0xc4 */  "&#9472;", /* box-draw light horiz. */
  293. /* 0xc5 */  "&#9532;", /* box-draw light vert. + horiz. */
  294. /* 0xc6 */  "&atilde;",
  295. /* 0xc7 */  "&atilde;",
  296. /* 0xc8 */  "&#9562;", /* box-draw dbl. up + rt. */
  297. /* 0xc9 */  "&#9556;", /* box-draw dbl. dn. + rt. */
  298. /* 0xca */  "&#9577;", /* box-draw dbl. up + horiz. */
  299. /* 0xcb */  "&#9574;", /* box-draw dbl. dn. + horiz. */
  300. /* 0xcc */  "&#9568;", /* box-draw dbl. vert. + rt. */
  301. /* 0xcd */  "&#9552;", /* box-draw dbl. horiz. */
  302. /* 0xce */  "&#9580;", /* box-draw dbl. vert. + horiz. */
  303. /* 0xcf */  "&curren;",
  304. /* 0xd0 */  "&eth;",
  305. /* 0xd1 */  "&eth;",
  306. /* 0xd2 */  "&ecirc;",
  307. /* 0xd3 */  "&euml;",
  308. /* 0xd4 */  "&egrave;",
  309. /* 0xd5 */  "&#305;", /* small dotless i */
  310. /* 0xd6 */  "&iacute;",
  311. /* 0xd7 */  "&icirc;",
  312. /* 0xd8 */  "&iuml;",
  313. /* 0xd9 */  "&#9496;", /* box-draw light up + lt. */
  314. /* 0xda */  "&#9484;", /* box-draw light dn. + rt. */
  315. /* 0xdb */  "&#9608;", /* full-block */
  316. /* 0xdc */  "&#9604;", /* lower 1/2 block */
  317. /* 0xdd */  "&brvbar;",
  318. /* 0xde */  "&igrave;",
  319. /* 0xdf */  "&#9600;", /* upper 1/2 block */
  320. /* 0xe0 */  "&oacute;",
  321. /* 0xe1 */  "&szlig;",
  322. /* 0xe2 */  "&ocirc;",
  323. /* 0xe3 */  "&ograve;",
  324. /* 0xe4 */  "&otilde;",
  325. /* 0xe5 */  "&otilde;",
  326. /* 0xe6 */  "&micro;",
  327. /* 0xe7 */  "&thorn;",
  328. /* 0xe8 */  "&thorn;",
  329. /* 0xe9 */  "&uacute;",
  330. /* 0xea */  "&ucirc;",
  331. /* 0xeb */  "&ugrave;",
  332. /* 0xec */  "&yacute;",
  333. /* 0xed */  "&yacute;",
  334. /* 0xee */  "&macr;",
  335. /* 0xef */  "&acute;",
  336. /* 0xf0 */  "&shy;",
  337. /* 0xf1 */  "&plusmn;",
  338. /* 0xf2 */  "&#8215;", /* dbl. lowline */
  339. /* 0xf3 */  "&frac34;",
  340. /* 0xf4 */  "&para;",
  341. /* 0xf5 */  "&sect;",
  342. /* 0xf6 */  "&divide;",
  343. /* 0xf7 */  "&cedil;",
  344. /* 0xf8 */  "&plus;",
  345. /* 0xf9 */  "&uml;",
  346. /* 0xfa */  "&middot;",
  347. /* 0xfb */  "&sup1;",
  348. /* 0xfc */  "&sup3;",
  349. /* 0xfd */  "&sup2;",
  350. /* 0xfe */  "&#9632;", /* black square */
  351. /* 0xff */  "&nbsp;",
  352. };
  353.  
  354.  
  355.  
  356.  
  357. /*========================================================================
  358.  * Name:        html_init
  359.  * Purpose:     Generates the HTML output personality.
  360.  * Args:        None.
  361.  * Returns:     OutputPersonality.
  362.  *=======================================================================*/
  363.  
  364. OutputPersonality *
  365. html_init (void)
  366. {
  367.         OutputPersonality* op;
  368.  
  369.         op = op_create();
  370.  
  371.         op->comment_begin = "<!--- ";
  372.         op->comment_end = " --->\n";
  373.  
  374.         op->document_begin = "<html>\n";
  375.         op->document_end = "</html>\n";
  376.  
  377.         op->header_begin = "<head>\n";
  378.         op->header_end = "</head>\n";
  379.  
  380.         op->document_title_begin = "<title>";
  381.         op->document_title_end = "</title>\n";
  382.  
  383.         op->document_author_begin = "<!--author: ";
  384.         op->document_author_end = "--->\n";
  385.  
  386.         op->document_changedate_begin = "<!--changed: ";
  387.         op->document_changedate_end = "--->\n";
  388.  
  389.         op->body_begin = "<body>";
  390.         op->body_end = "</body>\n";
  391.  
  392.         op->paragraph_begin = "<p>";
  393.         op->paragraph_end = "</p>\n";
  394.  
  395.         op->center_begin = "<center>";
  396.         op->center_end = "</center>\n";
  397.  
  398.         op->justify_begin = "<div align=justify>\n";
  399.         op->justify_end = "</div>\n";
  400.  
  401.         op->align_left_begin = "<div align=left>\n";
  402.         op->align_left_end = "</div>\n";
  403.  
  404.         op->align_right_begin = "<div align=right>\n";
  405.         op->align_right_end = "</div>\n";
  406.  
  407.         op->forced_space = "&nbsp;";
  408.         op->line_break = "<br>\n";
  409.         op->page_break = "<p><hr><p>\n";
  410.  
  411.         op->hyperlink_begin = "<a href=\"";
  412.         op->hyperlink_end = "\">hyperlink</a>";
  413.  
  414.         op->imagelink_begin = "<img src=\"";
  415.         op->imagelink_end = "\">";
  416.  
  417.         op->table_begin = "<table border=2>\n";
  418.         op->table_end = "</table>\n";
  419.  
  420.         op->table_row_begin = "<tr>";
  421.         op->table_row_end = "</tr>\n";
  422.  
  423.         op->table_cell_begin = "<td>";
  424.         op->table_cell_end = "</td>\n";
  425.  
  426.         /* Character attributes */
  427.         op->font_begin = "<font face=\"%s\">";
  428.         op->font_end = "</font>";
  429.  
  430.         op->fontsize_begin = "<span style=\"font-size:%spt\">";
  431.         op->fontsize_end = "</span>";
  432.  
  433.         op->fontsize8_begin = "<font size=1>";
  434.         op->fontsize8_end = "</font>";
  435.         op->fontsize10_begin = "<font size=2>";
  436.         op->fontsize10_end = "</font>";
  437.         op->fontsize12_begin = "<font size=3>";
  438.         op->fontsize12_end = "</font>";
  439.         op->fontsize14_begin = "<font size=4>";
  440.         op->fontsize14_end = "</font>";
  441.         op->fontsize18_begin = "<font size=5>";
  442.         op->fontsize18_end = "</font>";
  443.         op->fontsize24_begin = "<font size=6>";
  444.         op->fontsize24_end = "</font>";
  445.  
  446.         op->smaller_begin = "<small>";
  447.         op->smaller_end = "</small>";
  448.  
  449.         op->bigger_begin = "<big>";
  450.         op->bigger_end = "</big>";
  451.  
  452.         op->foreground_begin = "<font color=\"%s\">";
  453.         op->foreground_end = "</font>";
  454.  
  455.         op->background_begin = "<span style=\"background:%s\">";
  456.         op->background_end = "</span>";
  457.  
  458.         op->bold_begin = "<b>";
  459.         op->bold_end = "</b>";
  460.  
  461.         op->italic_begin = "<i>";
  462.         op->italic_end = "</i>";
  463.  
  464.         op->underline_begin = "<u>";
  465.         op->underline_end = "</u>";
  466.  
  467.         op->dbl_underline_begin = "<u>";
  468.         op->dbl_underline_end = "</u>";
  469.  
  470.         op->superscript_begin = "<sup>";
  471.         op->superscript_end = "</sup>";
  472.  
  473.         op->subscript_begin = "<sub>";
  474.         op->subscript_end = "</sub>";
  475.  
  476.         op->strikethru_begin = "<s>";
  477.         op->strikethru_end = "</s>";
  478.  
  479.         op->dbl_strikethru_begin = "<s>";
  480.         op->dbl_strikethru_end = "</s>";
  481.  
  482.         op->emboss_begin="<span style=\"background:gray\"><font color=black>";
  483.         op->emboss_end = "</font></span>";
  484.  
  485.         op->engrave_begin = "<span style=\"background:gray\"><font color=navyblue>";
  486.         op->engrave_end = "</font></span>";
  487.  
  488.         op->shadow_begin= "<span style=\"background:gray\">";
  489.         op->shadow_end= "</span>";
  490.  
  491.         op->outline_begin= "<span style=\"background:gray\">";
  492.         op->outline_end= "</span>";
  493.  
  494.         op->expand_begin = "<span style=\"letter-spacing: %s\">";
  495.         op->expand_end = "</span>";
  496.  
  497.         op->pointlist_begin = "<ol>\n";
  498.         op->pointlist_end = "</ol>\n";
  499.         op->pointlist_item_begin = "<li>";
  500.         op->pointlist_item_end = "</li>\n";
  501.  
  502.         op->numericlist_begin = "<ul>\n";
  503.         op->numericlist_end = "</ul>\n";
  504.         op->numericlist_item_begin = "<li>";
  505.         op->numericlist_item_end = "</li>\n";
  506.  
  507.         op->simulate_small_caps = TRUE;
  508.         op->simulate_all_caps = TRUE;
  509.         op->simulate_word_underline = TRUE;
  510.  
  511.         op->ascii_translation_table = ascii;
  512.  
  513.         op->ansi_translation_table = ansi;
  514.         op->ansi_first_char = 0x82;
  515.         op->ansi_last_char = 0xff;
  516.  
  517.         op->cp437_translation_table = cp437;
  518.         op->cp437_first_char = 0x80;
  519.         op->cp437_last_char = 0xff;
  520.  
  521.         op->cp850_translation_table = cp850;
  522.         op->cp850_first_char = 0x80;
  523.         op->cp850_last_char = 0xff;
  524.  
  525.         op->mac_translation_table = mac;
  526.         op->mac_first_char = 0xa4;
  527.         op->mac_last_char = 0xd5;
  528.  
  529.         op->chars.right_quote = "'";
  530.         op->chars.left_quote = "`";
  531.         op->chars.right_dbl_quote = "''";
  532.         op->chars.left_dbl_quote = "``";
  533.  
  534.         return op;
  535. }
  536.  
  537.  
  538.