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);
116 static void s_init_chtml20(chtml20_t *chtml, Doc *doc, request_rec *r, device_table *spec);
118 static int s_chtml20_search_emoji(chtml20_t *chtml, char *txt, char **rslt);
120 static char *s_chtml20_chxjif_tag(void *pdoc, Node *node);
121 static char *s_chtml20_text_tag(void *pdoc, Node *node);
124 tag_handler chtml20_handler[] = {
127 s_chtml20_start_html_tag,
128 s_chtml20_end_html_tag,
132 s_chtml20_start_meta_tag,
133 s_chtml20_end_meta_tag,
137 s_chtml20_start_textarea_tag,
138 s_chtml20_end_textarea_tag,
142 s_chtml20_start_p_tag,
147 s_chtml20_start_pre_tag,
148 s_chtml20_end_pre_tag,
152 s_chtml20_start_ul_tag,
153 s_chtml20_end_ul_tag,
157 s_chtml20_start_li_tag,
158 s_chtml20_end_li_tag,
162 s_chtml20_start_ol_tag,
163 s_chtml20_end_ol_tag,
167 s_chtml20_start_h1_tag,
168 s_chtml20_end_h1_tag,
172 s_chtml20_start_h2_tag,
173 s_chtml20_end_h2_tag,
177 s_chtml20_start_h3_tag,
178 s_chtml20_end_h3_tag,
182 s_chtml20_start_h4_tag,
183 s_chtml20_end_h4_tag,
187 s_chtml20_start_h5_tag,
188 s_chtml20_end_h5_tag,
192 s_chtml20_start_h6_tag,
193 s_chtml20_end_h6_tag,
197 s_chtml20_start_head_tag,
198 s_chtml20_end_head_tag,
202 s_chtml20_start_title_tag,
203 s_chtml20_end_title_tag,
207 s_chtml20_start_base_tag,
208 s_chtml20_end_base_tag,
212 s_chtml20_start_body_tag,
213 s_chtml20_end_body_tag,
217 s_chtml20_start_a_tag,
222 s_chtml20_start_br_tag,
223 s_chtml20_end_br_tag,
232 s_chtml20_start_tr_tag,
233 s_chtml20_end_tr_tag,
247 s_chtml20_start_font_tag,
248 s_chtml20_end_font_tag,
252 s_chtml20_start_form_tag,
253 s_chtml20_end_form_tag,
257 s_chtml20_start_input_tag,
258 s_chtml20_end_input_tag,
262 s_chtml20_start_center_tag,
263 s_chtml20_end_center_tag,
267 s_chtml20_start_hr_tag,
268 s_chtml20_end_hr_tag,
272 s_chtml20_start_img_tag,
273 s_chtml20_end_img_tag,
277 s_chtml20_start_select_tag,
278 s_chtml20_end_select_tag,
282 s_chtml20_start_option_tag,
283 s_chtml20_end_option_tag,
287 s_chtml20_start_div_tag,
288 s_chtml20_end_div_tag,
292 s_chtml20_chxjif_tag,
337 s_chtml20_start_dt_tag,
338 s_chtml20_end_dt_tag,
352 s_chtml20_start_blockquote_tag,
353 s_chtml20_end_blockquote_tag,
357 s_chtml20_start_dir_tag,
358 s_chtml20_end_dir_tag,
362 s_chtml20_start_dl_tag,
363 s_chtml20_end_dl_tag,
367 s_chtml20_start_dd_tag,
368 s_chtml20_end_dd_tag,
372 s_chtml20_start_menu_tag,
373 s_chtml20_end_menu_tag,
377 s_chtml20_start_plaintext_tag,
378 s_chtml20_end_plaintext_tag,
382 s_chtml20_start_blink_tag,
383 s_chtml20_end_blink_tag,
387 s_chtml20_start_marquee_tag,
388 s_chtml20_end_marquee_tag,
393 * converts from CHTML5.0 to CHTML2.0.
395 * @param r [i] Requet_rec is appointed.
396 * @param spec [i] The result of the device specification processing which
397 * was done in advance is appointed.
398 * @param src [i] The character string before the converting is appointed.
399 * @return The character string after the converting is returned.
402 chxj_convert_chtml20(
408 chxjconvrule_entry *entryp,
417 /*--------------------------------------------------------------------------*/
419 /*--------------------------------------------------------------------------*/
421 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
423 DBG(r,"i found qrcode xml");
426 DBG(r,"not found qrcode xml");
428 /*--------------------------------------------------------------------------*/
429 /* The CHTML structure is initialized. */
430 /*--------------------------------------------------------------------------*/
431 s_init_chtml20(&chtml20, &doc, r, spec);
434 chtml20.entryp = entryp;
435 chtml20.cookie = cookie;
437 chxj_set_content_type(r, "text/html; charset=Windows-31J");
439 /*--------------------------------------------------------------------------*/
440 /* The character string of the input is analyzed. */
441 /*--------------------------------------------------------------------------*/
442 qs_init_malloc(&doc);
443 qs_init_root_node(&doc);
445 ss = apr_pcalloc(r->pool, srclen + 1);
446 memset(ss, 0, srclen + 1);
447 memcpy(ss, src, srclen);
450 chxj_dump_out("[src] CHTML -> CHTML2.0", ss, srclen);
453 qs_parse_string(&doc,ss, strlen(ss));
455 chxj_buffered_write_init(r->pool, &doc.buf);
456 /*--------------------------------------------------------------------------*/
457 /* It converts it from CHTML to CHTML. */
458 /*--------------------------------------------------------------------------*/
459 chxj_node_convert(spec,r,(void *)&chtml20, &doc, qs_get_root(&doc), 0);
460 chtml20.out = chxj_buffered_write_flush(chtml20.out, &doc.buf);
461 dst = apr_pstrdup(r->pool, chtml20.out);
462 chxj_buffered_write_terminate(&doc.buf);
464 qs_all_free(&doc,QX_LOGMARK);
467 return apr_pstrdup(r->pool,ss);
470 if (strlen(dst) == 0) {
471 dst = apr_psprintf(r->pool, "\n");
474 *dstlen = strlen(dst);
477 chxj_dump_out("[dst] CHTML -> CHTML2.0", dst, *dstlen);
484 * The CHTML structure is initialized.
486 * @param chtml20 [i/o] The pointer to the HDML structure that wants to be
487 * initialized is specified.
488 * @param doc [i] The Doc structure that should be set to the initialized
489 * HDML structure is specified.
490 * @param r [i] To use POOL, the pointer to request_rec is specified.
491 * @param spec [i] The pointer to the device_table
494 s_init_chtml20(chtml20_t *chtml20, Doc *doc, request_rec *r, device_table *spec)
496 memset(doc, 0, sizeof(Doc));
497 memset(chtml20, 0, sizeof(chtml20_t));
501 chtml20->spec = spec;
502 chtml20->out = qs_alloc_zero_byte_string(r->pool);
503 chtml20->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
505 chtml20->doc->parse_mode = PARSE_MODE_CHTML;
510 * Corresponding EMOJI to a current character-code is retrieved.
511 * The substitution character string is stored in the rslt pointer if agreeing.
513 * @param chtml20 [i] The pointer to the CHTML structure is specified.
514 * @param txt [i] The character string to want to examine whether it is
515 * EMOJI is specified.
516 * @param rslt [o] The pointer to the pointer that stores the result is
518 * @return When corresponding EMOJI exists, it returns it excluding 0.
521 s_chtml20_search_emoji(chtml20_t *chtml20, char *txt, char **rslt)
528 spec = chtml20->spec;
534 DBG(r,"spec is NULL");
536 for (ee = chtml20->conf->emoji;
540 if (ee->imode == NULL) {
541 DBG(r,"emoji->imode is NULL");
545 if (ee->imode->string != NULL
546 && strlen(ee->imode->string) > 0
547 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
548 if (spec == NULL || spec->emoji_type == NULL) {
549 *rslt = apr_palloc(r->pool, 3);
550 (*rslt)[0] = ee->imode->hex1byte & 0xff;
551 (*rslt)[1] = ee->imode->hex2byte & 0xff;
553 return strlen(ee->imode->string);
565 * It is a handler who processes the HTML tag.
567 * @param pdoc [i/o] The pointer to the CHTML structure at the output
568 * destination is specified.
569 * @param node [i] The HTML tag node is specified.
570 * @return The conversion result is returned.
573 s_chtml20_start_html_tag(void *pdoc, Node *UNUSED(node))
579 chtml20 = GET_CHTML20(pdoc);
583 /*--------------------------------------------------------------------------*/
585 /*--------------------------------------------------------------------------*/
593 * It is a handler who processes the HTML tag.
595 * @param pdoc [i/o] The pointer to the CHTML structure at the output
596 * destination is specified.
597 * @param node [i] The HTML tag node is specified.
598 * @return The conversion result is returned.
601 s_chtml20_end_html_tag(void *pdoc, Node *UNUSED(child))
607 chtml20 = GET_CHTML20(pdoc);
618 * It is a handler who processes the META tag.
620 * @param pdoc [i/o] The pointer to the CHTML structure at the output
621 * destination is specified.
622 * @param node [i] The META tag node is specified.
623 * @return The conversion result is returned.
626 s_chtml20_start_meta_tag(void *pdoc, Node *node)
632 int content_type_flag;
635 chtml20 = GET_CHTML20(pdoc);
639 content_type_flag = 0;
643 /*--------------------------------------------------------------------------*/
645 /*--------------------------------------------------------------------------*/
646 for (attr = qs_get_attr(doc,node);
648 attr = qs_get_next_attr(doc,attr)) {
649 char *name = qs_get_attr_name(doc,attr);
650 char *value = qs_get_attr_value(doc,attr);
654 if (strcasecmp(name, "http-equiv") == 0 && value && *value) {
655 /*----------------------------------------------------------------------*/
657 /*----------------------------------------------------------------------*/
658 W_L(" http-equiv=\"");
661 if (STRCASEEQ('c','C',"content-type", value)) {
662 content_type_flag = 1;
664 if (STRCASEEQ('r','R',"refresh", value)) {
672 if (strcasecmp(name, "content") == 0 && value && *value) {
673 if (content_type_flag) {
676 W_L("=\"text/html; charset=Windows-31J\"");
678 else if (refresh_flag) {
679 char *buf = apr_pstrdup(r->pool, value);
683 url = strchr(buf, ';');
685 sec = apr_pstrdup(r->pool, buf);
688 url = chxj_encoding_parameter(r, url);
689 url = chxj_add_cookie_parameter(r, url, chtml20->cookie);
721 * It is a handler who processes the META tag.
723 * @param pdoc [i/o] The pointer to the CHTML structure at the output
724 * destination is specified.
725 * @param node [i] The META tag node is specified.
726 * @return The conversion result is returned.
729 s_chtml20_end_meta_tag(void *pdoc, Node *UNUSED(child))
731 chtml20_t *chtml20 = GET_CHTML20(pdoc);
738 * It is a handler who processes the HEAD tag.
740 * @param pdoc [i/o] The pointer to the CHTML structure at the output
741 * destination is specified.
742 * @param node [i] The HEAD tag node is specified.
743 * @return The conversion result is returned.
746 s_chtml20_start_head_tag(void *pdoc, Node *UNUSED(node))
751 chtml20 = GET_CHTML20(pdoc);
762 * It is a handler who processes the HEAD tag.
764 * @param pdoc [i/o] The pointer to the CHTML structure at the output
765 * destination is specified.
766 * @param node [i] The HEAD tag node is specified.
767 * @return The conversion result is returned.
770 s_chtml20_end_head_tag(void *pdoc, Node *UNUSED(child))
776 chtml20 = GET_CHTML20(pdoc);
788 * It is a handler who processes the TITLE tag.
790 * @param pdoc [i/o] The pointer to the CHTML structure at the output
791 * destination is specified.
792 * @param node [i] The TITLE tag node is specified.
793 * @return The conversion result is returned.
796 s_chtml20_start_title_tag(void *pdoc, Node *UNUSED(node))
802 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);
840 * It is a handler who processes the BASE tag.
842 * @param pdoc [i/o] The pointer to the CHTML structure at the output
843 * destination is specified.
844 * @param node [i] The BASE tag node is specified.
845 * @return The conversion result is returned.
848 s_chtml20_start_base_tag(void *pdoc, Node *node)
855 chtml20 = GET_CHTML20(pdoc);
860 /*--------------------------------------------------------------------------*/
862 /*--------------------------------------------------------------------------*/
863 for (attr = qs_get_attr(doc,node);
865 attr = qs_get_next_attr(doc,attr)) {
866 char *name = qs_get_attr_name(doc,attr);
867 char *value = qs_get_attr_value(doc,attr);
868 if (STRCASEEQ('h','H',"href", name)) {
882 * It is a handler who processes the BASE tag.
884 * @param pdoc [i/o] The pointer to the CHTML structure at the output
885 * destination is specified.
886 * @param node [i] The BASE tag node is specified.
887 * @return The conversion result is returned.
890 s_chtml20_end_base_tag(void *pdoc, Node *UNUSED(child))
896 chtml20 = GET_CHTML20(pdoc);
905 * It is a handler who processes the BODY tag.
907 * @param pdoc [i/o] The pointer to the CHTML structure at the output
908 * destination is specified.
909 * @param node [i] The BODY tag node is specified.
910 * @return The conversion result is returned.
913 s_chtml20_start_body_tag(void *pdoc, Node *node)
920 chtml20 = GET_CHTML20(pdoc);
925 /*--------------------------------------------------------------------------*/
927 /*--------------------------------------------------------------------------*/
928 for (attr = qs_get_attr(doc,node);
930 attr = qs_get_next_attr(doc,attr)) {
931 char *name = qs_get_attr_name(doc,attr);
932 char *value = qs_get_attr_value(doc,attr);
936 if (strcasecmp(name, "bgcolor") == 0 && value && *value != 0) {
937 /*----------------------------------------------------------------------*/
939 /*----------------------------------------------------------------------*/
948 if (strcasecmp(name, "text") == 0 && value && *value != 0) {
949 /*----------------------------------------------------------------------*/
951 /*----------------------------------------------------------------------*/
960 if (strcasecmp(name, "link") == 0 && value && *value != 0) {
961 /*----------------------------------------------------------------------*/
963 /*----------------------------------------------------------------------*/
972 if (strcasecmp(name, "alink") == 0) {
973 /*----------------------------------------------------------------------*/
975 /*----------------------------------------------------------------------*/
982 if (strcasecmp(name, "vlink") == 0) {
983 /*----------------------------------------------------------------------*/
985 /*----------------------------------------------------------------------*/
1002 * It is a handler who processes the BODY tag.
1004 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1005 * destination is specified.
1006 * @param node [i] The BODY tag node is specified.
1007 * @return The conversion result is returned.
1010 s_chtml20_end_body_tag(void *pdoc, Node *UNUSED(child))
1016 chtml20 = GET_CHTML20(pdoc);
1023 return chtml20->out;
1028 * It is a handler who processes the A tag.
1030 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1031 * destination is specified.
1032 * @param node [i] The A tag node is specified.
1033 * @return The conversion result is returned.
1036 s_chtml20_start_a_tag(void *pdoc, Node *node)
1043 chtml20 = GET_CHTML20(pdoc);
1048 /*--------------------------------------------------------------------------*/
1049 /* Get Attributes */
1050 /*--------------------------------------------------------------------------*/
1051 for (attr = qs_get_attr(doc,node);
1053 attr = qs_get_next_attr(doc,attr)) {
1054 char *name = qs_get_attr_name(doc,attr);
1055 char *value = qs_get_attr_value(doc,attr);
1059 if (strcasecmp(name, "name") == 0) {
1060 /*--------------------------------------------------------------------*/
1062 /*--------------------------------------------------------------------*/
1071 if (strcasecmp(name, "href") == 0) {
1072 /*--------------------------------------------------------------------*/
1074 /*--------------------------------------------------------------------*/
1075 value = chxj_encoding_parameter(r, value);
1076 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
1085 if (strcasecmp(name, "accesskey") == 0) {
1086 /*--------------------------------------------------------------------*/
1088 /*--------------------------------------------------------------------*/
1089 W_L(" accesskey=\"");
1097 if (strcasecmp(name, "cti") == 0) {
1098 /*--------------------------------------------------------------------*/
1100 /*--------------------------------------------------------------------*/
1109 if (strcasecmp(name, "ijam") == 0) {
1110 /*--------------------------------------------------------------------*/
1112 /*--------------------------------------------------------------------*/
1116 if (strcasecmp(name, "ista") == 0) {
1117 /*--------------------------------------------------------------------*/
1119 /*--------------------------------------------------------------------*/
1123 if (strcasecmp(name, "ilet") == 0) {
1124 /*--------------------------------------------------------------------*/
1126 /*--------------------------------------------------------------------*/
1130 if (strcasecmp(name, "iswf") == 0) {
1131 /*--------------------------------------------------------------------*/
1133 /*--------------------------------------------------------------------*/
1137 if (strcasecmp(name, "irst") == 0) {
1138 /*--------------------------------------------------------------------*/
1140 /*--------------------------------------------------------------------*/
1147 if (strcasecmp(name, "utn") == 0) {
1148 /*--------------------------------------------------------------------*/
1150 /*--------------------------------------------------------------------*/
1157 if (strcasecmp(name, "telbook") == 0) {
1158 /*--------------------------------------------------------------------*/
1160 /*--------------------------------------------------------------------*/
1167 if (strcasecmp(name, "kana") == 0) {
1168 /*--------------------------------------------------------------------*/
1170 /*--------------------------------------------------------------------*/
1177 if (strcasecmp(name, "email") == 0) {
1178 /*--------------------------------------------------------------------*/
1180 /*--------------------------------------------------------------------*/
1190 return chtml20->out;
1195 * It is a handler who processes the A tag.
1197 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1198 * destination is specified.
1199 * @param node [i] The A tag node is specified.
1200 * @return The conversion result is returned.
1203 s_chtml20_end_a_tag(void *pdoc, Node *UNUSED(child))
1209 chtml20 = GET_CHTML20(pdoc);
1216 return chtml20->out;
1221 * It is a handler who processes the BR tag.
1223 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1224 * destination is specified.
1225 * @param node [i] The BR tag node is specified.
1226 * @return The conversion result is returned.
1229 s_chtml20_start_br_tag(void *pdoc, Node *node)
1236 chtml20 = GET_CHTML20(pdoc);
1241 /*--------------------------------------------------------------------------*/
1242 /* Get Attributes */
1243 /*--------------------------------------------------------------------------*/
1244 for (attr = qs_get_attr(doc,node);
1246 attr = qs_get_next_attr(doc,attr)) {
1247 char *name = qs_get_attr_name(doc,attr);
1248 char *value = qs_get_attr_value(doc,attr);
1249 if (STRCASEEQ('c','C',"clear",name)) {
1250 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1260 return chtml20->out;
1265 * It is a handler who processes the BR tag.
1267 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1268 * destination is specified.
1269 * @param node [i] The BR tag node is specified.
1270 * @return The conversion result is returned.
1273 s_chtml20_end_br_tag(void *pdoc, Node *UNUSED(child))
1279 chtml20 = GET_CHTML20(pdoc);
1283 return chtml20->out;
1288 * It is a handler who processes the TR tag.
1290 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1291 * destination is specified.
1292 * @param node [i] The TR tag node is specified.
1293 * @return The conversion result is returned.
1296 s_chtml20_start_tr_tag(void *pdoc, Node *UNUSED(node))
1302 chtml20 = GET_CHTML20(pdoc);
1306 return chtml20->out;
1311 * It is a handler who processes the TR tag.
1313 * @param chtml20 [i/o] The pointer to the CHTML structure at the output
1314 * destination is specified.
1315 * @param node [i] The TR tag node is specified.
1316 * @return The conversion result is returned.
1319 s_chtml20_end_tr_tag(void *pdoc, Node *UNUSED(child))
1325 chtml20 = GET_CHTML20(pdoc);
1332 return chtml20->out;
1337 * It is a handler who processes the FONT tag.
1339 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1340 * destination is specified.
1341 * @param node [i] The FONT tag node is specified.
1342 * @return The conversion result is returned.
1345 s_chtml20_start_font_tag(void *pdoc, Node *node)
1353 chtml20 = GET_CHTML20(pdoc);
1358 /*--------------------------------------------------------------------------*/
1359 /* Get Attributes */
1360 /*--------------------------------------------------------------------------*/
1361 for (attr = qs_get_attr(doc,node);
1362 attr && color == NULL;
1363 attr = qs_get_next_attr(doc,attr)) {
1364 char *name = qs_get_attr_name(doc,attr);
1365 char *value = qs_get_attr_value(doc,attr);
1369 if (strcasecmp(name, "color") == 0 && value && *value) {
1370 color = apr_pstrdup(doc->buf.pool, value);
1376 if (strcasecmp(name, "size") == 0) {
1377 /*--------------------------------------------------------------------*/
1379 /*--------------------------------------------------------------------*/
1389 W_L("<font color=\"");
1392 chtml20->font_flag++;
1394 return chtml20->out;
1399 * It is a handler who processes the FONT tag.
1401 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1402 * destination is specified.
1403 * @param node [i] The FONT tag node is specified.
1404 * @return The conversion result is returned.
1407 s_chtml20_end_font_tag(void *pdoc, Node *UNUSED(child))
1413 chtml20 = GET_CHTML20(pdoc);
1417 if (chtml20->font_flag) {
1419 chtml20->font_flag--;
1421 return chtml20->out;
1426 * It is a handler who processes the FORM tag.
1428 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1429 * destination is specified.
1430 * @param node [i] The FORM tag node is specified.
1431 * @return The conversion result is returned.
1434 s_chtml20_start_form_tag(void *pdoc, Node *node)
1441 chtml20 = GET_CHTML20(pdoc);
1446 /*--------------------------------------------------------------------------*/
1447 /* Get Attributes */
1448 /*--------------------------------------------------------------------------*/
1449 for (attr = qs_get_attr(doc,node);
1451 attr = qs_get_next_attr(doc,attr)) {
1452 char *name = qs_get_attr_name(doc,attr);
1453 char *value = qs_get_attr_value(doc,attr);
1457 if (strcasecmp(name, "action") == 0) {
1458 /*--------------------------------------------------------------------*/
1460 /*--------------------------------------------------------------------*/
1461 value = chxj_encoding_parameter(r, value);
1462 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
1472 if (strcasecmp(name, "method") == 0) {
1473 /*--------------------------------------------------------------------*/
1475 /*--------------------------------------------------------------------*/
1484 if (strcasecmp(name, "utn") == 0) {
1485 /*--------------------------------------------------------------------*/
1487 /*--------------------------------------------------------------------*/
1499 return chtml20->out;
1504 * It is a handler who processes the FORM tag.
1506 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1507 * destination is specified.
1508 * @param node [i] The FORM tag node is specified.
1509 * @return The conversion result is returned.
1512 s_chtml20_end_form_tag(void *pdoc, Node *UNUSED(child))
1518 chtml20 = GET_CHTML20(pdoc);
1525 return chtml20->out;
1530 * It is a handler who processes the INPUT tag.
1532 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1533 * destination is specified.
1534 * @param node [i] The INPUT tag node is specified.
1535 * @return The conversion result is returned.
1538 s_chtml20_start_input_tag(void *pdoc, Node *node)
1543 char *max_length = NULL;
1547 char *istyle = NULL;
1549 char *checked = NULL;
1550 char *accesskey = NULL;
1552 chtml20 = GET_CHTML20(pdoc);
1558 /*--------------------------------------------------------------------------*/
1559 /* Get Attributes */
1560 /*--------------------------------------------------------------------------*/
1561 type = qs_get_type_attr(doc, node, doc->buf.pool);
1562 name = qs_get_name_attr(doc, node, doc->buf.pool);
1563 value = qs_get_value_attr(doc,node,doc->buf.pool);
1564 istyle = qs_get_istyle_attr(doc,node,doc->buf.pool);
1565 max_length = qs_get_maxlength_attr(doc,node,doc->buf.pool);
1566 checked = qs_get_checked_attr(doc,node,doc->buf.pool);
1567 accesskey = qs_get_accesskey_attr(doc, node, doc->buf.pool);
1568 size = qs_get_size_attr(doc, node, doc->buf.pool);
1571 type = qs_trim_string(doc->buf.pool, type);
1572 if (type && (STRCASEEQ('t','T',"text", type) ||
1573 STRCASEEQ('p','P',"password",type) ||
1574 STRCASEEQ('c','C',"checkbox",type) ||
1575 STRCASEEQ('r','R',"radio", type) ||
1576 STRCASEEQ('h','H',"hidden", type) ||
1577 STRCASEEQ('s','S',"submit", type) ||
1578 STRCASEEQ('r','R',"reset", type))) {
1584 if (size && *size) {
1589 if (name && *name) {
1594 if (value && *value) {
1599 if (accesskey && *accesskey) {
1600 W_L(" accesskey=\"");
1605 /*------------------------------------------------------------------------*/
1607 /*------------------------------------------------------------------------*/
1608 if (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4') {
1614 /*--------------------------------------------------------------------------*/
1615 /* The figure is default for the password. */
1616 /*--------------------------------------------------------------------------*/
1617 if (max_length && *max_length) {
1618 if (chxj_chk_numeric(max_length) != 0) {
1619 max_length = apr_psprintf(doc->buf.pool, "0");
1621 if (istyle && *istyle == '1') {
1622 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length) * 2);
1626 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length));
1636 return chtml20->out;
1641 * It is a handler who processes the INPUT tag.
1643 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1644 * destination is specified.
1645 * @param node [i] The INPUT tag node is specified.
1646 * @return The conversion result is returned.
1649 s_chtml20_end_input_tag(void *pdoc, Node *UNUSED(child))
1655 chtml20 = GET_CHTML20(pdoc);
1659 return chtml20->out;
1664 * It is a handler who processes the CENTER tag.
1666 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1667 * destination is specified.
1668 * @param node [i] The CENTER tag node is specified.
1669 * @return The conversion result is returned.
1672 s_chtml20_start_center_tag(void *pdoc, Node *UNUSED(node))
1678 chtml20 = GET_CHTML20(pdoc);
1683 return chtml20->out;
1688 * It is a handler who processes the CENTER tag.
1690 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1691 * destination is specified.
1692 * @param node [i] The CENTER tag node is specified.
1693 * @return The conversion result is returned.
1696 s_chtml20_end_center_tag(void *pdoc, Node *UNUSED(child))
1702 chtml20 = GET_CHTML20(pdoc);
1709 return chtml20->out;
1714 * It is a handler who processes the UL tag.
1716 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1717 * destination is specified.
1718 * @param node [i] The UL tag node is specified.
1719 * @return The conversion result is returned.
1722 s_chtml20_start_ul_tag(void *pdoc, Node *UNUSED(node))
1728 chtml20 = GET_CHTML20(pdoc);
1735 return chtml20->out;
1740 * It is a handler who processes the UL tag.
1742 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1743 * destination is specified.
1744 * @param node [i] The UL tag node is specified.
1745 * @return The conversion result is returned.
1748 s_chtml20_end_ul_tag(void *pdoc, Node *UNUSED(child))
1754 chtml20 = GET_CHTML20(pdoc);
1761 return chtml20->out;
1766 * It is a handler who processes the OL tag.
1768 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1769 * destination is specified.
1770 * @param node [i] The OL tag node is specified.
1771 * @return The conversion result is returned.
1774 s_chtml20_start_ol_tag(void *pdoc, Node *node)
1781 chtml20 = GET_CHTML20(pdoc);
1786 /*--------------------------------------------------------------------------*/
1787 /* Get Attributes */
1788 /*--------------------------------------------------------------------------*/
1789 for (attr = qs_get_attr(doc,node);
1791 attr = qs_get_next_attr(doc,attr)) {
1792 char *name = qs_get_attr_name(doc,attr);
1793 char *value = qs_get_attr_value(doc,attr);
1794 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
1799 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
1808 return chtml20->out;
1813 * It is a handler who processes the OL tag.
1815 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1816 * destination is specified.
1817 * @param node [i] The OL tag node is specified.
1818 * @return The conversion result is returned.
1821 s_chtml20_end_ol_tag(void *pdoc, Node *UNUSED(child))
1827 chtml20 = GET_CHTML20(pdoc);
1834 return chtml20->out;
1839 * It is a handler who processes the LI tag.
1841 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1842 * destination is specified.
1843 * @param node [i] The LI tag node is specified.
1844 * @return The conversion result is returned.
1847 s_chtml20_start_li_tag(void *pdoc, Node *node)
1854 chtml20 = GET_CHTML20(pdoc);
1859 /*--------------------------------------------------------------------------*/
1860 /* Get Attributes */
1861 /*--------------------------------------------------------------------------*/
1862 for (attr = qs_get_attr(doc,node);
1864 attr = qs_get_next_attr(doc,attr)) {
1865 char *name = qs_get_attr_name(doc,attr);
1866 char *value = qs_get_attr_value(doc,attr);
1867 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
1872 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
1879 return chtml20->out;
1884 * It is a handler who processes the LI tag.
1886 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1887 * destination is specified.
1888 * @param node [i] The LI tag node is specified.
1889 * @return The conversion result is returned.
1892 s_chtml20_end_li_tag(void *pdoc, Node *UNUSED(child))
1894 chtml20_t *chtml20 = GET_CHTML20(pdoc);
1895 return chtml20->out;
1900 * It is a handler who processes the HR tag.
1902 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1903 * destination is specified.
1904 * @param node [i] The HR tag node is specified.
1905 * @return The conversion result is returned.
1908 s_chtml20_start_hr_tag(void *pdoc, Node *node)
1915 chtml20 = GET_CHTML20(pdoc);
1921 for (attr = qs_get_attr(doc,node);
1923 attr = qs_get_next_attr(doc,attr)) {
1924 char *name = qs_get_attr_name(doc,attr);
1925 char *value = qs_get_attr_value(doc,attr);
1929 if (strcasecmp(name, "align") == 0) {
1930 /*--------------------------------------------------------------------*/
1932 /*--------------------------------------------------------------------*/
1933 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1943 if (strcasecmp(name, "size") == 0) {
1944 /*--------------------------------------------------------------------*/
1946 /*--------------------------------------------------------------------*/
1947 if (value && value[0] != '\0') {
1957 if (strcasecmp(name, "width") == 0) {
1958 /*--------------------------------------------------------------------*/
1960 /*--------------------------------------------------------------------*/
1961 if (value && value[0] != '\0') {
1971 if (strcasecmp(name, "noshade") == 0) {
1972 /*--------------------------------------------------------------------*/
1974 /*--------------------------------------------------------------------*/
1981 if (strcasecmp(name, "color") == 0) {
1982 /*--------------------------------------------------------------------*/
1984 /*--------------------------------------------------------------------*/
1995 return chtml20->out;
2000 * It is a handler who processes the HR tag.
2002 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2003 * destination is specified.
2004 * @param node [i] The HR tag node is specified.
2005 * @return The conversion result is returned.
2008 s_chtml20_end_hr_tag(void *pdoc, Node *UNUSED(child))
2010 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2011 return chtml20->out;
2016 * It is a handler who processes the IMG tag.
2018 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2019 * destination is specified.
2020 * @param node [i] The IMG tag node is specified.
2021 * @return The conversion result is returned.
2024 s_chtml20_start_img_tag(void *pdoc, Node *node)
2030 #ifndef IMG_NOT_CONVERT_FILENAME
2034 chtml20 = GET_CHTML20(pdoc);
2038 #ifndef IMG_NOT_CONVERT_FILENAME
2039 spec = chtml20->spec;
2043 /*-------------------------------------------------------------------------*/
2044 /* Get Attributes */
2045 /*-------------------------------------------------------------------------*/
2046 for (attr = qs_get_attr(doc,node);
2048 attr = qs_get_next_attr(doc,attr)) {
2049 char *name = qs_get_attr_name(doc,attr);
2050 char *value = qs_get_attr_value(doc,attr);
2054 if (strcasecmp(name, "src") == 0) {
2055 /*-------------------------------------------------------------------*/
2057 /*-------------------------------------------------------------------*/
2058 #ifdef IMG_NOT_CONVERT_FILENAME
2059 value = chxj_encoding_parameter(r, value);
2060 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
2062 value = apr_psprintf(doc->buf.pool,
2065 (strchr(value, '?')) ? '&' : '?',
2066 CHXJ_COOKIE_NOUPDATE_PARAM);
2072 value = chxj_img_conv(r, spec, value);
2073 value = chxj_encoding_parameter(r, value);
2074 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
2076 value = apr_psprintf(doc->buf.pool,
2079 (strchr(value, '?')) ? '&' : '?',
2080 CHXJ_COOKIE_NOUPDATE_PARAM);
2091 if (strcasecmp(name, "align" ) == 0) {
2092 /*--------------------------------------------------------------------*/
2094 /*--------------------------------------------------------------------*/
2096 if (STRCASEEQ('t','T',"top", value) ||
2097 STRCASEEQ('m','M',"middle",value) ||
2098 STRCASEEQ('b','B',"bottom",value) ||
2099 STRCASEEQ('l','L',"left", value) ||
2100 STRCASEEQ('r','R',"right", value)) {
2105 else if (STRCASEEQ('c','C',"center", value)) {
2112 else if (strcasecmp(name, "alt" ) == 0 && value && *value) {
2113 /*--------------------------------------------------------------------*/
2115 /*--------------------------------------------------------------------*/
2124 if (strcasecmp(name, "width" ) == 0 && value && *value) {
2125 /*--------------------------------------------------------------------*/
2127 /*--------------------------------------------------------------------*/
2136 if (strcasecmp(name, "height") == 0 && value && *value) {
2137 /*--------------------------------------------------------------------*/
2139 /*--------------------------------------------------------------------*/
2144 else if (strcasecmp(name, "hspace") == 0 && value && *value) {
2145 /*--------------------------------------------------------------------*/
2147 /*--------------------------------------------------------------------*/
2156 if (strcasecmp(name, "vspace") == 0 && value && *value) {
2157 /*--------------------------------------------------------------------*/
2159 /*--------------------------------------------------------------------*/
2172 return chtml20->out;
2177 * It is a handler who processes the IMG tag.
2179 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2180 * destination is specified.
2181 * @param node [i] The IMG tag node is specified.
2182 * @return The conversion result is returned.
2185 s_chtml20_end_img_tag(void *pdoc, Node *UNUSED(child))
2187 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2189 return chtml20->out;
2194 * It is a handler who processes the SELECT tag.
2196 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2197 * destination is specified.
2198 * @param node [i] The SELECT tag node is specified.
2199 * @return The conversion result is returned.
2202 s_chtml20_start_select_tag(void *pdoc, Node *child)
2209 chtml20 = GET_CHTML20(pdoc);
2215 char *multiple = NULL;
2218 for (attr = qs_get_attr(doc,child);
2220 attr = qs_get_next_attr(doc,attr)) {
2221 char *nm = qs_get_attr_name(doc,attr);
2222 char *val = qs_get_attr_value(doc,attr);
2226 if (strcasecmp(nm, "size") == 0) {
2227 /*--------------------------------------------------------------------*/
2228 /* CHTML 1.0 version 2.0 */
2229 /*--------------------------------------------------------------------*/
2230 size = apr_pstrdup(doc->buf.pool, val);
2236 if (strcasecmp(nm, "name") == 0) {
2237 /*--------------------------------------------------------------------*/
2238 /* CHTML 1.0 version 2.0 */
2239 /*--------------------------------------------------------------------*/
2240 name = apr_pstrdup(doc->buf.pool, val);
2246 if (strcasecmp(nm, "multiple") == 0) {
2247 /*--------------------------------------------------------------------*/
2248 /* CHTML 1.0 version 2.0 */
2249 /*--------------------------------------------------------------------*/
2250 multiple = apr_pstrdup(doc->buf.pool, val);
2258 if (size && *size) {
2263 if (name && *name) {
2273 return chtml20->out;
2278 * It is a handler who processes the SELECT tag.
2280 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2281 * destination is specified.
2282 * @param node [i] The SELECT tag node is specified.
2283 * @return The conversion result is returned.
2286 s_chtml20_end_select_tag(void *pdoc, Node *UNUSED(child))
2291 chtml20 = GET_CHTML20(pdoc);
2296 return chtml20->out;
2301 * It is a handler who processes the OPTION tag.
2303 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2304 * destination is specified.
2305 * @param node [i] The OPTION tag node is specified.
2306 * @return The conversion result is returned.
2309 s_chtml20_start_option_tag(void *pdoc, Node *child)
2316 chtml20 = GET_CHTML20(pdoc);
2320 char *selected = NULL;
2324 for (attr = qs_get_attr(doc,child);
2326 attr = qs_get_next_attr(doc,attr)) {
2327 char *nm = qs_get_attr_name(doc,attr);
2328 char *val = qs_get_attr_value(doc,attr);
2332 if (strcasecmp(nm, "selected") == 0) {
2333 /*--------------------------------------------------------------------*/
2334 /* CHTML 1.0 version 2.0 */
2335 /*--------------------------------------------------------------------*/
2336 selected = apr_pstrdup(doc->buf.pool, val);
2342 if (strcasecmp(nm, "value") == 0) {
2343 /*--------------------------------------------------------------------*/
2344 /* CHTML 1.0 version 2.0 */
2345 /*--------------------------------------------------------------------*/
2346 value = apr_pstrdup(doc->buf.pool, val);
2355 if (value && *value) {
2365 return chtml20->out;
2370 * It is a handler who processes the OPTION tag.
2372 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2373 * destination is specified.
2374 * @param node [i] The OPTION tag node is specified.
2375 * @return The conversion result is returned.
2378 s_chtml20_end_option_tag(void *pdoc, Node *UNUSED(child))
2380 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2384 return chtml20->out;
2389 * It is a handler who processes the DIV tag.
2391 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2392 * destination is specified.
2393 * @param node [i] The DIV tag node is specified.
2394 * @return The conversion result is returned.
2397 s_chtml20_start_div_tag(void *pdoc, Node *child)
2404 chtml20 = GET_CHTML20(pdoc);
2412 for (attr = qs_get_attr(doc,child);
2414 attr = qs_get_next_attr(doc,attr)) {
2415 char *nm = qs_get_attr_name(doc,attr);
2416 char *val = qs_get_attr_value(doc,attr);
2417 if (STRCASEEQ('a','A', "align", nm)) {
2418 /*----------------------------------------------------------------------*/
2419 /* CHTML 1.0 (W3C version 3.2) */
2420 /*----------------------------------------------------------------------*/
2421 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2422 align = apr_pstrdup(doc->buf.pool, val);
2432 return chtml20->out;
2437 * It is a handler who processes the DIV tag.
2439 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2440 * destination is specified.
2441 * @param node [i] The DIV tag node is specified.
2442 * @return The conversion result is returned.
2445 s_chtml20_end_div_tag(void *pdoc, Node *UNUSED(child))
2447 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2448 Doc *doc = chtml20->doc;
2452 return chtml20->out;
2457 * It is a handler who processes the H1 tag.
2459 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2460 * destination is specified.
2461 * @param node [i] The H1 tag node is specified.
2462 * @return The conversion result is returned.
2465 s_chtml20_start_h1_tag(void *pdoc, Node *node)
2472 chtml20 = GET_CHTML20(pdoc);
2477 for (attr = qs_get_attr(doc,node);
2479 attr = qs_get_next_attr(doc,attr)) {
2480 char *name = qs_get_attr_name(doc,attr);
2481 char *value = qs_get_attr_value(doc,attr);
2482 if (STRCASEEQ('a','A',"align", name)) {
2483 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2492 return chtml20->out;
2497 * It is a handler who processes the H1 tag.
2499 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2500 * destination is specified.
2501 * @param node [i] The H1 tag node is specified.
2502 * @return The conversion result is returned.
2505 s_chtml20_end_h1_tag(void *pdoc, Node *UNUSED(child))
2510 chtml20 = GET_CHTML20(pdoc);
2515 return chtml20->out;
2520 * It is a handler who processes the H2 tag.
2522 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2523 * destination is specified.
2524 * @param node [i] The H2 tag node is specified.
2525 * @return The conversion result is returned.
2528 s_chtml20_start_h2_tag(void *pdoc, Node *node)
2535 chtml20 = GET_CHTML20(pdoc);
2540 for (attr = qs_get_attr(doc,node);
2542 attr = qs_get_next_attr(doc,attr)) {
2543 char *name = qs_get_attr_name(doc,attr);
2544 char *value = qs_get_attr_value(doc,attr);
2545 if (STRCASEEQ('a','A',"align", name)) {
2546 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2555 return chtml20->out;
2560 * It is a handler who processes the H2 tag.
2562 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2563 * destination is specified.
2564 * @param node [i] The H2 tag node is specified.
2565 * @return The conversion result is returned.
2568 s_chtml20_end_h2_tag(void *pdoc, Node *UNUSED(child))
2570 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2571 Doc *doc = chtml20->doc;
2576 return chtml20->out;
2581 * It is a handler who processes the H3 tag.
2583 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2584 * destination is specified.
2585 * @param node [i] The H3 tag node is specified.
2586 * @return The conversion result is returned.
2589 s_chtml20_start_h3_tag(void *pdoc, Node *node)
2596 chtml20 = GET_CHTML20(pdoc);
2601 for (attr = qs_get_attr(doc,node);
2603 attr = qs_get_next_attr(doc,attr)) {
2604 char *name = qs_get_attr_name(doc,attr);
2605 char *value = qs_get_attr_value(doc,attr);
2606 if (STRCASEEQ('a','A',"align", name)) {
2607 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2616 return chtml20->out;
2621 * It is a handler who processes the H3 tag.
2623 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2624 * destination is specified.
2625 * @param node [i] The H3 tag node is specified.
2626 * @return The conversion result is returned.
2629 s_chtml20_end_h3_tag(void *pdoc, Node *UNUSED(child))
2631 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2632 Doc *doc = chtml20->doc;
2636 return chtml20->out;
2641 * It is a handler who processes the H4 tag.
2643 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2644 * destination is specified.
2645 * @param node [i] The H4 tag node is specified.
2646 * @return The conversion result is returned.
2649 s_chtml20_start_h4_tag(void *pdoc, Node *node)
2656 chtml20 = GET_CHTML20(pdoc);
2661 for (attr = qs_get_attr(doc,node);
2663 attr = qs_get_next_attr(doc,attr)) {
2664 char *name = qs_get_attr_name(doc,attr);
2665 char *value = qs_get_attr_value(doc,attr);
2666 if (STRCASEEQ('a','A',"align", name)) {
2667 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2676 return chtml20->out;
2681 * It is a handler who processes the H4 tag.
2683 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2684 * destination is specified.
2685 * @param node [i] The H4 tag node is specified.
2686 * @return The conversion result is returned.
2689 s_chtml20_end_h4_tag(void *pdoc, Node *UNUSED(child))
2691 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2692 Doc *doc = chtml20->doc;
2696 return chtml20->out;
2701 * It is a handler who processes the H5 tag.
2703 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2704 * destination is specified.
2705 * @param node [i] The H5 tag node is specified.
2706 * @return The conversion result is returned.
2709 s_chtml20_start_h5_tag(void *pdoc, Node *node)
2716 chtml20 = GET_CHTML20(pdoc);
2721 for (attr = qs_get_attr(doc,node);
2723 attr = qs_get_next_attr(doc,attr)) {
2724 char *name = qs_get_attr_name(doc,attr);
2725 char *value = qs_get_attr_value(doc,attr);
2726 if (STRCASEEQ('a','A',"align", name)) {
2727 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2736 return chtml20->out;
2741 * It is a handler who processes the H5 tag.
2743 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2744 * destination is specified.
2745 * @param node [i] The H5 tag node is specified.
2746 * @return The conversion result is returned.
2749 s_chtml20_end_h5_tag(void *pdoc, Node *UNUSED(child))
2751 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2752 Doc *doc = chtml20->doc;
2756 return chtml20->out;
2761 * It is a handler who processes the H6 tag.
2763 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2764 * destination is specified.
2765 * @param node [i] The H6 tag node is specified.
2766 * @return The conversion result is returned.
2769 s_chtml20_start_h6_tag(void *pdoc, Node *node)
2776 chtml20 = GET_CHTML20(pdoc);
2781 for (attr = qs_get_attr(doc,node);
2783 attr = qs_get_next_attr(doc,attr)) {
2784 char *name = qs_get_attr_name(doc,attr);
2785 char *value = qs_get_attr_value(doc,attr);
2786 if (STRCASEEQ('a','A',"align", name)) {
2787 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2796 return chtml20->out;
2801 * It is a handler who processes the H6 tag.
2803 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2804 * destination is specified.
2805 * @param node [i] The H6 tag node is specified.
2806 * @return The conversion result is returned.
2809 s_chtml20_end_h6_tag(void *pdoc, Node *UNUSED(child))
2811 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2812 Doc *doc = chtml20->doc;
2816 return chtml20->out;
2821 * It is a handler who processes the PRE tag.
2823 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2824 * destination is specified.
2825 * @param node [i] The PRE tag node is specified.
2826 * @return The conversion result is returned.
2829 s_chtml20_start_pre_tag(void *pdoc, Node *UNUSED(node))
2831 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2832 Doc *doc = chtml20->doc;
2834 chtml20->pre_flag++;
2837 return chtml20->out;
2842 * It is a handler who processes the PRE tag.
2844 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2845 * destination is specified.
2846 * @param node [i] The PRE tag node is specified.
2847 * @return The conversion result is returned.
2850 s_chtml20_end_pre_tag(void *pdoc, Node *UNUSED(child))
2852 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2853 Doc *doc = chtml20->doc;
2857 chtml20->pre_flag--;
2859 return chtml20->out;
2864 * It is a handler who processes the P tag.
2866 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2867 * destination is specified.
2868 * @param node [i] The P tag node is specified.
2869 * @return The conversion result is returned.
2872 s_chtml20_start_p_tag(void *pdoc, Node *node)
2880 chtml20 = GET_CHTML20(pdoc);
2885 for (attr = qs_get_attr(doc,node);
2887 attr = qs_get_next_attr(doc,attr)) {
2888 char *nm = qs_get_attr_name(doc,attr);
2889 char *val = qs_get_attr_value(doc,attr);
2890 if (STRCASEEQ('a','A',"align", nm)) {
2891 /*----------------------------------------------------------------------*/
2892 /* CHTML 1.0 (W3C version 3.2) */
2893 /*----------------------------------------------------------------------*/
2894 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2895 align = apr_pstrdup(doc->buf.pool, val);
2907 return chtml20->out;
2912 * It is a handler who processes the P tag.
2914 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2915 * destination is specified.
2916 * @param node [i] The P tag node is specified.
2917 * @return The conversion result is returned.
2920 s_chtml20_end_p_tag(void *pdoc, Node *UNUSED(child))
2926 chtml20 = GET_CHTML20(pdoc);
2932 return chtml20->out;
2937 s_chtml20_chxjif_tag(void *pdoc, Node *node)
2944 chtml20 = GET_CHTML20(pdoc);
2948 for (child = qs_get_child_node(doc, node);
2950 child = qs_get_next_node(doc, child)) {
2953 s_chtml20_chxjif_tag(pdoc, child);
2961 * It is a handler who processes the TEXTARE tag.
2963 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2964 * destination is specified.
2965 * @param node [i] The TEXTAREA tag node is specified.
2966 * @return The conversion result is returned.
2969 s_chtml20_start_textarea_tag(void *pdoc, Node *node)
2976 chtml20 = GET_CHTML20(pdoc);
2980 chtml20->textarea_flag++;
2982 for (attr = qs_get_attr(doc,node);
2984 attr = qs_get_next_attr(doc,attr)) {
2985 char *name = qs_get_attr_name(doc,attr);
2986 char *value = qs_get_attr_value(doc,attr);
2990 if (strcasecmp(name, "accesskey") == 0 && value && *value != 0) {
2991 W_L(" accesskey=\"");
2999 if (strcasecmp(name, "name") == 0 && value && *value != 0) {
3008 if (strcasecmp(name, "rows") == 0 && value && *value != 0) {
3017 if (strcasecmp(name, "cols") == 0 && value && *value != 0) {
3026 if (strcasecmp(name, "istyle") == 0 && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
3039 return chtml20->out;
3044 * It is a handler who processes the TEXTAREA tag.
3046 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3047 * destination is specified.
3048 * @param node [i] The TEXTAREA tag node is specified.
3049 * @return The conversion result is returned.
3052 s_chtml20_end_textarea_tag(void *pdoc, Node *UNUSED(child))
3054 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3055 Doc *doc = chtml20->doc;
3059 chtml20->textarea_flag--;
3061 return chtml20->out;
3066 s_chtml20_text_tag(void *pdoc, Node *child)
3078 chtml20 = GET_CHTML20(pdoc);
3082 textval = qs_get_node_value(doc,child);
3083 if (strlen(textval) == 0) {
3084 return chtml20->out;
3087 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
3088 memset(tmp, 0, qs_get_node_size(doc,child)+1);
3090 tdst = qs_alloc_zero_byte_string(doc->buf.pool);
3091 memset(one_byte, 0, sizeof(one_byte));
3094 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
3096 int rtn = s_chtml20_search_emoji(chtml20, &textval[ii], &out);
3098 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
3102 if (is_sjis_kanji(textval[ii])) {
3103 one_byte[0] = textval[ii+0];
3104 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3105 one_byte[0] = textval[ii+1];
3106 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3110 if (chtml20->pre_flag) {
3111 one_byte[0] = textval[ii+0];
3112 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3115 if (chtml20->textarea_flag) {
3116 one_byte[0] = textval[ii+0];
3117 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3120 if (textval[ii] != '\r' && textval[ii] != '\n') {
3121 one_byte[0] = textval[ii+0];
3122 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3126 return chtml20->out;
3131 * It is a handler who processes the BLOCKQUOTE tag.
3133 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3134 * destination is specified.
3135 * @param node [i] The BLOCKQUOTE tag node is specified.
3136 * @return The conversion result is returned.
3139 s_chtml20_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
3141 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3142 Doc *doc = chtml20->doc;
3143 W_L("<blockquote>");
3145 return chtml20->out;
3150 * It is a handler who processes the BLOCKQUOTE tag.
3152 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3153 * destination is specified.
3154 * @param node [i] The BLOCKQUOTE tag node is specified.
3155 * @return The conversion result is returned.
3158 s_chtml20_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
3160 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3161 Doc *doc = chtml20->doc;
3162 W_L("</blockquote>");
3164 return chtml20->out;
3169 * It is a handler who processes the DIR tag.
3171 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3172 * destination is specified.
3173 * @param node [i] The DIR tag node is specified.
3174 * @return The conversion result is returned.
3177 s_chtml20_start_dir_tag(void *pdoc, Node *UNUSED(child))
3179 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3180 Doc *doc = chtml20->doc;
3183 return chtml20->out;
3188 * It is a handler who processes the DIR tag.
3190 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3191 * destination is specified.
3192 * @param node [i] The DIR tag node is specified.
3193 * @return The conversion result is returned.
3196 s_chtml20_end_dir_tag(void *pdoc, Node *UNUSED(child))
3198 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3199 Doc *doc = chtml20->doc;
3203 return chtml20->out;
3208 * It is a handler who processes the DL tag.
3210 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3211 * destination is specified.
3212 * @param node [i] The DL tag node is specified.
3213 * @return The conversion result is returned.
3216 s_chtml20_start_dl_tag(void *pdoc, Node *UNUSED(child))
3218 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3219 Doc *doc = chtml20->doc;
3222 return chtml20->out;
3227 * It is a handler who processes the DL tag.
3229 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3230 * destination is specified.
3231 * @param node [i] The DL tag node is specified.
3232 * @return The conversion result is returned.
3235 s_chtml20_end_dl_tag(void *pdoc, Node *UNUSED(child))
3237 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3238 Doc *doc = chtml20->doc;
3241 return chtml20->out;
3246 * It is a handter who processes the DT tag.
3248 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3249 * destination is specified.
3250 * @param node [i] The DT tag node is specified.
3251 * @return The conversion result is returned.
3254 s_chtml20_start_dt_tag(void *pdoc, Node *UNUSED(child))
3256 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3257 Doc *doc = chtml20->doc;
3259 return chtml20->out;
3264 * It is a handter who processes the DT tag.
3266 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3267 * destination is specified.
3268 * @param node [i] The DT tag node is specified.
3269 * @return The conversion result is returned.
3272 s_chtml20_end_dt_tag(void *pdoc, Node *UNUSED(child))
3274 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3276 return chtml20->out;
3281 * It is a handder who processes the DD tag.
3283 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3284 * destination is specified.
3285 * @param node [i] The DD tag node is specified.
3286 * @return The conversion result is returned.
3289 s_chtml20_start_dd_tag(void *pdoc, Node *UNUSED(child))
3291 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3292 Doc *doc = chtml20->doc;
3294 return chtml20->out;
3299 * It is a handder who processes the DD tag.
3301 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3302 * destination is specified.
3303 * @param node [i] The DD tag node is specified.
3304 * @return The conversion result is returned.
3307 s_chtml20_end_dd_tag(void *pdoc, Node *UNUSED(child))
3309 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3311 return chtml20->out;
3316 * It is a hanmenuer who processes the MENU tag.
3318 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3319 * destination is specified.
3320 * @param node [i] The MENU tag node is specified.
3321 * @return The conversion result is returned.
3324 s_chtml20_start_menu_tag(void *pdoc, Node *UNUSED(child))
3326 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3327 Doc *doc = chtml20->doc;
3331 return chtml20->out;
3336 * It is a hanmenuer who processes the MENU tag.
3338 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3339 * destination is specified.
3340 * @param node [i] The MENU tag node is specified.
3341 * @return The conversion result is returned.
3344 s_chtml20_end_menu_tag(void *pdoc, Node *UNUSED(child))
3346 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3347 Doc *doc = chtml20->doc;
3351 return chtml20->out;
3356 * It is a hanplaintexter who processes the PLAINTEXT tag.
3358 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3359 * destination is specified.
3360 * @param node [i] The PLAINTEXT tag node is specified.
3361 * @return The conversion result is returned.
3364 s_chtml20_start_plaintext_tag(void *pdoc, Node *node)
3366 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3367 Doc *doc = chtml20->doc;
3370 s_chtml20_start_plaintext_tag_inner(pdoc,node);
3371 return chtml20->out;
3375 s_chtml20_start_plaintext_tag_inner(void *pdoc, Node *node)
3377 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3378 Doc *doc = chtml20->doc;
3381 for (child = qs_get_child_node(doc, node);
3383 child = qs_get_next_node(doc, child)) {
3385 s_chtml20_start_plaintext_tag_inner(pdoc, child);
3387 return chtml20->out;
3392 * It is a hanplaintexter who processes the PLAINTEXT tag.
3394 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3395 * destination is specified.
3396 * @param node [i] The PLAINTEXT tag node is specified.
3397 * @return The conversion result is returned.
3400 s_chtml20_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3402 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3403 return chtml20->out;
3407 * It is a hanblinker who processes the BLINK tag.
3409 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3410 * destination is specified.
3411 * @param node [i] The BLINK tag node is specified.
3412 * @return The conversion result is returned.
3415 s_chtml20_start_blink_tag(void *pdoc, Node *UNUSED(child))
3417 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3418 Doc *doc = chtml20->doc;
3420 return chtml20->out;
3425 * It is a hanblinker who processes the BLINK tag.
3427 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3428 * destination is specified.
3429 * @param node [i] The BLINK tag node is specified.
3430 * @return The conversion result is returned.
3433 s_chtml20_end_blink_tag(void *pdoc, Node *UNUSED(child))
3435 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3436 Doc *doc = chtml20->doc;
3439 return chtml20->out;
3444 * It is a hanmarqueeer who processes the MARQUEE tag.
3446 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3447 * destination is specified.
3448 * @param node [i] The MARQUEE tag node is specified.
3449 * @return The conversion result is returned.
3452 s_chtml20_start_marquee_tag(void *pdoc, Node *node)
3454 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3455 Doc *doc = chtml20->doc;
3458 /*--------------------------------------------------------------------------*/
3459 /* Get Attributes */
3460 /*--------------------------------------------------------------------------*/
3461 for (attr = qs_get_attr(doc,node);
3463 attr = qs_get_next_attr(doc,attr)) {
3464 char *name = qs_get_attr_name(doc,attr);
3465 char *value = qs_get_attr_value(doc,attr);
3466 if (STRCASEEQ('d','D',"direction", name)) {
3467 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3468 W_L(" direction=\"");
3473 else if (STRCASEEQ('b','B',"behavior",name)) {
3474 if (value && (STRCASEEQ('s','S',"scroll",value) || STRCASEEQ('s','S',"slide",value) || STRCASEEQ('a','A',"alternate",value))) {
3475 W_L(" behavior=\"");
3480 else if (STRCASEEQ('l','L',"loop",name)) {
3481 if (value && *value) {
3489 return chtml20->out;
3494 * It is a hanmarqueeer who processes the MARQUEE tag.
3496 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3497 * destination is specified.
3498 * @param node [i] The MARQUEE tag node is specified.
3499 * @return The conversion result is returned.
3502 s_chtml20_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3504 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3505 Doc *doc = chtml20->doc;
3508 return chtml20->out;