2 * Copyright (C) 2005-2008 Atsushi Konno All rights reserved.
3 * Copyright (C) 2005 QSDN,Inc. All rights reserved.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 #include "chxj_chtml20.h"
18 #include "chxj_hdml.h"
19 #include "chxj_str_util.h"
20 #include "chxj_dump.h"
21 #include "chxj_img_conv.h"
22 #include "chxj_qr_code.h"
23 #include "chxj_encoding.h"
24 #include "chxj_buffered_write.h"
27 #define GET_CHTML20(X) ((chtml20_t*)(X))
30 #define W_L(X) do { chtml20->out = BUFFERED_WRITE_LITERAL(chtml20->out, &doc->buf, (X)); } while(0)
31 #define W_V(X) do { chtml20->out = (X) ? BUFFERED_WRITE_VALUE(chtml20->out, &doc->buf, (X)) \
32 : BUFFERED_WRITE_LITERAL(chtml20->out, &doc->buf, ""); } while(0)
34 #define W_NLCODE() do { char *nlcode = TO_NLCODE(chtml20->conf); W_V(nlcode); } while (0)
36 static char *s_chtml20_start_html_tag (void *pdoc, Node *node);
37 static char *s_chtml20_end_html_tag (void *pdoc, Node *node);
38 static char *s_chtml20_start_meta_tag (void *pdoc, Node *node);
39 static char *s_chtml20_end_meta_tag (void *pdoc, Node *node);
40 static char *s_chtml20_start_textarea_tag(void *pdoc, Node *node);
41 static char *s_chtml20_end_textarea_tag (void *pdoc, Node *node);
42 static char *s_chtml20_start_p_tag (void *pdoc, Node *node);
43 static char *s_chtml20_end_p_tag (void *pdoc, Node *node);
44 static char *s_chtml20_start_pre_tag (void *pdoc, Node *node);
45 static char *s_chtml20_end_pre_tag (void *pdoc, Node *node);
46 static char *s_chtml20_start_h1_tag (void *pdoc, Node *node);
47 static char *s_chtml20_end_h1_tag (void *pdoc, Node *node);
48 static char *s_chtml20_start_h2_tag (void *pdoc, Node *node);
49 static char *s_chtml20_end_h2_tag (void *pdoc, Node *node);
50 static char *s_chtml20_start_h3_tag (void *pdoc, Node *node);
51 static char *s_chtml20_end_h3_tag (void *pdoc, Node *node);
52 static char *s_chtml20_start_h4_tag (void *pdoc, Node *node);
53 static char *s_chtml20_end_h4_tag (void *pdoc, Node *node);
54 static char *s_chtml20_start_h5_tag (void *pdoc, Node *node);
55 static char *s_chtml20_end_h5_tag (void *pdoc, Node *node);
56 static char *s_chtml20_start_h6_tag (void *pdoc, Node *node);
57 static char *s_chtml20_end_h6_tag (void *pdoc, Node *node);
58 static char *s_chtml20_start_ul_tag (void *pdoc, Node *node);
59 static char *s_chtml20_end_ul_tag (void *pdoc, Node *node);
60 static char *s_chtml20_start_ol_tag (void *pdoc, Node *node);
61 static char *s_chtml20_end_ol_tag (void *pdoc, Node *node);
62 static char *s_chtml20_start_li_tag (void *pdoc, Node *node);
63 static char *s_chtml20_end_li_tag (void *pdoc, Node *node);
64 static char *s_chtml20_start_head_tag (void *pdoc, Node *node);
65 static char *s_chtml20_end_head_tag (void *pdoc, Node *node);
66 static char *s_chtml20_start_title_tag (void *pdoc, Node *node);
67 static char *s_chtml20_end_title_tag (void *pdoc, Node *node);
68 static char *s_chtml20_start_base_tag (void *pdoc, Node *node);
69 static char *s_chtml20_end_base_tag (void *pdoc, Node *node);
70 static char *s_chtml20_start_body_tag (void *pdoc, Node *node);
71 static char *s_chtml20_end_body_tag (void *pdoc, Node *node);
72 static char *s_chtml20_start_a_tag (void *pdoc, Node *node);
73 static char *s_chtml20_end_a_tag (void *pdoc, Node *node);
74 static char *s_chtml20_start_br_tag (void *pdoc, Node *node);
75 static char *s_chtml20_end_br_tag (void *pdoc, Node *node);
76 static char *s_chtml20_start_tr_tag (void *pdoc, Node *node);
77 static char *s_chtml20_end_tr_tag (void *pdoc, Node *node);
78 static char *s_chtml20_start_font_tag (void *pdoc, Node *node);
79 static char *s_chtml20_end_font_tag (void *pdoc, Node *node);
80 static char *s_chtml20_start_form_tag (void *pdoc, Node *node);
81 static char *s_chtml20_end_form_tag (void *pdoc, Node *node);
82 static char *s_chtml20_start_input_tag (void *pdoc, Node *node);
83 static char *s_chtml20_end_input_tag (void *pdoc, Node *node);
84 static char *s_chtml20_start_center_tag (void *pdoc, Node *node);
85 static char *s_chtml20_end_center_tag (void *pdoc, Node *node);
86 static char *s_chtml20_start_hr_tag (void *pdoc, Node *node);
87 static char *s_chtml20_end_hr_tag (void *pdoc, Node *node);
88 static char *s_chtml20_start_img_tag (void *pdoc, Node *node);
89 static char *s_chtml20_end_img_tag (void *pdoc, Node *node);
90 static char *s_chtml20_start_select_tag (void *pdoc, Node *node);
91 static char *s_chtml20_end_select_tag (void *pdoc, Node *node);
92 static char *s_chtml20_start_option_tag (void *pdoc, Node *node);
93 static char *s_chtml20_end_option_tag (void *pdoc, Node *node);
94 static char *s_chtml20_start_div_tag (void *pdoc, Node *node);
95 static char *s_chtml20_end_div_tag (void *pdoc, Node *node);
96 static char *s_chtml20_start_blockquote_tag(void *pdoc, Node *node);
97 static char *s_chtml20_end_blockquote_tag (void *pdoc, Node *node);
98 static char *s_chtml20_start_dir_tag (void *pdoc, Node *node);
99 static char *s_chtml20_end_dir_tag (void *pdoc, Node *node);
100 static char *s_chtml20_start_dl_tag (void *pdoc, Node *node);
101 static char *s_chtml20_end_dl_tag (void *pdoc, Node *node);
102 static char *s_chtml20_start_dt_tag (void *pdoc, Node *node);
103 static char *s_chtml20_end_dt_tag (void *pdoc, Node *node);
104 static char *s_chtml20_start_dd_tag (void *pdoc, Node *node);
105 static char *s_chtml20_end_dd_tag (void *pdoc, Node *node);
106 static char *s_chtml20_start_menu_tag (void *pdoc, Node *node);
107 static char *s_chtml20_end_menu_tag (void *pdoc, Node *node);
108 static char *s_chtml20_start_plaintext_tag (void *pdoc, Node *node);
109 static char *s_chtml20_start_plaintext_tag_inner (void *pdoc, Node *node);
110 static char *s_chtml20_end_plaintext_tag (void *pdoc, Node *node);
111 static char *s_chtml20_start_blink_tag (void *pdoc, Node *node);
112 static char *s_chtml20_end_blink_tag (void *pdoc, Node *node);
113 static char *s_chtml20_start_marquee_tag (void *pdoc, Node *node);
114 static char *s_chtml20_end_marquee_tag (void *pdoc, Node *node);
115 static char *s_chtml20_newline_mark (void *pdoc, Node *node);
117 static void s_init_chtml20(chtml20_t *chtml, Doc *doc, request_rec *r, device_table *spec);
119 static int s_chtml20_search_emoji(chtml20_t *chtml, char *txt, char **rslt);
121 static char *s_chtml20_chxjif_tag(void *pdoc, Node *node);
122 static char *s_chtml20_text_tag(void *pdoc, Node *node);
125 tag_handler chtml20_handler[] = {
128 s_chtml20_start_html_tag,
129 s_chtml20_end_html_tag,
133 s_chtml20_start_meta_tag,
134 s_chtml20_end_meta_tag,
138 s_chtml20_start_textarea_tag,
139 s_chtml20_end_textarea_tag,
143 s_chtml20_start_p_tag,
148 s_chtml20_start_pre_tag,
149 s_chtml20_end_pre_tag,
153 s_chtml20_start_ul_tag,
154 s_chtml20_end_ul_tag,
158 s_chtml20_start_li_tag,
159 s_chtml20_end_li_tag,
163 s_chtml20_start_ol_tag,
164 s_chtml20_end_ol_tag,
168 s_chtml20_start_h1_tag,
169 s_chtml20_end_h1_tag,
173 s_chtml20_start_h2_tag,
174 s_chtml20_end_h2_tag,
178 s_chtml20_start_h3_tag,
179 s_chtml20_end_h3_tag,
183 s_chtml20_start_h4_tag,
184 s_chtml20_end_h4_tag,
188 s_chtml20_start_h5_tag,
189 s_chtml20_end_h5_tag,
193 s_chtml20_start_h6_tag,
194 s_chtml20_end_h6_tag,
198 s_chtml20_start_head_tag,
199 s_chtml20_end_head_tag,
203 s_chtml20_start_title_tag,
204 s_chtml20_end_title_tag,
208 s_chtml20_start_base_tag,
209 s_chtml20_end_base_tag,
213 s_chtml20_start_body_tag,
214 s_chtml20_end_body_tag,
218 s_chtml20_start_a_tag,
223 s_chtml20_start_br_tag,
224 s_chtml20_end_br_tag,
233 s_chtml20_start_tr_tag,
234 s_chtml20_end_tr_tag,
248 s_chtml20_start_font_tag,
249 s_chtml20_end_font_tag,
253 s_chtml20_start_form_tag,
254 s_chtml20_end_form_tag,
258 s_chtml20_start_input_tag,
259 s_chtml20_end_input_tag,
263 s_chtml20_start_center_tag,
264 s_chtml20_end_center_tag,
268 s_chtml20_start_hr_tag,
269 s_chtml20_end_hr_tag,
273 s_chtml20_start_img_tag,
274 s_chtml20_end_img_tag,
278 s_chtml20_start_select_tag,
279 s_chtml20_end_select_tag,
283 s_chtml20_start_option_tag,
284 s_chtml20_end_option_tag,
288 s_chtml20_start_div_tag,
289 s_chtml20_end_div_tag,
293 s_chtml20_chxjif_tag,
338 s_chtml20_start_dt_tag,
339 s_chtml20_end_dt_tag,
353 s_chtml20_start_blockquote_tag,
354 s_chtml20_end_blockquote_tag,
358 s_chtml20_start_dir_tag,
359 s_chtml20_end_dir_tag,
363 s_chtml20_start_dl_tag,
364 s_chtml20_end_dl_tag,
368 s_chtml20_start_dd_tag,
369 s_chtml20_end_dd_tag,
373 s_chtml20_start_menu_tag,
374 s_chtml20_end_menu_tag,
378 s_chtml20_start_plaintext_tag,
379 s_chtml20_end_plaintext_tag,
383 s_chtml20_start_blink_tag,
384 s_chtml20_end_blink_tag,
388 s_chtml20_start_marquee_tag,
389 s_chtml20_end_marquee_tag,
393 s_chtml20_newline_mark,
399 * converts from CHTML5.0 to CHTML2.0.
401 * @param r [i] Requet_rec is appointed.
402 * @param spec [i] The result of the device specification processing which
403 * was done in advance is appointed.
404 * @param src [i] The character string before the converting is appointed.
405 * @return The character string after the converting is returned.
408 chxj_convert_chtml20(
414 chxjconvrule_entry *entryp,
423 /*--------------------------------------------------------------------------*/
425 /*--------------------------------------------------------------------------*/
427 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
429 DBG(r,"i found qrcode xml");
432 DBG(r,"not found qrcode xml");
434 /*--------------------------------------------------------------------------*/
435 /* The CHTML structure is initialized. */
436 /*--------------------------------------------------------------------------*/
437 s_init_chtml20(&chtml20, &doc, r, spec);
440 chtml20.entryp = entryp;
441 chtml20.cookie = cookie;
443 chxj_set_content_type(r, "text/html; charset=Windows-31J");
445 /*--------------------------------------------------------------------------*/
446 /* The character string of the input is analyzed. */
447 /*--------------------------------------------------------------------------*/
448 qs_init_malloc(&doc);
449 qs_init_root_node(&doc);
451 ss = apr_pcalloc(r->pool, srclen + 1);
452 memset(ss, 0, srclen + 1);
453 memcpy(ss, src, srclen);
456 chxj_dump_out("[src] CHTML -> CHTML2.0", ss, srclen);
459 qs_parse_string(&doc,ss, strlen(ss));
461 chxj_buffered_write_init(r->pool, &doc.buf);
462 /*--------------------------------------------------------------------------*/
463 /* It converts it from CHTML to CHTML. */
464 /*--------------------------------------------------------------------------*/
465 chxj_node_convert(spec,r,(void *)&chtml20, &doc, qs_get_root(&doc), 0);
466 chtml20.out = chxj_buffered_write_flush(chtml20.out, &doc.buf);
467 dst = apr_pstrdup(r->pool, chtml20.out);
468 chxj_buffered_write_terminate(&doc.buf);
470 qs_all_free(&doc,QX_LOGMARK);
473 return apr_pstrdup(r->pool,ss);
476 if (strlen(dst) == 0) {
477 dst = apr_psprintf(r->pool, "\n");
480 *dstlen = strlen(dst);
483 chxj_dump_out("[dst] CHTML -> CHTML2.0", dst, *dstlen);
490 * The CHTML structure is initialized.
492 * @param chtml20 [i/o] The pointer to the HDML structure that wants to be
493 * initialized is specified.
494 * @param doc [i] The Doc structure that should be set to the initialized
495 * HDML structure is specified.
496 * @param r [i] To use POOL, the pointer to request_rec is specified.
497 * @param spec [i] The pointer to the device_table
500 s_init_chtml20(chtml20_t *chtml20, Doc *doc, request_rec *r, device_table *spec)
502 memset(doc, 0, sizeof(Doc));
503 memset(chtml20, 0, sizeof(chtml20_t));
507 chtml20->spec = spec;
508 chtml20->out = qs_alloc_zero_byte_string(r->pool);
509 chtml20->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
511 chtml20->doc->parse_mode = PARSE_MODE_CHTML;
516 * Corresponding EMOJI to a current character-code is retrieved.
517 * The substitution character string is stored in the rslt pointer if agreeing.
519 * @param chtml20 [i] The pointer to the CHTML structure is specified.
520 * @param txt [i] The character string to want to examine whether it is
521 * EMOJI is specified.
522 * @param rslt [o] The pointer to the pointer that stores the result is
524 * @return When corresponding EMOJI exists, it returns it excluding 0.
527 s_chtml20_search_emoji(chtml20_t *chtml20, char *txt, char **rslt)
534 spec = chtml20->spec;
540 DBG(r,"spec is NULL");
542 for (ee = chtml20->conf->emoji;
546 if (ee->imode == NULL) {
547 DBG(r,"emoji->imode is NULL");
551 if (ee->imode->string != NULL
552 && strlen(ee->imode->string) > 0
553 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
554 if (spec == NULL || spec->emoji_type == NULL) {
555 *rslt = apr_palloc(r->pool, 3);
556 (*rslt)[0] = ee->imode->hex1byte & 0xff;
557 (*rslt)[1] = ee->imode->hex2byte & 0xff;
559 return strlen(ee->imode->string);
571 * It is a handler who processes the HTML tag.
573 * @param pdoc [i/o] The pointer to the CHTML structure at the output
574 * destination is specified.
575 * @param node [i] The HTML tag node is specified.
576 * @return The conversion result is returned.
579 s_chtml20_start_html_tag(void *pdoc, Node *UNUSED(node))
585 chtml20 = GET_CHTML20(pdoc);
589 /*--------------------------------------------------------------------------*/
591 /*--------------------------------------------------------------------------*/
598 * It is a handler who processes the HTML tag.
600 * @param pdoc [i/o] The pointer to the CHTML structure at the output
601 * destination is specified.
602 * @param node [i] The HTML tag node is specified.
603 * @return The conversion result is returned.
606 s_chtml20_end_html_tag(void *pdoc, Node *UNUSED(child))
612 chtml20 = GET_CHTML20(pdoc);
622 * It is a handler who processes the META tag.
624 * @param pdoc [i/o] The pointer to the CHTML structure at the output
625 * destination is specified.
626 * @param node [i] The META tag node is specified.
627 * @return The conversion result is returned.
630 s_chtml20_start_meta_tag(void *pdoc, Node *node)
636 int content_type_flag;
639 chtml20 = GET_CHTML20(pdoc);
643 content_type_flag = 0;
647 /*--------------------------------------------------------------------------*/
649 /*--------------------------------------------------------------------------*/
650 for (attr = qs_get_attr(doc,node);
652 attr = qs_get_next_attr(doc,attr)) {
653 char *name = qs_get_attr_name(doc,attr);
654 char *value = qs_get_attr_value(doc,attr);
658 if (strcasecmp(name, "http-equiv") == 0 && value && *value) {
659 /*----------------------------------------------------------------------*/
661 /*----------------------------------------------------------------------*/
662 W_L(" http-equiv=\"");
665 if (STRCASEEQ('c','C',"content-type", value)) {
666 content_type_flag = 1;
668 if (STRCASEEQ('r','R',"refresh", value)) {
676 if (strcasecmp(name, "content") == 0 && value && *value) {
677 if (content_type_flag) {
680 W_L("=\"text/html; charset=Windows-31J\"");
682 else if (refresh_flag) {
683 char *buf = apr_pstrdup(r->pool, value);
687 url = strchr(buf, ';');
689 sec = apr_pstrdup(r->pool, buf);
692 url = chxj_encoding_parameter(r, url);
693 url = chxj_add_cookie_parameter(r, url, chtml20->cookie);
724 * It is a handler who processes the META tag.
726 * @param pdoc [i/o] The pointer to the CHTML structure at the output
727 * destination is specified.
728 * @param node [i] The META tag node is specified.
729 * @return The conversion result is returned.
732 s_chtml20_end_meta_tag(void *pdoc, Node *UNUSED(child))
734 chtml20_t *chtml20 = GET_CHTML20(pdoc);
741 * It is a handler who processes the HEAD tag.
743 * @param pdoc [i/o] The pointer to the CHTML structure at the output
744 * destination is specified.
745 * @param node [i] The HEAD tag node is specified.
746 * @return The conversion result is returned.
749 s_chtml20_start_head_tag(void *pdoc, Node *UNUSED(node))
754 chtml20 = GET_CHTML20(pdoc);
764 * It is a handler who processes the HEAD tag.
766 * @param pdoc [i/o] The pointer to the CHTML structure at the output
767 * destination is specified.
768 * @param node [i] The HEAD tag node is specified.
769 * @return The conversion result is returned.
772 s_chtml20_end_head_tag(void *pdoc, Node *UNUSED(child))
778 chtml20 = GET_CHTML20(pdoc);
789 * It is a handler who processes the TITLE tag.
791 * @param pdoc [i/o] The pointer to the CHTML structure at the output
792 * destination is specified.
793 * @param node [i] The TITLE tag node is specified.
794 * @return The conversion result is returned.
797 s_chtml20_start_title_tag(void *pdoc, Node *UNUSED(node))
803 chtml20 = GET_CHTML20(pdoc);
814 * It is a handler who processes the TITLE tag.
816 * @param pdoc [i/o] The pointer to the CHTML structure at the output
817 * destination is specified.
818 * @param node [i] The TITLE tag node is specified.
819 * @return The conversion result is returned.
822 s_chtml20_end_title_tag(void *pdoc, Node *UNUSED(child))
828 chtml20 = GET_CHTML20(pdoc);
839 * It is a handler who processes the BASE tag.
841 * @param pdoc [i/o] The pointer to the CHTML structure at the output
842 * destination is specified.
843 * @param node [i] The BASE tag node is specified.
844 * @return The conversion result is returned.
847 s_chtml20_start_base_tag(void *pdoc, Node *node)
854 chtml20 = GET_CHTML20(pdoc);
859 /*--------------------------------------------------------------------------*/
861 /*--------------------------------------------------------------------------*/
862 for (attr = qs_get_attr(doc,node);
864 attr = qs_get_next_attr(doc,attr)) {
865 char *name = qs_get_attr_name(doc,attr);
866 char *value = qs_get_attr_value(doc,attr);
867 if (STRCASEEQ('h','H',"href", name)) {
880 * It is a handler who processes the BASE tag.
882 * @param pdoc [i/o] The pointer to the CHTML structure at the output
883 * destination is specified.
884 * @param node [i] The BASE tag node is specified.
885 * @return The conversion result is returned.
888 s_chtml20_end_base_tag(void *pdoc, Node *UNUSED(child))
894 chtml20 = GET_CHTML20(pdoc);
903 * It is a handler who processes the BODY tag.
905 * @param pdoc [i/o] The pointer to the CHTML structure at the output
906 * destination is specified.
907 * @param node [i] The BODY tag node is specified.
908 * @return The conversion result is returned.
911 s_chtml20_start_body_tag(void *pdoc, Node *node)
918 chtml20 = GET_CHTML20(pdoc);
923 /*--------------------------------------------------------------------------*/
925 /*--------------------------------------------------------------------------*/
926 for (attr = qs_get_attr(doc,node);
928 attr = qs_get_next_attr(doc,attr)) {
929 char *name = qs_get_attr_name(doc,attr);
930 char *value = qs_get_attr_value(doc,attr);
934 if (strcasecmp(name, "bgcolor") == 0 && value && *value != 0) {
935 /*----------------------------------------------------------------------*/
937 /*----------------------------------------------------------------------*/
946 if (strcasecmp(name, "text") == 0 && value && *value != 0) {
947 /*----------------------------------------------------------------------*/
949 /*----------------------------------------------------------------------*/
958 if (strcasecmp(name, "link") == 0 && value && *value != 0) {
959 /*----------------------------------------------------------------------*/
961 /*----------------------------------------------------------------------*/
970 if (strcasecmp(name, "alink") == 0) {
971 /*----------------------------------------------------------------------*/
973 /*----------------------------------------------------------------------*/
980 if (strcasecmp(name, "vlink") == 0) {
981 /*----------------------------------------------------------------------*/
983 /*----------------------------------------------------------------------*/
999 * It is a handler who processes the BODY tag.
1001 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1002 * destination is specified.
1003 * @param node [i] The BODY tag node is specified.
1004 * @return The conversion result is returned.
1007 s_chtml20_end_body_tag(void *pdoc, Node *UNUSED(child))
1013 chtml20 = GET_CHTML20(pdoc);
1019 return chtml20->out;
1024 * It is a handler who processes the A tag.
1026 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1027 * destination is specified.
1028 * @param node [i] The A tag node is specified.
1029 * @return The conversion result is returned.
1032 s_chtml20_start_a_tag(void *pdoc, Node *node)
1039 chtml20 = GET_CHTML20(pdoc);
1044 /*--------------------------------------------------------------------------*/
1045 /* Get Attributes */
1046 /*--------------------------------------------------------------------------*/
1047 for (attr = qs_get_attr(doc,node);
1049 attr = qs_get_next_attr(doc,attr)) {
1050 char *name = qs_get_attr_name(doc,attr);
1051 char *value = qs_get_attr_value(doc,attr);
1055 if (strcasecmp(name, "name") == 0) {
1056 /*--------------------------------------------------------------------*/
1058 /*--------------------------------------------------------------------*/
1067 if (strcasecmp(name, "href") == 0) {
1068 /*--------------------------------------------------------------------*/
1070 /*--------------------------------------------------------------------*/
1071 value = chxj_encoding_parameter(r, value);
1072 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
1081 if (strcasecmp(name, "accesskey") == 0) {
1082 /*--------------------------------------------------------------------*/
1084 /*--------------------------------------------------------------------*/
1085 W_L(" accesskey=\"");
1093 if (strcasecmp(name, "cti") == 0) {
1094 /*--------------------------------------------------------------------*/
1096 /*--------------------------------------------------------------------*/
1105 if (strcasecmp(name, "ijam") == 0) {
1106 /*--------------------------------------------------------------------*/
1108 /*--------------------------------------------------------------------*/
1112 if (strcasecmp(name, "ista") == 0) {
1113 /*--------------------------------------------------------------------*/
1115 /*--------------------------------------------------------------------*/
1119 if (strcasecmp(name, "ilet") == 0) {
1120 /*--------------------------------------------------------------------*/
1122 /*--------------------------------------------------------------------*/
1126 if (strcasecmp(name, "iswf") == 0) {
1127 /*--------------------------------------------------------------------*/
1129 /*--------------------------------------------------------------------*/
1133 if (strcasecmp(name, "irst") == 0) {
1134 /*--------------------------------------------------------------------*/
1136 /*--------------------------------------------------------------------*/
1143 if (strcasecmp(name, "utn") == 0) {
1144 /*--------------------------------------------------------------------*/
1146 /*--------------------------------------------------------------------*/
1153 if (strcasecmp(name, "telbook") == 0) {
1154 /*--------------------------------------------------------------------*/
1156 /*--------------------------------------------------------------------*/
1163 if (strcasecmp(name, "kana") == 0) {
1164 /*--------------------------------------------------------------------*/
1166 /*--------------------------------------------------------------------*/
1173 if (strcasecmp(name, "email") == 0) {
1174 /*--------------------------------------------------------------------*/
1176 /*--------------------------------------------------------------------*/
1186 return chtml20->out;
1191 * It is a handler who processes the A tag.
1193 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1194 * destination is specified.
1195 * @param node [i] The A tag node is specified.
1196 * @return The conversion result is returned.
1199 s_chtml20_end_a_tag(void *pdoc, Node *UNUSED(child))
1205 chtml20 = GET_CHTML20(pdoc);
1211 return chtml20->out;
1216 * It is a handler who processes the BR tag.
1218 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1219 * destination is specified.
1220 * @param node [i] The BR tag node is specified.
1221 * @return The conversion result is returned.
1224 s_chtml20_start_br_tag(void *pdoc, Node *node)
1231 chtml20 = GET_CHTML20(pdoc);
1236 /*--------------------------------------------------------------------------*/
1237 /* Get Attributes */
1238 /*--------------------------------------------------------------------------*/
1239 for (attr = qs_get_attr(doc,node);
1241 attr = qs_get_next_attr(doc,attr)) {
1242 char *name = qs_get_attr_name(doc,attr);
1243 char *value = qs_get_attr_value(doc,attr);
1244 if (STRCASEEQ('c','C',"clear",name)) {
1245 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1254 return chtml20->out;
1259 * It is a handler who processes the BR tag.
1261 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1262 * destination is specified.
1263 * @param node [i] The BR tag node is specified.
1264 * @return The conversion result is returned.
1267 s_chtml20_end_br_tag(void *pdoc, Node *UNUSED(child))
1273 chtml20 = GET_CHTML20(pdoc);
1277 return chtml20->out;
1282 * It is a handler who processes the TR tag.
1284 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1285 * destination is specified.
1286 * @param node [i] The TR tag node is specified.
1287 * @return The conversion result is returned.
1290 s_chtml20_start_tr_tag(void *pdoc, Node *UNUSED(node))
1296 chtml20 = GET_CHTML20(pdoc);
1300 return chtml20->out;
1305 * It is a handler who processes the TR tag.
1307 * @param chtml20 [i/o] The pointer to the CHTML structure at the output
1308 * destination is specified.
1309 * @param node [i] The TR tag node is specified.
1310 * @return The conversion result is returned.
1313 s_chtml20_end_tr_tag(void *pdoc, Node *UNUSED(child))
1319 chtml20 = GET_CHTML20(pdoc);
1325 return chtml20->out;
1330 * It is a handler who processes the FONT tag.
1332 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1333 * destination is specified.
1334 * @param node [i] The FONT tag node is specified.
1335 * @return The conversion result is returned.
1338 s_chtml20_start_font_tag(void *pdoc, Node *node)
1346 chtml20 = GET_CHTML20(pdoc);
1351 /*--------------------------------------------------------------------------*/
1352 /* Get Attributes */
1353 /*--------------------------------------------------------------------------*/
1354 for (attr = qs_get_attr(doc,node);
1355 attr && color == NULL;
1356 attr = qs_get_next_attr(doc,attr)) {
1357 char *name = qs_get_attr_name(doc,attr);
1358 char *value = qs_get_attr_value(doc,attr);
1362 if (strcasecmp(name, "color") == 0 && value && *value) {
1363 color = apr_pstrdup(doc->buf.pool, value);
1369 if (strcasecmp(name, "size") == 0) {
1370 /*--------------------------------------------------------------------*/
1372 /*--------------------------------------------------------------------*/
1382 W_L("<font color=\"");
1385 chtml20->font_flag++;
1387 return chtml20->out;
1392 * It is a handler who processes the FONT tag.
1394 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1395 * destination is specified.
1396 * @param node [i] The FONT tag node is specified.
1397 * @return The conversion result is returned.
1400 s_chtml20_end_font_tag(void *pdoc, Node *UNUSED(child))
1406 chtml20 = GET_CHTML20(pdoc);
1410 if (chtml20->font_flag) {
1412 chtml20->font_flag--;
1414 return chtml20->out;
1419 * It is a handler who processes the FORM tag.
1421 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1422 * destination is specified.
1423 * @param node [i] The FORM tag node is specified.
1424 * @return The conversion result is returned.
1427 s_chtml20_start_form_tag(void *pdoc, Node *node)
1434 chtml20 = GET_CHTML20(pdoc);
1439 /*--------------------------------------------------------------------------*/
1440 /* Get Attributes */
1441 /*--------------------------------------------------------------------------*/
1442 for (attr = qs_get_attr(doc,node);
1444 attr = qs_get_next_attr(doc,attr)) {
1445 char *name = qs_get_attr_name(doc,attr);
1446 char *value = qs_get_attr_value(doc,attr);
1450 if (strcasecmp(name, "action") == 0) {
1451 /*--------------------------------------------------------------------*/
1453 /*--------------------------------------------------------------------*/
1454 value = chxj_encoding_parameter(r, value);
1455 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
1465 if (strcasecmp(name, "method") == 0) {
1466 /*--------------------------------------------------------------------*/
1468 /*--------------------------------------------------------------------*/
1477 if (strcasecmp(name, "utn") == 0) {
1478 /*--------------------------------------------------------------------*/
1480 /*--------------------------------------------------------------------*/
1491 return chtml20->out;
1496 * It is a handler who processes the FORM tag.
1498 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1499 * destination is specified.
1500 * @param node [i] The FORM tag node is specified.
1501 * @return The conversion result is returned.
1504 s_chtml20_end_form_tag(void *pdoc, Node *UNUSED(child))
1510 chtml20 = GET_CHTML20(pdoc);
1516 return chtml20->out;
1521 * It is a handler who processes the INPUT tag.
1523 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1524 * destination is specified.
1525 * @param node [i] The INPUT tag node is specified.
1526 * @return The conversion result is returned.
1529 s_chtml20_start_input_tag(void *pdoc, Node *node)
1534 char *max_length = NULL;
1538 char *istyle = NULL;
1540 char *checked = NULL;
1541 char *accesskey = NULL;
1543 chtml20 = GET_CHTML20(pdoc);
1549 /*--------------------------------------------------------------------------*/
1550 /* Get Attributes */
1551 /*--------------------------------------------------------------------------*/
1552 type = qs_get_type_attr(doc, node, doc->buf.pool);
1553 name = qs_get_name_attr(doc, node, doc->buf.pool);
1554 value = qs_get_value_attr(doc,node,doc->buf.pool);
1555 istyle = qs_get_istyle_attr(doc,node,doc->buf.pool);
1556 max_length = qs_get_maxlength_attr(doc,node,doc->buf.pool);
1557 checked = qs_get_checked_attr(doc,node,doc->buf.pool);
1558 accesskey = qs_get_accesskey_attr(doc, node, doc->buf.pool);
1559 size = qs_get_size_attr(doc, node, doc->buf.pool);
1562 type = qs_trim_string(doc->buf.pool, type);
1563 if (type && (STRCASEEQ('t','T',"text", type) ||
1564 STRCASEEQ('p','P',"password",type) ||
1565 STRCASEEQ('c','C',"checkbox",type) ||
1566 STRCASEEQ('r','R',"radio", type) ||
1567 STRCASEEQ('h','H',"hidden", type) ||
1568 STRCASEEQ('s','S',"submit", type) ||
1569 STRCASEEQ('r','R',"reset", type))) {
1575 if (size && *size) {
1580 if (name && *name) {
1585 if (value && *value) {
1587 W_V(chxj_add_slash_to_doublequote(doc->pool, value));
1590 if (accesskey && *accesskey) {
1591 W_L(" accesskey=\"");
1596 /*------------------------------------------------------------------------*/
1598 /*------------------------------------------------------------------------*/
1599 if (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4') {
1605 /*--------------------------------------------------------------------------*/
1606 /* The figure is default for the password. */
1607 /*--------------------------------------------------------------------------*/
1608 if (max_length && *max_length) {
1609 if (chxj_chk_numeric(max_length) != 0) {
1610 max_length = apr_psprintf(doc->buf.pool, "0");
1612 if (istyle && *istyle == '1') {
1613 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length) * 2);
1617 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length));
1626 return chtml20->out;
1631 * It is a handler who processes the INPUT tag.
1633 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1634 * destination is specified.
1635 * @param node [i] The INPUT tag node is specified.
1636 * @return The conversion result is returned.
1639 s_chtml20_end_input_tag(void *pdoc, Node *UNUSED(child))
1645 chtml20 = GET_CHTML20(pdoc);
1649 return chtml20->out;
1654 * It is a handler who processes the CENTER tag.
1656 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1657 * destination is specified.
1658 * @param node [i] The CENTER tag node is specified.
1659 * @return The conversion result is returned.
1662 s_chtml20_start_center_tag(void *pdoc, Node *UNUSED(node))
1668 chtml20 = GET_CHTML20(pdoc);
1673 return chtml20->out;
1678 * It is a handler who processes the CENTER tag.
1680 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1681 * destination is specified.
1682 * @param node [i] The CENTER tag node is specified.
1683 * @return The conversion result is returned.
1686 s_chtml20_end_center_tag(void *pdoc, Node *UNUSED(child))
1692 chtml20 = GET_CHTML20(pdoc);
1698 return chtml20->out;
1703 * It is a handler who processes the UL tag.
1705 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1706 * destination is specified.
1707 * @param node [i] The UL tag node is specified.
1708 * @return The conversion result is returned.
1711 s_chtml20_start_ul_tag(void *pdoc, Node *UNUSED(node))
1717 chtml20 = GET_CHTML20(pdoc);
1723 return chtml20->out;
1728 * It is a handler who processes the UL tag.
1730 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1731 * destination is specified.
1732 * @param node [i] The UL tag node is specified.
1733 * @return The conversion result is returned.
1736 s_chtml20_end_ul_tag(void *pdoc, Node *UNUSED(child))
1742 chtml20 = GET_CHTML20(pdoc);
1748 return chtml20->out;
1753 * It is a handler who processes the OL tag.
1755 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1756 * destination is specified.
1757 * @param node [i] The OL tag node is specified.
1758 * @return The conversion result is returned.
1761 s_chtml20_start_ol_tag(void *pdoc, Node *node)
1768 chtml20 = GET_CHTML20(pdoc);
1773 /*--------------------------------------------------------------------------*/
1774 /* Get Attributes */
1775 /*--------------------------------------------------------------------------*/
1776 for (attr = qs_get_attr(doc,node);
1778 attr = qs_get_next_attr(doc,attr)) {
1779 char *name = qs_get_attr_name(doc,attr);
1780 char *value = qs_get_attr_value(doc,attr);
1781 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
1786 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
1794 return chtml20->out;
1799 * It is a handler who processes the OL tag.
1801 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1802 * destination is specified.
1803 * @param node [i] The OL tag node is specified.
1804 * @return The conversion result is returned.
1807 s_chtml20_end_ol_tag(void *pdoc, Node *UNUSED(child))
1813 chtml20 = GET_CHTML20(pdoc);
1819 return chtml20->out;
1824 * It is a handler who processes the LI tag.
1826 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1827 * destination is specified.
1828 * @param node [i] The LI tag node is specified.
1829 * @return The conversion result is returned.
1832 s_chtml20_start_li_tag(void *pdoc, Node *node)
1839 chtml20 = GET_CHTML20(pdoc);
1844 /*--------------------------------------------------------------------------*/
1845 /* Get Attributes */
1846 /*--------------------------------------------------------------------------*/
1847 for (attr = qs_get_attr(doc,node);
1849 attr = qs_get_next_attr(doc,attr)) {
1850 char *name = qs_get_attr_name(doc,attr);
1851 char *value = qs_get_attr_value(doc,attr);
1852 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
1857 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
1864 return chtml20->out;
1869 * It is a handler who processes the LI tag.
1871 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1872 * destination is specified.
1873 * @param node [i] The LI tag node is specified.
1874 * @return The conversion result is returned.
1877 s_chtml20_end_li_tag(void *pdoc, Node *UNUSED(child))
1879 chtml20_t *chtml20 = GET_CHTML20(pdoc);
1880 return chtml20->out;
1885 * It is a handler who processes the HR tag.
1887 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1888 * destination is specified.
1889 * @param node [i] The HR tag node is specified.
1890 * @return The conversion result is returned.
1893 s_chtml20_start_hr_tag(void *pdoc, Node *node)
1900 chtml20 = GET_CHTML20(pdoc);
1906 for (attr = qs_get_attr(doc,node);
1908 attr = qs_get_next_attr(doc,attr)) {
1909 char *name = qs_get_attr_name(doc,attr);
1910 char *value = qs_get_attr_value(doc,attr);
1914 if (strcasecmp(name, "align") == 0) {
1915 /*--------------------------------------------------------------------*/
1917 /*--------------------------------------------------------------------*/
1918 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1928 if (strcasecmp(name, "size") == 0) {
1929 /*--------------------------------------------------------------------*/
1931 /*--------------------------------------------------------------------*/
1932 if (value && value[0] != '\0') {
1942 if (strcasecmp(name, "width") == 0) {
1943 /*--------------------------------------------------------------------*/
1945 /*--------------------------------------------------------------------*/
1946 if (value && value[0] != '\0') {
1956 if (strcasecmp(name, "noshade") == 0) {
1957 /*--------------------------------------------------------------------*/
1959 /*--------------------------------------------------------------------*/
1966 if (strcasecmp(name, "color") == 0) {
1967 /*--------------------------------------------------------------------*/
1969 /*--------------------------------------------------------------------*/
1979 return chtml20->out;
1984 * It is a handler who processes the HR tag.
1986 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1987 * destination is specified.
1988 * @param node [i] The HR tag node is specified.
1989 * @return The conversion result is returned.
1992 s_chtml20_end_hr_tag(void *pdoc, Node *UNUSED(child))
1994 chtml20_t *chtml20 = GET_CHTML20(pdoc);
1995 return chtml20->out;
2000 * It is a handler who processes the IMG tag.
2002 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2003 * destination is specified.
2004 * @param node [i] The IMG tag node is specified.
2005 * @return The conversion result is returned.
2008 s_chtml20_start_img_tag(void *pdoc, Node *node)
2014 #ifndef IMG_NOT_CONVERT_FILENAME
2018 chtml20 = GET_CHTML20(pdoc);
2022 #ifndef IMG_NOT_CONVERT_FILENAME
2023 spec = chtml20->spec;
2027 /*-------------------------------------------------------------------------*/
2028 /* Get Attributes */
2029 /*-------------------------------------------------------------------------*/
2030 for (attr = qs_get_attr(doc,node);
2032 attr = qs_get_next_attr(doc,attr)) {
2033 char *name = qs_get_attr_name(doc,attr);
2034 char *value = qs_get_attr_value(doc,attr);
2038 if (strcasecmp(name, "src") == 0) {
2039 /*-------------------------------------------------------------------*/
2041 /*-------------------------------------------------------------------*/
2042 #ifdef IMG_NOT_CONVERT_FILENAME
2043 value = chxj_encoding_parameter(r, value);
2044 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
2046 value = apr_psprintf(doc->buf.pool,
2049 (strchr(value, '?')) ? '&' : '?',
2050 CHXJ_COOKIE_NOUPDATE_PARAM);
2056 value = chxj_img_conv(r, spec, value);
2057 value = chxj_encoding_parameter(r, value);
2058 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
2060 value = apr_psprintf(doc->buf.pool,
2063 (strchr(value, '?')) ? '&' : '?',
2064 CHXJ_COOKIE_NOUPDATE_PARAM);
2075 if (strcasecmp(name, "align" ) == 0) {
2076 /*--------------------------------------------------------------------*/
2078 /*--------------------------------------------------------------------*/
2080 if (STRCASEEQ('t','T',"top", value) ||
2081 STRCASEEQ('m','M',"middle",value) ||
2082 STRCASEEQ('b','B',"bottom",value) ||
2083 STRCASEEQ('l','L',"left", value) ||
2084 STRCASEEQ('r','R',"right", value)) {
2089 else if (STRCASEEQ('c','C',"center", value)) {
2096 else if (strcasecmp(name, "alt" ) == 0 && value && *value) {
2097 /*--------------------------------------------------------------------*/
2099 /*--------------------------------------------------------------------*/
2108 if (strcasecmp(name, "width" ) == 0 && value && *value) {
2109 /*--------------------------------------------------------------------*/
2111 /*--------------------------------------------------------------------*/
2120 if (strcasecmp(name, "height") == 0 && value && *value) {
2121 /*--------------------------------------------------------------------*/
2123 /*--------------------------------------------------------------------*/
2128 else if (strcasecmp(name, "hspace") == 0 && value && *value) {
2129 /*--------------------------------------------------------------------*/
2131 /*--------------------------------------------------------------------*/
2140 if (strcasecmp(name, "vspace") == 0 && value && *value) {
2141 /*--------------------------------------------------------------------*/
2143 /*--------------------------------------------------------------------*/
2155 return chtml20->out;
2160 * It is a handler who processes the IMG tag.
2162 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2163 * destination is specified.
2164 * @param node [i] The IMG tag node is specified.
2165 * @return The conversion result is returned.
2168 s_chtml20_end_img_tag(void *pdoc, Node *UNUSED(child))
2170 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2172 return chtml20->out;
2177 * It is a handler who processes the SELECT tag.
2179 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2180 * destination is specified.
2181 * @param node [i] The SELECT tag node is specified.
2182 * @return The conversion result is returned.
2185 s_chtml20_start_select_tag(void *pdoc, Node *child)
2192 chtml20 = GET_CHTML20(pdoc);
2198 char *multiple = NULL;
2201 for (attr = qs_get_attr(doc,child);
2203 attr = qs_get_next_attr(doc,attr)) {
2204 char *nm = qs_get_attr_name(doc,attr);
2205 char *val = qs_get_attr_value(doc,attr);
2209 if (strcasecmp(nm, "size") == 0) {
2210 /*--------------------------------------------------------------------*/
2211 /* CHTML 1.0 version 2.0 */
2212 /*--------------------------------------------------------------------*/
2213 size = apr_pstrdup(doc->buf.pool, val);
2219 if (strcasecmp(nm, "name") == 0) {
2220 /*--------------------------------------------------------------------*/
2221 /* CHTML 1.0 version 2.0 */
2222 /*--------------------------------------------------------------------*/
2223 name = apr_pstrdup(doc->buf.pool, val);
2229 if (strcasecmp(nm, "multiple") == 0) {
2230 /*--------------------------------------------------------------------*/
2231 /* CHTML 1.0 version 2.0 */
2232 /*--------------------------------------------------------------------*/
2233 multiple = apr_pstrdup(doc->buf.pool, val);
2241 if (size && *size) {
2246 if (name && *name) {
2255 return chtml20->out;
2260 * It is a handler who processes the SELECT tag.
2262 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2263 * destination is specified.
2264 * @param node [i] The SELECT tag node is specified.
2265 * @return The conversion result is returned.
2268 s_chtml20_end_select_tag(void *pdoc, Node *UNUSED(child))
2273 chtml20 = GET_CHTML20(pdoc);
2277 return chtml20->out;
2282 * It is a handler who processes the OPTION tag.
2284 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2285 * destination is specified.
2286 * @param node [i] The OPTION tag node is specified.
2287 * @return The conversion result is returned.
2290 s_chtml20_start_option_tag(void *pdoc, Node *child)
2297 chtml20 = GET_CHTML20(pdoc);
2301 char *selected = NULL;
2305 for (attr = qs_get_attr(doc,child);
2307 attr = qs_get_next_attr(doc,attr)) {
2308 char *nm = qs_get_attr_name(doc,attr);
2309 char *val = qs_get_attr_value(doc,attr);
2313 if (strcasecmp(nm, "selected") == 0) {
2314 /*--------------------------------------------------------------------*/
2315 /* CHTML 1.0 version 2.0 */
2316 /*--------------------------------------------------------------------*/
2317 selected = apr_pstrdup(doc->buf.pool, val);
2323 if (strcasecmp(nm, "value") == 0) {
2324 /*--------------------------------------------------------------------*/
2325 /* CHTML 1.0 version 2.0 */
2326 /*--------------------------------------------------------------------*/
2327 value = apr_pstrdup(doc->buf.pool, val);
2336 if (value && *value) {
2346 return chtml20->out;
2351 * It is a handler who processes the OPTION tag.
2353 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2354 * destination is specified.
2355 * @param node [i] The OPTION tag node is specified.
2356 * @return The conversion result is returned.
2359 s_chtml20_end_option_tag(void *pdoc, Node *UNUSED(child))
2361 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2365 return chtml20->out;
2370 * It is a handler who processes the DIV tag.
2372 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2373 * destination is specified.
2374 * @param node [i] The DIV tag node is specified.
2375 * @return The conversion result is returned.
2378 s_chtml20_start_div_tag(void *pdoc, Node *child)
2385 chtml20 = GET_CHTML20(pdoc);
2393 for (attr = qs_get_attr(doc,child);
2395 attr = qs_get_next_attr(doc,attr)) {
2396 char *nm = qs_get_attr_name(doc,attr);
2397 char *val = qs_get_attr_value(doc,attr);
2398 if (STRCASEEQ('a','A', "align", nm)) {
2399 /*----------------------------------------------------------------------*/
2400 /* CHTML 1.0 (W3C version 3.2) */
2401 /*----------------------------------------------------------------------*/
2402 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2403 align = apr_pstrdup(doc->buf.pool, val);
2413 return chtml20->out;
2418 * It is a handler who processes the DIV tag.
2420 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2421 * destination is specified.
2422 * @param node [i] The DIV tag node is specified.
2423 * @return The conversion result is returned.
2426 s_chtml20_end_div_tag(void *pdoc, Node *UNUSED(child))
2428 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2429 Doc *doc = chtml20->doc;
2432 return chtml20->out;
2437 * It is a handler who processes the H1 tag.
2439 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2440 * destination is specified.
2441 * @param node [i] The H1 tag node is specified.
2442 * @return The conversion result is returned.
2445 s_chtml20_start_h1_tag(void *pdoc, Node *node)
2452 chtml20 = GET_CHTML20(pdoc);
2457 for (attr = qs_get_attr(doc,node);
2459 attr = qs_get_next_attr(doc,attr)) {
2460 char *name = qs_get_attr_name(doc,attr);
2461 char *value = qs_get_attr_value(doc,attr);
2462 if (STRCASEEQ('a','A',"align", name)) {
2463 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2472 return chtml20->out;
2477 * It is a handler who processes the H1 tag.
2479 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2480 * destination is specified.
2481 * @param node [i] The H1 tag node is specified.
2482 * @return The conversion result is returned.
2485 s_chtml20_end_h1_tag(void *pdoc, Node *UNUSED(child))
2490 chtml20 = GET_CHTML20(pdoc);
2494 return chtml20->out;
2499 * It is a handler who processes the H2 tag.
2501 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2502 * destination is specified.
2503 * @param node [i] The H2 tag node is specified.
2504 * @return The conversion result is returned.
2507 s_chtml20_start_h2_tag(void *pdoc, Node *node)
2514 chtml20 = GET_CHTML20(pdoc);
2519 for (attr = qs_get_attr(doc,node);
2521 attr = qs_get_next_attr(doc,attr)) {
2522 char *name = qs_get_attr_name(doc,attr);
2523 char *value = qs_get_attr_value(doc,attr);
2524 if (STRCASEEQ('a','A',"align", name)) {
2525 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2534 return chtml20->out;
2539 * It is a handler who processes the H2 tag.
2541 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2542 * destination is specified.
2543 * @param node [i] The H2 tag node is specified.
2544 * @return The conversion result is returned.
2547 s_chtml20_end_h2_tag(void *pdoc, Node *UNUSED(child))
2549 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2550 Doc *doc = chtml20->doc;
2554 return chtml20->out;
2559 * It is a handler who processes the H3 tag.
2561 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2562 * destination is specified.
2563 * @param node [i] The H3 tag node is specified.
2564 * @return The conversion result is returned.
2567 s_chtml20_start_h3_tag(void *pdoc, Node *node)
2574 chtml20 = GET_CHTML20(pdoc);
2579 for (attr = qs_get_attr(doc,node);
2581 attr = qs_get_next_attr(doc,attr)) {
2582 char *name = qs_get_attr_name(doc,attr);
2583 char *value = qs_get_attr_value(doc,attr);
2584 if (STRCASEEQ('a','A',"align", name)) {
2585 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2594 return chtml20->out;
2599 * It is a handler who processes the H3 tag.
2601 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2602 * destination is specified.
2603 * @param node [i] The H3 tag node is specified.
2604 * @return The conversion result is returned.
2607 s_chtml20_end_h3_tag(void *pdoc, Node *UNUSED(child))
2609 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2610 Doc *doc = chtml20->doc;
2613 return chtml20->out;
2618 * It is a handler who processes the H4 tag.
2620 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2621 * destination is specified.
2622 * @param node [i] The H4 tag node is specified.
2623 * @return The conversion result is returned.
2626 s_chtml20_start_h4_tag(void *pdoc, Node *node)
2633 chtml20 = GET_CHTML20(pdoc);
2638 for (attr = qs_get_attr(doc,node);
2640 attr = qs_get_next_attr(doc,attr)) {
2641 char *name = qs_get_attr_name(doc,attr);
2642 char *value = qs_get_attr_value(doc,attr);
2643 if (STRCASEEQ('a','A',"align", name)) {
2644 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2653 return chtml20->out;
2658 * It is a handler who processes the H4 tag.
2660 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2661 * destination is specified.
2662 * @param node [i] The H4 tag node is specified.
2663 * @return The conversion result is returned.
2666 s_chtml20_end_h4_tag(void *pdoc, Node *UNUSED(child))
2668 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2669 Doc *doc = chtml20->doc;
2672 return chtml20->out;
2677 * It is a handler who processes the H5 tag.
2679 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2680 * destination is specified.
2681 * @param node [i] The H5 tag node is specified.
2682 * @return The conversion result is returned.
2685 s_chtml20_start_h5_tag(void *pdoc, Node *node)
2692 chtml20 = GET_CHTML20(pdoc);
2697 for (attr = qs_get_attr(doc,node);
2699 attr = qs_get_next_attr(doc,attr)) {
2700 char *name = qs_get_attr_name(doc,attr);
2701 char *value = qs_get_attr_value(doc,attr);
2702 if (STRCASEEQ('a','A',"align", name)) {
2703 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2712 return chtml20->out;
2717 * It is a handler who processes the H5 tag.
2719 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2720 * destination is specified.
2721 * @param node [i] The H5 tag node is specified.
2722 * @return The conversion result is returned.
2725 s_chtml20_end_h5_tag(void *pdoc, Node *UNUSED(child))
2727 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2728 Doc *doc = chtml20->doc;
2731 return chtml20->out;
2736 * It is a handler who processes the H6 tag.
2738 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2739 * destination is specified.
2740 * @param node [i] The H6 tag node is specified.
2741 * @return The conversion result is returned.
2744 s_chtml20_start_h6_tag(void *pdoc, Node *node)
2751 chtml20 = GET_CHTML20(pdoc);
2756 for (attr = qs_get_attr(doc,node);
2758 attr = qs_get_next_attr(doc,attr)) {
2759 char *name = qs_get_attr_name(doc,attr);
2760 char *value = qs_get_attr_value(doc,attr);
2761 if (STRCASEEQ('a','A',"align", name)) {
2762 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2771 return chtml20->out;
2776 * It is a handler who processes the H6 tag.
2778 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2779 * destination is specified.
2780 * @param node [i] The H6 tag node is specified.
2781 * @return The conversion result is returned.
2784 s_chtml20_end_h6_tag(void *pdoc, Node *UNUSED(child))
2786 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2787 Doc *doc = chtml20->doc;
2790 return chtml20->out;
2795 * It is a handler who processes the PRE tag.
2797 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2798 * destination is specified.
2799 * @param node [i] The PRE tag node is specified.
2800 * @return The conversion result is returned.
2803 s_chtml20_start_pre_tag(void *pdoc, Node *UNUSED(node))
2805 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2806 Doc *doc = chtml20->doc;
2808 chtml20->pre_flag++;
2810 return chtml20->out;
2815 * It is a handler who processes the PRE tag.
2817 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2818 * destination is specified.
2819 * @param node [i] The PRE tag node is specified.
2820 * @return The conversion result is returned.
2823 s_chtml20_end_pre_tag(void *pdoc, Node *UNUSED(child))
2825 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2826 Doc *doc = chtml20->doc;
2829 chtml20->pre_flag--;
2831 return chtml20->out;
2836 * It is a handler who processes the P tag.
2838 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2839 * destination is specified.
2840 * @param node [i] The P tag node is specified.
2841 * @return The conversion result is returned.
2844 s_chtml20_start_p_tag(void *pdoc, Node *node)
2852 chtml20 = GET_CHTML20(pdoc);
2857 for (attr = qs_get_attr(doc,node);
2859 attr = qs_get_next_attr(doc,attr)) {
2860 char *nm = qs_get_attr_name(doc,attr);
2861 char *val = qs_get_attr_value(doc,attr);
2862 if (STRCASEEQ('a','A',"align", nm)) {
2863 /*----------------------------------------------------------------------*/
2864 /* CHTML 1.0 (W3C version 3.2) */
2865 /*----------------------------------------------------------------------*/
2866 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2867 align = apr_pstrdup(doc->buf.pool, val);
2878 return chtml20->out;
2883 * It is a handler who processes the P tag.
2885 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2886 * destination is specified.
2887 * @param node [i] The P tag node is specified.
2888 * @return The conversion result is returned.
2891 s_chtml20_end_p_tag(void *pdoc, Node *UNUSED(child))
2897 chtml20 = GET_CHTML20(pdoc);
2902 return chtml20->out;
2907 s_chtml20_chxjif_tag(void *pdoc, Node *node)
2914 chtml20 = GET_CHTML20(pdoc);
2918 for (child = qs_get_child_node(doc, node);
2920 child = qs_get_next_node(doc, child)) {
2923 s_chtml20_chxjif_tag(pdoc, child);
2931 * It is a handler who processes the TEXTARE tag.
2933 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2934 * destination is specified.
2935 * @param node [i] The TEXTAREA tag node is specified.
2936 * @return The conversion result is returned.
2939 s_chtml20_start_textarea_tag(void *pdoc, Node *node)
2946 chtml20 = GET_CHTML20(pdoc);
2950 chtml20->textarea_flag++;
2952 for (attr = qs_get_attr(doc,node);
2954 attr = qs_get_next_attr(doc,attr)) {
2955 char *name = qs_get_attr_name(doc,attr);
2956 char *value = qs_get_attr_value(doc,attr);
2960 if (strcasecmp(name, "accesskey") == 0 && value && *value != 0) {
2961 W_L(" accesskey=\"");
2969 if (strcasecmp(name, "name") == 0 && value && *value != 0) {
2978 if (strcasecmp(name, "rows") == 0 && value && *value != 0) {
2987 if (strcasecmp(name, "cols") == 0 && value && *value != 0) {
2996 if (strcasecmp(name, "istyle") == 0 && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
3008 return chtml20->out;
3013 * It is a handler who processes the TEXTAREA tag.
3015 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3016 * destination is specified.
3017 * @param node [i] The TEXTAREA tag node is specified.
3018 * @return The conversion result is returned.
3021 s_chtml20_end_textarea_tag(void *pdoc, Node *UNUSED(child))
3023 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3024 Doc *doc = chtml20->doc;
3027 chtml20->textarea_flag--;
3029 return chtml20->out;
3034 s_chtml20_text_tag(void *pdoc, Node *child)
3046 chtml20 = GET_CHTML20(pdoc);
3050 textval = qs_get_node_value(doc,child);
3051 if (strlen(textval) == 0) {
3052 return chtml20->out;
3055 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
3056 memset(tmp, 0, qs_get_node_size(doc,child)+1);
3058 tdst = qs_alloc_zero_byte_string(doc->buf.pool);
3059 memset(one_byte, 0, sizeof(one_byte));
3062 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
3064 int rtn = s_chtml20_search_emoji(chtml20, &textval[ii], &out);
3066 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
3070 if (is_sjis_kanji(textval[ii])) {
3071 one_byte[0] = textval[ii+0];
3072 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3073 one_byte[0] = textval[ii+1];
3074 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3078 if (chtml20->pre_flag) {
3079 one_byte[0] = textval[ii+0];
3080 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3083 if (chtml20->textarea_flag) {
3084 one_byte[0] = textval[ii+0];
3085 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3088 if (textval[ii] != '\r' && textval[ii] != '\n') {
3089 one_byte[0] = textval[ii+0];
3090 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3094 return chtml20->out;
3099 * It is a handler who processes the BLOCKQUOTE tag.
3101 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3102 * destination is specified.
3103 * @param node [i] The BLOCKQUOTE tag node is specified.
3104 * @return The conversion result is returned.
3107 s_chtml20_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
3109 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3110 Doc *doc = chtml20->doc;
3111 W_L("<blockquote>");
3112 return chtml20->out;
3117 * It is a handler who processes the BLOCKQUOTE tag.
3119 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3120 * destination is specified.
3121 * @param node [i] The BLOCKQUOTE tag node is specified.
3122 * @return The conversion result is returned.
3125 s_chtml20_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
3127 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3128 Doc *doc = chtml20->doc;
3129 W_L("</blockquote>");
3130 return chtml20->out;
3135 * It is a handler who processes the DIR tag.
3137 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3138 * destination is specified.
3139 * @param node [i] The DIR tag node is specified.
3140 * @return The conversion result is returned.
3143 s_chtml20_start_dir_tag(void *pdoc, Node *UNUSED(child))
3145 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3146 Doc *doc = chtml20->doc;
3148 return chtml20->out;
3153 * It is a handler who processes the DIR tag.
3155 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3156 * destination is specified.
3157 * @param node [i] The DIR tag node is specified.
3158 * @return The conversion result is returned.
3161 s_chtml20_end_dir_tag(void *pdoc, Node *UNUSED(child))
3163 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3164 Doc *doc = chtml20->doc;
3167 return chtml20->out;
3172 * It is a handler who processes the DL tag.
3174 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3175 * destination is specified.
3176 * @param node [i] The DL tag node is specified.
3177 * @return The conversion result is returned.
3180 s_chtml20_start_dl_tag(void *pdoc, Node *UNUSED(child))
3182 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3183 Doc *doc = chtml20->doc;
3185 return chtml20->out;
3190 * It is a handler who processes the DL tag.
3192 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3193 * destination is specified.
3194 * @param node [i] The DL tag node is specified.
3195 * @return The conversion result is returned.
3198 s_chtml20_end_dl_tag(void *pdoc, Node *UNUSED(child))
3200 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3201 Doc *doc = chtml20->doc;
3203 return chtml20->out;
3208 * It is a handter who processes the DT tag.
3210 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3211 * destination is specified.
3212 * @param node [i] The DT tag node is specified.
3213 * @return The conversion result is returned.
3216 s_chtml20_start_dt_tag(void *pdoc, Node *UNUSED(child))
3218 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3219 Doc *doc = chtml20->doc;
3221 return chtml20->out;
3226 * It is a handter who processes the DT tag.
3228 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3229 * destination is specified.
3230 * @param node [i] The DT tag node is specified.
3231 * @return The conversion result is returned.
3234 s_chtml20_end_dt_tag(void *pdoc, Node *UNUSED(child))
3236 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3238 return chtml20->out;
3243 * It is a handder who processes the DD tag.
3245 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3246 * destination is specified.
3247 * @param node [i] The DD tag node is specified.
3248 * @return The conversion result is returned.
3251 s_chtml20_start_dd_tag(void *pdoc, Node *UNUSED(child))
3253 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3254 Doc *doc = chtml20->doc;
3256 return chtml20->out;
3261 * It is a handder who processes the DD tag.
3263 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3264 * destination is specified.
3265 * @param node [i] The DD tag node is specified.
3266 * @return The conversion result is returned.
3269 s_chtml20_end_dd_tag(void *pdoc, Node *UNUSED(child))
3271 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3273 return chtml20->out;
3278 * It is a hanmenuer who processes the MENU tag.
3280 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3281 * destination is specified.
3282 * @param node [i] The MENU tag node is specified.
3283 * @return The conversion result is returned.
3286 s_chtml20_start_menu_tag(void *pdoc, Node *UNUSED(child))
3288 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3289 Doc *doc = chtml20->doc;
3292 return chtml20->out;
3297 * It is a hanmenuer who processes the MENU tag.
3299 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3300 * destination is specified.
3301 * @param node [i] The MENU tag node is specified.
3302 * @return The conversion result is returned.
3305 s_chtml20_end_menu_tag(void *pdoc, Node *UNUSED(child))
3307 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3308 Doc *doc = chtml20->doc;
3311 return chtml20->out;
3316 * It is a hanplaintexter who processes the PLAINTEXT tag.
3318 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3319 * destination is specified.
3320 * @param node [i] The PLAINTEXT tag node is specified.
3321 * @return The conversion result is returned.
3324 s_chtml20_start_plaintext_tag(void *pdoc, Node *node)
3326 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3327 Doc *doc = chtml20->doc;
3330 s_chtml20_start_plaintext_tag_inner(pdoc,node);
3331 return chtml20->out;
3335 s_chtml20_start_plaintext_tag_inner(void *pdoc, Node *node)
3337 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3338 Doc *doc = chtml20->doc;
3341 for (child = qs_get_child_node(doc, node);
3343 child = qs_get_next_node(doc, child)) {
3345 s_chtml20_start_plaintext_tag_inner(pdoc, child);
3347 return chtml20->out;
3352 * It is a hanplaintexter who processes the PLAINTEXT tag.
3354 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3355 * destination is specified.
3356 * @param node [i] The PLAINTEXT tag node is specified.
3357 * @return The conversion result is returned.
3360 s_chtml20_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3362 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3363 return chtml20->out;
3367 * It is a hanblinker who processes the BLINK tag.
3369 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3370 * destination is specified.
3371 * @param node [i] The BLINK tag node is specified.
3372 * @return The conversion result is returned.
3375 s_chtml20_start_blink_tag(void *pdoc, Node *UNUSED(child))
3377 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3378 Doc *doc = chtml20->doc;
3380 return chtml20->out;
3385 * It is a hanblinker who processes the BLINK tag.
3387 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3388 * destination is specified.
3389 * @param node [i] The BLINK tag node is specified.
3390 * @return The conversion result is returned.
3393 s_chtml20_end_blink_tag(void *pdoc, Node *UNUSED(child))
3395 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3396 Doc *doc = chtml20->doc;
3398 return chtml20->out;
3403 * It is a hanmarqueeer who processes the MARQUEE tag.
3405 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3406 * destination is specified.
3407 * @param node [i] The MARQUEE tag node is specified.
3408 * @return The conversion result is returned.
3411 s_chtml20_start_marquee_tag(void *pdoc, Node *node)
3413 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3414 Doc *doc = chtml20->doc;
3417 /*--------------------------------------------------------------------------*/
3418 /* Get Attributes */
3419 /*--------------------------------------------------------------------------*/
3420 for (attr = qs_get_attr(doc,node);
3422 attr = qs_get_next_attr(doc,attr)) {
3423 char *name = qs_get_attr_name(doc,attr);
3424 char *value = qs_get_attr_value(doc,attr);
3425 if (STRCASEEQ('d','D',"direction", name)) {
3426 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3427 W_L(" direction=\"");
3432 else if (STRCASEEQ('b','B',"behavior",name)) {
3433 if (value && (STRCASEEQ('s','S',"scroll",value) || STRCASEEQ('s','S',"slide",value) || STRCASEEQ('a','A',"alternate",value))) {
3434 W_L(" behavior=\"");
3439 else if (STRCASEEQ('l','L',"loop",name)) {
3440 if (value && *value) {
3448 return chtml20->out;
3453 * It is a hanmarqueeer who processes the MARQUEE tag.
3455 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3456 * destination is specified.
3457 * @param node [i] The MARQUEE tag node is specified.
3458 * @return The conversion result is returned.
3461 s_chtml20_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3463 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3464 Doc *doc = chtml20->doc;
3466 return chtml20->out;
3471 * * It is handler who processes the New Line Code.
3474 s_chtml20_newline_mark(void *pdoc, Node *UNUSED(node))
3476 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3477 Doc *doc = chtml20->doc;
3479 return chtml20->out;