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 if (! chxj_starts_with(value, "mailto:") && ! chxj_starts_with(value, "telto:")) {
1073 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
1083 if (strcasecmp(name, "accesskey") == 0) {
1084 /*--------------------------------------------------------------------*/
1086 /*--------------------------------------------------------------------*/
1087 W_L(" accesskey=\"");
1095 if (strcasecmp(name, "cti") == 0) {
1096 /*--------------------------------------------------------------------*/
1098 /*--------------------------------------------------------------------*/
1107 if (strcasecmp(name, "ijam") == 0) {
1108 /*--------------------------------------------------------------------*/
1110 /*--------------------------------------------------------------------*/
1114 if (strcasecmp(name, "ista") == 0) {
1115 /*--------------------------------------------------------------------*/
1117 /*--------------------------------------------------------------------*/
1121 if (strcasecmp(name, "ilet") == 0) {
1122 /*--------------------------------------------------------------------*/
1124 /*--------------------------------------------------------------------*/
1128 if (strcasecmp(name, "iswf") == 0) {
1129 /*--------------------------------------------------------------------*/
1131 /*--------------------------------------------------------------------*/
1135 if (strcasecmp(name, "irst") == 0) {
1136 /*--------------------------------------------------------------------*/
1138 /*--------------------------------------------------------------------*/
1145 if (strcasecmp(name, "utn") == 0) {
1146 /*--------------------------------------------------------------------*/
1148 /*--------------------------------------------------------------------*/
1155 if (strcasecmp(name, "telbook") == 0) {
1156 /*--------------------------------------------------------------------*/
1158 /*--------------------------------------------------------------------*/
1165 if (strcasecmp(name, "kana") == 0) {
1166 /*--------------------------------------------------------------------*/
1168 /*--------------------------------------------------------------------*/
1175 if (strcasecmp(name, "email") == 0) {
1176 /*--------------------------------------------------------------------*/
1178 /*--------------------------------------------------------------------*/
1188 return chtml20->out;
1193 * It is a handler who processes the A tag.
1195 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1196 * destination is specified.
1197 * @param node [i] The A tag node is specified.
1198 * @return The conversion result is returned.
1201 s_chtml20_end_a_tag(void *pdoc, Node *UNUSED(child))
1207 chtml20 = GET_CHTML20(pdoc);
1213 return chtml20->out;
1218 * It is a handler who processes the BR tag.
1220 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1221 * destination is specified.
1222 * @param node [i] The BR tag node is specified.
1223 * @return The conversion result is returned.
1226 s_chtml20_start_br_tag(void *pdoc, Node *node)
1233 chtml20 = GET_CHTML20(pdoc);
1238 /*--------------------------------------------------------------------------*/
1239 /* Get Attributes */
1240 /*--------------------------------------------------------------------------*/
1241 for (attr = qs_get_attr(doc,node);
1243 attr = qs_get_next_attr(doc,attr)) {
1244 char *name = qs_get_attr_name(doc,attr);
1245 char *value = qs_get_attr_value(doc,attr);
1246 if (STRCASEEQ('c','C',"clear",name)) {
1247 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1256 return chtml20->out;
1261 * It is a handler who processes the BR tag.
1263 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1264 * destination is specified.
1265 * @param node [i] The BR tag node is specified.
1266 * @return The conversion result is returned.
1269 s_chtml20_end_br_tag(void *pdoc, Node *UNUSED(child))
1275 chtml20 = GET_CHTML20(pdoc);
1279 return chtml20->out;
1284 * It is a handler who processes the TR tag.
1286 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1287 * destination is specified.
1288 * @param node [i] The TR tag node is specified.
1289 * @return The conversion result is returned.
1292 s_chtml20_start_tr_tag(void *pdoc, Node *UNUSED(node))
1298 chtml20 = GET_CHTML20(pdoc);
1302 return chtml20->out;
1307 * It is a handler who processes the TR tag.
1309 * @param chtml20 [i/o] The pointer to the CHTML structure at the output
1310 * destination is specified.
1311 * @param node [i] The TR tag node is specified.
1312 * @return The conversion result is returned.
1315 s_chtml20_end_tr_tag(void *pdoc, Node *UNUSED(child))
1321 chtml20 = GET_CHTML20(pdoc);
1327 return chtml20->out;
1332 * It is a handler who processes the FONT tag.
1334 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1335 * destination is specified.
1336 * @param node [i] The FONT tag node is specified.
1337 * @return The conversion result is returned.
1340 s_chtml20_start_font_tag(void *pdoc, Node *node)
1348 chtml20 = GET_CHTML20(pdoc);
1353 /*--------------------------------------------------------------------------*/
1354 /* Get Attributes */
1355 /*--------------------------------------------------------------------------*/
1356 for (attr = qs_get_attr(doc,node);
1357 attr && color == NULL;
1358 attr = qs_get_next_attr(doc,attr)) {
1359 char *name = qs_get_attr_name(doc,attr);
1360 char *value = qs_get_attr_value(doc,attr);
1364 if (strcasecmp(name, "color") == 0 && value && *value) {
1365 color = apr_pstrdup(doc->buf.pool, value);
1371 if (strcasecmp(name, "size") == 0) {
1372 /*--------------------------------------------------------------------*/
1374 /*--------------------------------------------------------------------*/
1384 W_L("<font color=\"");
1387 chtml20->font_flag++;
1389 return chtml20->out;
1394 * It is a handler who processes the FONT tag.
1396 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1397 * destination is specified.
1398 * @param node [i] The FONT tag node is specified.
1399 * @return The conversion result is returned.
1402 s_chtml20_end_font_tag(void *pdoc, Node *UNUSED(child))
1408 chtml20 = GET_CHTML20(pdoc);
1412 if (chtml20->font_flag) {
1414 chtml20->font_flag--;
1416 return chtml20->out;
1421 * It is a handler who processes the FORM tag.
1423 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1424 * destination is specified.
1425 * @param node [i] The FORM tag node is specified.
1426 * @return The conversion result is returned.
1429 s_chtml20_start_form_tag(void *pdoc, Node *node)
1435 char *new_hidden_tag = NULL;
1436 char *attr_method = NULL;
1437 char *attr_action = NULL;
1439 chtml20 = GET_CHTML20(pdoc);
1443 /*--------------------------------------------------------------------------*/
1444 /* Get Attributes */
1445 /*--------------------------------------------------------------------------*/
1446 for (attr = qs_get_attr(doc,node);
1448 attr = qs_get_next_attr(doc,attr)) {
1451 name = qs_get_attr_name(doc,attr);
1452 value = qs_get_attr_value(doc,attr);
1457 if (strcasecmp(name, "action") == 0) {
1458 /*--------------------------------------------------------------------*/
1460 /*--------------------------------------------------------------------*/
1461 attr_action = chxj_encoding_parameter(r, value);
1462 attr_action= chxj_add_cookie_parameter(r, attr_action, chtml20->cookie);
1468 if (strcasecmp(name, "method") == 0) {
1469 /*--------------------------------------------------------------------*/
1471 /*--------------------------------------------------------------------*/
1472 attr_method = apr_pstrdup(doc->pool, value);
1478 if (strcasecmp(name, "utn") == 0) {
1479 /*--------------------------------------------------------------------*/
1481 /*--------------------------------------------------------------------*/
1491 int post_flag = (attr_method && strcasecmp(attr_method, "post") == 0) ? 1 : 0;
1496 q = strchr(attr_action, '?');
1498 new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 0, post_flag);
1499 if (new_hidden_tag) {
1513 if (new_hidden_tag) {
1514 W_V(new_hidden_tag);
1516 return chtml20->out;
1521 * It is a handler who processes the FORM tag.
1523 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1524 * destination is specified.
1525 * @param node [i] The FORM tag node is specified.
1526 * @return The conversion result is returned.
1529 s_chtml20_end_form_tag(void *pdoc, Node *UNUSED(child))
1535 chtml20 = GET_CHTML20(pdoc);
1541 return chtml20->out;
1546 * It is a handler who processes the INPUT tag.
1548 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1549 * destination is specified.
1550 * @param node [i] The INPUT tag node is specified.
1551 * @return The conversion result is returned.
1554 s_chtml20_start_input_tag(void *pdoc, Node *node)
1559 char *max_length = NULL;
1563 char *istyle = NULL;
1565 char *checked = NULL;
1566 char *accesskey = NULL;
1568 chtml20 = GET_CHTML20(pdoc);
1574 /*--------------------------------------------------------------------------*/
1575 /* Get Attributes */
1576 /*--------------------------------------------------------------------------*/
1577 type = qs_get_type_attr(doc, node, doc->buf.pool);
1578 name = qs_get_name_attr(doc, node, doc->buf.pool);
1579 value = qs_get_value_attr(doc,node,doc->buf.pool);
1580 istyle = qs_get_istyle_attr(doc,node,doc->buf.pool);
1581 max_length = qs_get_maxlength_attr(doc,node,doc->buf.pool);
1582 checked = qs_get_checked_attr(doc,node,doc->buf.pool);
1583 accesskey = qs_get_accesskey_attr(doc, node, doc->buf.pool);
1584 size = qs_get_size_attr(doc, node, doc->buf.pool);
1587 type = qs_trim_string(doc->buf.pool, type);
1588 if (type && (STRCASEEQ('t','T',"text", type) ||
1589 STRCASEEQ('p','P',"password",type) ||
1590 STRCASEEQ('c','C',"checkbox",type) ||
1591 STRCASEEQ('r','R',"radio", type) ||
1592 STRCASEEQ('h','H',"hidden", type) ||
1593 STRCASEEQ('s','S',"submit", type) ||
1594 STRCASEEQ('r','R',"reset", type))) {
1600 if (size && *size) {
1605 if (name && *name) {
1610 if (value && *value) {
1612 W_V(chxj_add_slash_to_doublequote(doc->pool, value));
1615 if (accesskey && *accesskey) {
1616 W_L(" accesskey=\"");
1621 /*------------------------------------------------------------------------*/
1623 /*------------------------------------------------------------------------*/
1624 if (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4') {
1630 /*--------------------------------------------------------------------------*/
1631 /* The figure is default for the password. */
1632 /*--------------------------------------------------------------------------*/
1633 if (max_length && *max_length) {
1634 if (chxj_chk_numeric(max_length) != 0) {
1635 max_length = apr_psprintf(doc->buf.pool, "0");
1637 if (istyle && *istyle == '1') {
1638 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length) * 2);
1642 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length));
1651 return chtml20->out;
1656 * It is a handler who processes the INPUT tag.
1658 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1659 * destination is specified.
1660 * @param node [i] The INPUT tag node is specified.
1661 * @return The conversion result is returned.
1664 s_chtml20_end_input_tag(void *pdoc, Node *UNUSED(child))
1670 chtml20 = GET_CHTML20(pdoc);
1674 return chtml20->out;
1679 * It is a handler who processes the CENTER tag.
1681 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1682 * destination is specified.
1683 * @param node [i] The CENTER tag node is specified.
1684 * @return The conversion result is returned.
1687 s_chtml20_start_center_tag(void *pdoc, Node *UNUSED(node))
1693 chtml20 = GET_CHTML20(pdoc);
1698 return chtml20->out;
1703 * It is a handler who processes the CENTER tag.
1705 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1706 * destination is specified.
1707 * @param node [i] The CENTER tag node is specified.
1708 * @return The conversion result is returned.
1711 s_chtml20_end_center_tag(void *pdoc, Node *UNUSED(child))
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_start_ul_tag(void *pdoc, Node *UNUSED(node))
1742 chtml20 = GET_CHTML20(pdoc);
1748 return chtml20->out;
1753 * It is a handler who processes the UL tag.
1755 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1756 * destination is specified.
1757 * @param node [i] The UL tag node is specified.
1758 * @return The conversion result is returned.
1761 s_chtml20_end_ul_tag(void *pdoc, Node *UNUSED(child))
1767 chtml20 = GET_CHTML20(pdoc);
1773 return chtml20->out;
1778 * It is a handler who processes the OL tag.
1780 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1781 * destination is specified.
1782 * @param node [i] The OL tag node is specified.
1783 * @return The conversion result is returned.
1786 s_chtml20_start_ol_tag(void *pdoc, Node *node)
1793 chtml20 = GET_CHTML20(pdoc);
1798 /*--------------------------------------------------------------------------*/
1799 /* Get Attributes */
1800 /*--------------------------------------------------------------------------*/
1801 for (attr = qs_get_attr(doc,node);
1803 attr = qs_get_next_attr(doc,attr)) {
1804 char *name = qs_get_attr_name(doc,attr);
1805 char *value = qs_get_attr_value(doc,attr);
1806 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
1811 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
1819 return chtml20->out;
1824 * It is a handler who processes the OL tag.
1826 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1827 * destination is specified.
1828 * @param node [i] The OL tag node is specified.
1829 * @return The conversion result is returned.
1832 s_chtml20_end_ol_tag(void *pdoc, Node *UNUSED(child))
1838 chtml20 = GET_CHTML20(pdoc);
1844 return chtml20->out;
1849 * It is a handler who processes the LI tag.
1851 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1852 * destination is specified.
1853 * @param node [i] The LI tag node is specified.
1854 * @return The conversion result is returned.
1857 s_chtml20_start_li_tag(void *pdoc, Node *node)
1864 chtml20 = GET_CHTML20(pdoc);
1869 /*--------------------------------------------------------------------------*/
1870 /* Get Attributes */
1871 /*--------------------------------------------------------------------------*/
1872 for (attr = qs_get_attr(doc,node);
1874 attr = qs_get_next_attr(doc,attr)) {
1875 char *name = qs_get_attr_name(doc,attr);
1876 char *value = qs_get_attr_value(doc,attr);
1877 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
1882 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
1889 return chtml20->out;
1894 * It is a handler who processes the LI tag.
1896 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1897 * destination is specified.
1898 * @param node [i] The LI tag node is specified.
1899 * @return The conversion result is returned.
1902 s_chtml20_end_li_tag(void *pdoc, Node *UNUSED(child))
1904 chtml20_t *chtml20 = GET_CHTML20(pdoc);
1905 return chtml20->out;
1910 * It is a handler who processes the HR tag.
1912 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1913 * destination is specified.
1914 * @param node [i] The HR tag node is specified.
1915 * @return The conversion result is returned.
1918 s_chtml20_start_hr_tag(void *pdoc, Node *node)
1925 chtml20 = GET_CHTML20(pdoc);
1931 for (attr = qs_get_attr(doc,node);
1933 attr = qs_get_next_attr(doc,attr)) {
1934 char *name = qs_get_attr_name(doc,attr);
1935 char *value = qs_get_attr_value(doc,attr);
1939 if (strcasecmp(name, "align") == 0) {
1940 /*--------------------------------------------------------------------*/
1942 /*--------------------------------------------------------------------*/
1943 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1953 if (strcasecmp(name, "size") == 0) {
1954 /*--------------------------------------------------------------------*/
1956 /*--------------------------------------------------------------------*/
1957 if (value && value[0] != '\0') {
1967 if (strcasecmp(name, "width") == 0) {
1968 /*--------------------------------------------------------------------*/
1970 /*--------------------------------------------------------------------*/
1971 if (value && value[0] != '\0') {
1981 if (strcasecmp(name, "noshade") == 0) {
1982 /*--------------------------------------------------------------------*/
1984 /*--------------------------------------------------------------------*/
1991 if (strcasecmp(name, "color") == 0) {
1992 /*--------------------------------------------------------------------*/
1994 /*--------------------------------------------------------------------*/
2004 return chtml20->out;
2009 * It is a handler who processes the HR tag.
2011 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2012 * destination is specified.
2013 * @param node [i] The HR tag node is specified.
2014 * @return The conversion result is returned.
2017 s_chtml20_end_hr_tag(void *pdoc, Node *UNUSED(child))
2019 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2020 return chtml20->out;
2025 * It is a handler who processes the IMG tag.
2027 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2028 * destination is specified.
2029 * @param node [i] The IMG tag node is specified.
2030 * @return The conversion result is returned.
2033 s_chtml20_start_img_tag(void *pdoc, Node *node)
2039 #ifndef IMG_NOT_CONVERT_FILENAME
2043 chtml20 = GET_CHTML20(pdoc);
2047 #ifndef IMG_NOT_CONVERT_FILENAME
2048 spec = chtml20->spec;
2052 /*-------------------------------------------------------------------------*/
2053 /* Get Attributes */
2054 /*-------------------------------------------------------------------------*/
2055 for (attr = qs_get_attr(doc,node);
2057 attr = qs_get_next_attr(doc,attr)) {
2058 char *name = qs_get_attr_name(doc,attr);
2059 char *value = qs_get_attr_value(doc,attr);
2063 if (strcasecmp(name, "src") == 0) {
2064 /*-------------------------------------------------------------------*/
2066 /*-------------------------------------------------------------------*/
2067 #ifdef IMG_NOT_CONVERT_FILENAME
2068 value = chxj_encoding_parameter(r, value);
2069 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
2071 value = apr_psprintf(doc->buf.pool,
2074 (strchr(value, '?')) ? '&' : '?',
2075 CHXJ_COOKIE_NOUPDATE_PARAM);
2081 value = chxj_img_conv(r, spec, value);
2082 value = chxj_encoding_parameter(r, value);
2083 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
2085 value = apr_psprintf(doc->buf.pool,
2088 (strchr(value, '?')) ? '&' : '?',
2089 CHXJ_COOKIE_NOUPDATE_PARAM);
2100 if (strcasecmp(name, "align" ) == 0) {
2101 /*--------------------------------------------------------------------*/
2103 /*--------------------------------------------------------------------*/
2105 if (STRCASEEQ('t','T',"top", value) ||
2106 STRCASEEQ('m','M',"middle",value) ||
2107 STRCASEEQ('b','B',"bottom",value) ||
2108 STRCASEEQ('l','L',"left", value) ||
2109 STRCASEEQ('r','R',"right", value)) {
2114 else if (STRCASEEQ('c','C',"center", value)) {
2121 else if (strcasecmp(name, "alt" ) == 0 && value && *value) {
2122 /*--------------------------------------------------------------------*/
2124 /*--------------------------------------------------------------------*/
2133 if (strcasecmp(name, "width" ) == 0 && value && *value) {
2134 /*--------------------------------------------------------------------*/
2136 /*--------------------------------------------------------------------*/
2145 if (strcasecmp(name, "height") == 0 && value && *value) {
2146 /*--------------------------------------------------------------------*/
2148 /*--------------------------------------------------------------------*/
2153 else if (strcasecmp(name, "hspace") == 0 && value && *value) {
2154 /*--------------------------------------------------------------------*/
2156 /*--------------------------------------------------------------------*/
2165 if (strcasecmp(name, "vspace") == 0 && value && *value) {
2166 /*--------------------------------------------------------------------*/
2168 /*--------------------------------------------------------------------*/
2180 return chtml20->out;
2185 * It is a handler who processes the IMG tag.
2187 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2188 * destination is specified.
2189 * @param node [i] The IMG tag node is specified.
2190 * @return The conversion result is returned.
2193 s_chtml20_end_img_tag(void *pdoc, Node *UNUSED(child))
2195 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2197 return chtml20->out;
2202 * It is a handler who processes the SELECT tag.
2204 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2205 * destination is specified.
2206 * @param node [i] The SELECT tag node is specified.
2207 * @return The conversion result is returned.
2210 s_chtml20_start_select_tag(void *pdoc, Node *child)
2217 chtml20 = GET_CHTML20(pdoc);
2223 char *multiple = NULL;
2226 for (attr = qs_get_attr(doc,child);
2228 attr = qs_get_next_attr(doc,attr)) {
2229 char *nm = qs_get_attr_name(doc,attr);
2230 char *val = qs_get_attr_value(doc,attr);
2234 if (strcasecmp(nm, "size") == 0) {
2235 /*--------------------------------------------------------------------*/
2236 /* CHTML 1.0 version 2.0 */
2237 /*--------------------------------------------------------------------*/
2238 size = apr_pstrdup(doc->buf.pool, val);
2244 if (strcasecmp(nm, "name") == 0) {
2245 /*--------------------------------------------------------------------*/
2246 /* CHTML 1.0 version 2.0 */
2247 /*--------------------------------------------------------------------*/
2248 name = apr_pstrdup(doc->buf.pool, val);
2254 if (strcasecmp(nm, "multiple") == 0) {
2255 /*--------------------------------------------------------------------*/
2256 /* CHTML 1.0 version 2.0 */
2257 /*--------------------------------------------------------------------*/
2258 multiple = apr_pstrdup(doc->buf.pool, val);
2266 if (size && *size) {
2271 if (name && *name) {
2280 return chtml20->out;
2285 * It is a handler who processes the SELECT tag.
2287 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2288 * destination is specified.
2289 * @param node [i] The SELECT tag node is specified.
2290 * @return The conversion result is returned.
2293 s_chtml20_end_select_tag(void *pdoc, Node *UNUSED(child))
2298 chtml20 = GET_CHTML20(pdoc);
2302 return chtml20->out;
2307 * It is a handler who processes the OPTION tag.
2309 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2310 * destination is specified.
2311 * @param node [i] The OPTION tag node is specified.
2312 * @return The conversion result is returned.
2315 s_chtml20_start_option_tag(void *pdoc, Node *child)
2322 chtml20 = GET_CHTML20(pdoc);
2326 char *selected = NULL;
2330 for (attr = qs_get_attr(doc,child);
2332 attr = qs_get_next_attr(doc,attr)) {
2333 char *nm = qs_get_attr_name(doc,attr);
2334 char *val = qs_get_attr_value(doc,attr);
2338 if (strcasecmp(nm, "selected") == 0) {
2339 /*--------------------------------------------------------------------*/
2340 /* CHTML 1.0 version 2.0 */
2341 /*--------------------------------------------------------------------*/
2342 selected = apr_pstrdup(doc->buf.pool, val);
2348 if (strcasecmp(nm, "value") == 0) {
2349 /*--------------------------------------------------------------------*/
2350 /* CHTML 1.0 version 2.0 */
2351 /*--------------------------------------------------------------------*/
2352 value = apr_pstrdup(doc->buf.pool, val);
2361 if (value && *value) {
2371 return chtml20->out;
2376 * It is a handler who processes the OPTION tag.
2378 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2379 * destination is specified.
2380 * @param node [i] The OPTION tag node is specified.
2381 * @return The conversion result is returned.
2384 s_chtml20_end_option_tag(void *pdoc, Node *UNUSED(child))
2386 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2390 return chtml20->out;
2395 * It is a handler who processes the DIV tag.
2397 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2398 * destination is specified.
2399 * @param node [i] The DIV tag node is specified.
2400 * @return The conversion result is returned.
2403 s_chtml20_start_div_tag(void *pdoc, Node *child)
2410 chtml20 = GET_CHTML20(pdoc);
2418 for (attr = qs_get_attr(doc,child);
2420 attr = qs_get_next_attr(doc,attr)) {
2421 char *nm = qs_get_attr_name(doc,attr);
2422 char *val = qs_get_attr_value(doc,attr);
2423 if (STRCASEEQ('a','A', "align", nm)) {
2424 /*----------------------------------------------------------------------*/
2425 /* CHTML 1.0 (W3C version 3.2) */
2426 /*----------------------------------------------------------------------*/
2427 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2428 align = apr_pstrdup(doc->buf.pool, val);
2438 return chtml20->out;
2443 * It is a handler who processes the DIV tag.
2445 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2446 * destination is specified.
2447 * @param node [i] The DIV tag node is specified.
2448 * @return The conversion result is returned.
2451 s_chtml20_end_div_tag(void *pdoc, Node *UNUSED(child))
2453 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2454 Doc *doc = chtml20->doc;
2457 return chtml20->out;
2462 * It is a handler who processes the H1 tag.
2464 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2465 * destination is specified.
2466 * @param node [i] The H1 tag node is specified.
2467 * @return The conversion result is returned.
2470 s_chtml20_start_h1_tag(void *pdoc, Node *node)
2477 chtml20 = GET_CHTML20(pdoc);
2482 for (attr = qs_get_attr(doc,node);
2484 attr = qs_get_next_attr(doc,attr)) {
2485 char *name = qs_get_attr_name(doc,attr);
2486 char *value = qs_get_attr_value(doc,attr);
2487 if (STRCASEEQ('a','A',"align", name)) {
2488 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2497 return chtml20->out;
2502 * It is a handler who processes the H1 tag.
2504 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2505 * destination is specified.
2506 * @param node [i] The H1 tag node is specified.
2507 * @return The conversion result is returned.
2510 s_chtml20_end_h1_tag(void *pdoc, Node *UNUSED(child))
2515 chtml20 = GET_CHTML20(pdoc);
2519 return chtml20->out;
2524 * It is a handler who processes the H2 tag.
2526 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2527 * destination is specified.
2528 * @param node [i] The H2 tag node is specified.
2529 * @return The conversion result is returned.
2532 s_chtml20_start_h2_tag(void *pdoc, Node *node)
2539 chtml20 = GET_CHTML20(pdoc);
2544 for (attr = qs_get_attr(doc,node);
2546 attr = qs_get_next_attr(doc,attr)) {
2547 char *name = qs_get_attr_name(doc,attr);
2548 char *value = qs_get_attr_value(doc,attr);
2549 if (STRCASEEQ('a','A',"align", name)) {
2550 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2559 return chtml20->out;
2564 * It is a handler who processes the H2 tag.
2566 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2567 * destination is specified.
2568 * @param node [i] The H2 tag node is specified.
2569 * @return The conversion result is returned.
2572 s_chtml20_end_h2_tag(void *pdoc, Node *UNUSED(child))
2574 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2575 Doc *doc = chtml20->doc;
2579 return chtml20->out;
2584 * It is a handler who processes the H3 tag.
2586 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2587 * destination is specified.
2588 * @param node [i] The H3 tag node is specified.
2589 * @return The conversion result is returned.
2592 s_chtml20_start_h3_tag(void *pdoc, Node *node)
2599 chtml20 = GET_CHTML20(pdoc);
2604 for (attr = qs_get_attr(doc,node);
2606 attr = qs_get_next_attr(doc,attr)) {
2607 char *name = qs_get_attr_name(doc,attr);
2608 char *value = qs_get_attr_value(doc,attr);
2609 if (STRCASEEQ('a','A',"align", name)) {
2610 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2619 return chtml20->out;
2624 * It is a handler who processes the H3 tag.
2626 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2627 * destination is specified.
2628 * @param node [i] The H3 tag node is specified.
2629 * @return The conversion result is returned.
2632 s_chtml20_end_h3_tag(void *pdoc, Node *UNUSED(child))
2634 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2635 Doc *doc = chtml20->doc;
2638 return chtml20->out;
2643 * It is a handler who processes the H4 tag.
2645 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2646 * destination is specified.
2647 * @param node [i] The H4 tag node is specified.
2648 * @return The conversion result is returned.
2651 s_chtml20_start_h4_tag(void *pdoc, Node *node)
2658 chtml20 = GET_CHTML20(pdoc);
2663 for (attr = qs_get_attr(doc,node);
2665 attr = qs_get_next_attr(doc,attr)) {
2666 char *name = qs_get_attr_name(doc,attr);
2667 char *value = qs_get_attr_value(doc,attr);
2668 if (STRCASEEQ('a','A',"align", name)) {
2669 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2678 return chtml20->out;
2683 * It is a handler who processes the H4 tag.
2685 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2686 * destination is specified.
2687 * @param node [i] The H4 tag node is specified.
2688 * @return The conversion result is returned.
2691 s_chtml20_end_h4_tag(void *pdoc, Node *UNUSED(child))
2693 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2694 Doc *doc = chtml20->doc;
2697 return chtml20->out;
2702 * It is a handler who processes the H5 tag.
2704 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2705 * destination is specified.
2706 * @param node [i] The H5 tag node is specified.
2707 * @return The conversion result is returned.
2710 s_chtml20_start_h5_tag(void *pdoc, Node *node)
2717 chtml20 = GET_CHTML20(pdoc);
2722 for (attr = qs_get_attr(doc,node);
2724 attr = qs_get_next_attr(doc,attr)) {
2725 char *name = qs_get_attr_name(doc,attr);
2726 char *value = qs_get_attr_value(doc,attr);
2727 if (STRCASEEQ('a','A',"align", name)) {
2728 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2737 return chtml20->out;
2742 * It is a handler who processes the H5 tag.
2744 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2745 * destination is specified.
2746 * @param node [i] The H5 tag node is specified.
2747 * @return The conversion result is returned.
2750 s_chtml20_end_h5_tag(void *pdoc, Node *UNUSED(child))
2752 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2753 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;
2815 return chtml20->out;
2820 * It is a handler who processes the PRE tag.
2822 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2823 * destination is specified.
2824 * @param node [i] The PRE tag node is specified.
2825 * @return The conversion result is returned.
2828 s_chtml20_start_pre_tag(void *pdoc, Node *UNUSED(node))
2830 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2831 Doc *doc = chtml20->doc;
2833 chtml20->pre_flag++;
2835 return chtml20->out;
2840 * It is a handler who processes the PRE tag.
2842 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2843 * destination is specified.
2844 * @param node [i] The PRE tag node is specified.
2845 * @return The conversion result is returned.
2848 s_chtml20_end_pre_tag(void *pdoc, Node *UNUSED(child))
2850 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2851 Doc *doc = chtml20->doc;
2854 chtml20->pre_flag--;
2856 return chtml20->out;
2861 * It is a handler who processes the P tag.
2863 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2864 * destination is specified.
2865 * @param node [i] The P tag node is specified.
2866 * @return The conversion result is returned.
2869 s_chtml20_start_p_tag(void *pdoc, Node *node)
2877 chtml20 = GET_CHTML20(pdoc);
2882 for (attr = qs_get_attr(doc,node);
2884 attr = qs_get_next_attr(doc,attr)) {
2885 char *nm = qs_get_attr_name(doc,attr);
2886 char *val = qs_get_attr_value(doc,attr);
2887 if (STRCASEEQ('a','A',"align", nm)) {
2888 /*----------------------------------------------------------------------*/
2889 /* CHTML 1.0 (W3C version 3.2) */
2890 /*----------------------------------------------------------------------*/
2891 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2892 align = apr_pstrdup(doc->buf.pool, val);
2903 return chtml20->out;
2908 * It is a handler who processes the P tag.
2910 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2911 * destination is specified.
2912 * @param node [i] The P tag node is specified.
2913 * @return The conversion result is returned.
2916 s_chtml20_end_p_tag(void *pdoc, Node *UNUSED(child))
2922 chtml20 = GET_CHTML20(pdoc);
2927 return chtml20->out;
2932 s_chtml20_chxjif_tag(void *pdoc, Node *node)
2939 chtml20 = GET_CHTML20(pdoc);
2943 for (child = qs_get_child_node(doc, node);
2945 child = qs_get_next_node(doc, child)) {
2948 s_chtml20_chxjif_tag(pdoc, child);
2956 * It is a handler who processes the TEXTARE tag.
2958 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2959 * destination is specified.
2960 * @param node [i] The TEXTAREA tag node is specified.
2961 * @return The conversion result is returned.
2964 s_chtml20_start_textarea_tag(void *pdoc, Node *node)
2971 chtml20 = GET_CHTML20(pdoc);
2975 chtml20->textarea_flag++;
2977 for (attr = qs_get_attr(doc,node);
2979 attr = qs_get_next_attr(doc,attr)) {
2980 char *name = qs_get_attr_name(doc,attr);
2981 char *value = qs_get_attr_value(doc,attr);
2985 if (strcasecmp(name, "accesskey") == 0 && value && *value != 0) {
2986 W_L(" accesskey=\"");
2994 if (strcasecmp(name, "name") == 0 && value && *value != 0) {
3003 if (strcasecmp(name, "rows") == 0 && value && *value != 0) {
3012 if (strcasecmp(name, "cols") == 0 && value && *value != 0) {
3021 if (strcasecmp(name, "istyle") == 0 && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
3033 return chtml20->out;
3038 * It is a handler who processes the TEXTAREA tag.
3040 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3041 * destination is specified.
3042 * @param node [i] The TEXTAREA tag node is specified.
3043 * @return The conversion result is returned.
3046 s_chtml20_end_textarea_tag(void *pdoc, Node *UNUSED(child))
3048 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3049 Doc *doc = chtml20->doc;
3052 chtml20->textarea_flag--;
3054 return chtml20->out;
3059 s_chtml20_text_tag(void *pdoc, Node *child)
3071 chtml20 = GET_CHTML20(pdoc);
3075 textval = qs_get_node_value(doc,child);
3076 if (strlen(textval) == 0) {
3077 return chtml20->out;
3080 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
3081 memset(tmp, 0, qs_get_node_size(doc,child)+1);
3083 tdst = qs_alloc_zero_byte_string(doc->buf.pool);
3084 memset(one_byte, 0, sizeof(one_byte));
3087 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
3089 int rtn = s_chtml20_search_emoji(chtml20, &textval[ii], &out);
3091 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
3095 if (is_sjis_kanji(textval[ii])) {
3096 one_byte[0] = textval[ii+0];
3097 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3098 one_byte[0] = textval[ii+1];
3099 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3103 if (chtml20->pre_flag) {
3104 one_byte[0] = textval[ii+0];
3105 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3108 if (chtml20->textarea_flag) {
3109 one_byte[0] = textval[ii+0];
3110 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3113 if (textval[ii] != '\r' && textval[ii] != '\n') {
3114 one_byte[0] = textval[ii+0];
3115 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3119 return chtml20->out;
3124 * It is a handler who processes the BLOCKQUOTE tag.
3126 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3127 * destination is specified.
3128 * @param node [i] The BLOCKQUOTE tag node is specified.
3129 * @return The conversion result is returned.
3132 s_chtml20_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
3134 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3135 Doc *doc = chtml20->doc;
3136 W_L("<blockquote>");
3137 return chtml20->out;
3142 * It is a handler who processes the BLOCKQUOTE tag.
3144 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3145 * destination is specified.
3146 * @param node [i] The BLOCKQUOTE tag node is specified.
3147 * @return The conversion result is returned.
3150 s_chtml20_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
3152 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3153 Doc *doc = chtml20->doc;
3154 W_L("</blockquote>");
3155 return chtml20->out;
3160 * It is a handler who processes the DIR tag.
3162 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3163 * destination is specified.
3164 * @param node [i] The DIR tag node is specified.
3165 * @return The conversion result is returned.
3168 s_chtml20_start_dir_tag(void *pdoc, Node *UNUSED(child))
3170 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3171 Doc *doc = chtml20->doc;
3173 return chtml20->out;
3178 * It is a handler who processes the DIR tag.
3180 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3181 * destination is specified.
3182 * @param node [i] The DIR tag node is specified.
3183 * @return The conversion result is returned.
3186 s_chtml20_end_dir_tag(void *pdoc, Node *UNUSED(child))
3188 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3189 Doc *doc = chtml20->doc;
3192 return chtml20->out;
3197 * It is a handler who processes the DL tag.
3199 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3200 * destination is specified.
3201 * @param node [i] The DL tag node is specified.
3202 * @return The conversion result is returned.
3205 s_chtml20_start_dl_tag(void *pdoc, Node *UNUSED(child))
3207 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3208 Doc *doc = chtml20->doc;
3210 return chtml20->out;
3215 * It is a handler who processes the DL tag.
3217 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3218 * destination is specified.
3219 * @param node [i] The DL tag node is specified.
3220 * @return The conversion result is returned.
3223 s_chtml20_end_dl_tag(void *pdoc, Node *UNUSED(child))
3225 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3226 Doc *doc = chtml20->doc;
3228 return chtml20->out;
3233 * It is a handter who processes the DT tag.
3235 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3236 * destination is specified.
3237 * @param node [i] The DT tag node is specified.
3238 * @return The conversion result is returned.
3241 s_chtml20_start_dt_tag(void *pdoc, Node *UNUSED(child))
3243 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3244 Doc *doc = chtml20->doc;
3246 return chtml20->out;
3251 * It is a handter who processes the DT tag.
3253 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3254 * destination is specified.
3255 * @param node [i] The DT tag node is specified.
3256 * @return The conversion result is returned.
3259 s_chtml20_end_dt_tag(void *pdoc, Node *UNUSED(child))
3261 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3263 return chtml20->out;
3268 * It is a handder who processes the DD tag.
3270 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3271 * destination is specified.
3272 * @param node [i] The DD tag node is specified.
3273 * @return The conversion result is returned.
3276 s_chtml20_start_dd_tag(void *pdoc, Node *UNUSED(child))
3278 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3279 Doc *doc = chtml20->doc;
3281 return chtml20->out;
3286 * It is a handder who processes the DD tag.
3288 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3289 * destination is specified.
3290 * @param node [i] The DD tag node is specified.
3291 * @return The conversion result is returned.
3294 s_chtml20_end_dd_tag(void *pdoc, Node *UNUSED(child))
3296 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3298 return chtml20->out;
3303 * It is a hanmenuer who processes the MENU tag.
3305 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3306 * destination is specified.
3307 * @param node [i] The MENU tag node is specified.
3308 * @return The conversion result is returned.
3311 s_chtml20_start_menu_tag(void *pdoc, Node *UNUSED(child))
3313 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3314 Doc *doc = chtml20->doc;
3317 return chtml20->out;
3322 * It is a hanmenuer who processes the MENU tag.
3324 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3325 * destination is specified.
3326 * @param node [i] The MENU tag node is specified.
3327 * @return The conversion result is returned.
3330 s_chtml20_end_menu_tag(void *pdoc, Node *UNUSED(child))
3332 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3333 Doc *doc = chtml20->doc;
3336 return chtml20->out;
3341 * It is a hanplaintexter who processes the PLAINTEXT tag.
3343 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3344 * destination is specified.
3345 * @param node [i] The PLAINTEXT tag node is specified.
3346 * @return The conversion result is returned.
3349 s_chtml20_start_plaintext_tag(void *pdoc, Node *node)
3351 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3352 Doc *doc = chtml20->doc;
3355 s_chtml20_start_plaintext_tag_inner(pdoc,node);
3356 return chtml20->out;
3360 s_chtml20_start_plaintext_tag_inner(void *pdoc, Node *node)
3362 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3363 Doc *doc = chtml20->doc;
3366 for (child = qs_get_child_node(doc, node);
3368 child = qs_get_next_node(doc, child)) {
3370 s_chtml20_start_plaintext_tag_inner(pdoc, child);
3372 return chtml20->out;
3377 * It is a hanplaintexter who processes the PLAINTEXT tag.
3379 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3380 * destination is specified.
3381 * @param node [i] The PLAINTEXT tag node is specified.
3382 * @return The conversion result is returned.
3385 s_chtml20_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3387 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3388 return chtml20->out;
3392 * It is a hanblinker who processes the BLINK tag.
3394 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3395 * destination is specified.
3396 * @param node [i] The BLINK tag node is specified.
3397 * @return The conversion result is returned.
3400 s_chtml20_start_blink_tag(void *pdoc, Node *UNUSED(child))
3402 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3403 Doc *doc = chtml20->doc;
3405 return chtml20->out;
3410 * It is a hanblinker who processes the BLINK tag.
3412 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3413 * destination is specified.
3414 * @param node [i] The BLINK tag node is specified.
3415 * @return The conversion result is returned.
3418 s_chtml20_end_blink_tag(void *pdoc, Node *UNUSED(child))
3420 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3421 Doc *doc = chtml20->doc;
3423 return chtml20->out;
3428 * It is a hanmarqueeer who processes the MARQUEE tag.
3430 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3431 * destination is specified.
3432 * @param node [i] The MARQUEE tag node is specified.
3433 * @return The conversion result is returned.
3436 s_chtml20_start_marquee_tag(void *pdoc, Node *node)
3438 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3439 Doc *doc = chtml20->doc;
3442 /*--------------------------------------------------------------------------*/
3443 /* Get Attributes */
3444 /*--------------------------------------------------------------------------*/
3445 for (attr = qs_get_attr(doc,node);
3447 attr = qs_get_next_attr(doc,attr)) {
3448 char *name = qs_get_attr_name(doc,attr);
3449 char *value = qs_get_attr_value(doc,attr);
3450 if (STRCASEEQ('d','D',"direction", name)) {
3451 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3452 W_L(" direction=\"");
3457 else if (STRCASEEQ('b','B',"behavior",name)) {
3458 if (value && (STRCASEEQ('s','S',"scroll",value) || STRCASEEQ('s','S',"slide",value) || STRCASEEQ('a','A',"alternate",value))) {
3459 W_L(" behavior=\"");
3464 else if (STRCASEEQ('l','L',"loop",name)) {
3465 if (value && *value) {
3473 return chtml20->out;
3478 * It is a hanmarqueeer who processes the MARQUEE tag.
3480 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3481 * destination is specified.
3482 * @param node [i] The MARQUEE tag node is specified.
3483 * @return The conversion result is returned.
3486 s_chtml20_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3488 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3489 Doc *doc = chtml20->doc;
3491 return chtml20->out;
3496 * * It is handler who processes the New Line Code.
3499 s_chtml20_newline_mark(void *pdoc, Node *UNUSED(node))
3501 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3502 Doc *doc = chtml20->doc;
3504 return chtml20->out;