2 * Copyright (C) 2005-2008 Atsushi Konno All rights reserved.
3 * Copyright (C) 2005 QSDN,Inc. All rights reserved.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 #include "chxj_chtml20.h"
18 #include "chxj_hdml.h"
19 #include "chxj_str_util.h"
20 #include "chxj_dump.h"
21 #include "chxj_img_conv.h"
22 #include "chxj_qr_code.h"
23 #include "chxj_encoding.h"
24 #include "chxj_buffered_write.h"
27 #define GET_CHTML20(X) ((chtml20_t*)(X))
30 #define W_L(X) do { chtml20->out = BUFFERED_WRITE_LITERAL(chtml20->out, &doc->buf, (X)); } while(0)
31 #define W_V(X) do { chtml20->out = (X) ? BUFFERED_WRITE_VALUE(chtml20->out, &doc->buf, (X)) \
32 : BUFFERED_WRITE_LITERAL(chtml20->out, &doc->buf, ""); } while(0)
34 #define W_NLCODE() do { char *nlcode = TO_NLCODE(chtml20->conf); W_V(nlcode); } while (0)
36 static char *s_chtml20_start_html_tag (void *pdoc, Node *node);
37 static char *s_chtml20_end_html_tag (void *pdoc, Node *node);
38 static char *s_chtml20_start_meta_tag (void *pdoc, Node *node);
39 static char *s_chtml20_end_meta_tag (void *pdoc, Node *node);
40 static char *s_chtml20_start_textarea_tag(void *pdoc, Node *node);
41 static char *s_chtml20_end_textarea_tag (void *pdoc, Node *node);
42 static char *s_chtml20_start_p_tag (void *pdoc, Node *node);
43 static char *s_chtml20_end_p_tag (void *pdoc, Node *node);
44 static char *s_chtml20_start_pre_tag (void *pdoc, Node *node);
45 static char *s_chtml20_end_pre_tag (void *pdoc, Node *node);
46 static char *s_chtml20_start_h1_tag (void *pdoc, Node *node);
47 static char *s_chtml20_end_h1_tag (void *pdoc, Node *node);
48 static char *s_chtml20_start_h2_tag (void *pdoc, Node *node);
49 static char *s_chtml20_end_h2_tag (void *pdoc, Node *node);
50 static char *s_chtml20_start_h3_tag (void *pdoc, Node *node);
51 static char *s_chtml20_end_h3_tag (void *pdoc, Node *node);
52 static char *s_chtml20_start_h4_tag (void *pdoc, Node *node);
53 static char *s_chtml20_end_h4_tag (void *pdoc, Node *node);
54 static char *s_chtml20_start_h5_tag (void *pdoc, Node *node);
55 static char *s_chtml20_end_h5_tag (void *pdoc, Node *node);
56 static char *s_chtml20_start_h6_tag (void *pdoc, Node *node);
57 static char *s_chtml20_end_h6_tag (void *pdoc, Node *node);
58 static char *s_chtml20_start_ul_tag (void *pdoc, Node *node);
59 static char *s_chtml20_end_ul_tag (void *pdoc, Node *node);
60 static char *s_chtml20_start_ol_tag (void *pdoc, Node *node);
61 static char *s_chtml20_end_ol_tag (void *pdoc, Node *node);
62 static char *s_chtml20_start_li_tag (void *pdoc, Node *node);
63 static char *s_chtml20_end_li_tag (void *pdoc, Node *node);
64 static char *s_chtml20_start_head_tag (void *pdoc, Node *node);
65 static char *s_chtml20_end_head_tag (void *pdoc, Node *node);
66 static char *s_chtml20_start_title_tag (void *pdoc, Node *node);
67 static char *s_chtml20_end_title_tag (void *pdoc, Node *node);
68 static char *s_chtml20_start_base_tag (void *pdoc, Node *node);
69 static char *s_chtml20_end_base_tag (void *pdoc, Node *node);
70 static char *s_chtml20_start_body_tag (void *pdoc, Node *node);
71 static char *s_chtml20_end_body_tag (void *pdoc, Node *node);
72 static char *s_chtml20_start_a_tag (void *pdoc, Node *node);
73 static char *s_chtml20_end_a_tag (void *pdoc, Node *node);
74 static char *s_chtml20_start_br_tag (void *pdoc, Node *node);
75 static char *s_chtml20_end_br_tag (void *pdoc, Node *node);
76 static char *s_chtml20_start_tr_tag (void *pdoc, Node *node);
77 static char *s_chtml20_end_tr_tag (void *pdoc, Node *node);
78 static char *s_chtml20_start_font_tag (void *pdoc, Node *node);
79 static char *s_chtml20_end_font_tag (void *pdoc, Node *node);
80 static char *s_chtml20_start_form_tag (void *pdoc, Node *node);
81 static char *s_chtml20_end_form_tag (void *pdoc, Node *node);
82 static char *s_chtml20_start_input_tag (void *pdoc, Node *node);
83 static char *s_chtml20_end_input_tag (void *pdoc, Node *node);
84 static char *s_chtml20_start_center_tag (void *pdoc, Node *node);
85 static char *s_chtml20_end_center_tag (void *pdoc, Node *node);
86 static char *s_chtml20_start_hr_tag (void *pdoc, Node *node);
87 static char *s_chtml20_end_hr_tag (void *pdoc, Node *node);
88 static char *s_chtml20_start_img_tag (void *pdoc, Node *node);
89 static char *s_chtml20_end_img_tag (void *pdoc, Node *node);
90 static char *s_chtml20_start_select_tag (void *pdoc, Node *node);
91 static char *s_chtml20_end_select_tag (void *pdoc, Node *node);
92 static char *s_chtml20_start_option_tag (void *pdoc, Node *node);
93 static char *s_chtml20_end_option_tag (void *pdoc, Node *node);
94 static char *s_chtml20_start_div_tag (void *pdoc, Node *node);
95 static char *s_chtml20_end_div_tag (void *pdoc, Node *node);
96 static char *s_chtml20_start_blockquote_tag(void *pdoc, Node *node);
97 static char *s_chtml20_end_blockquote_tag (void *pdoc, Node *node);
98 static char *s_chtml20_start_dir_tag (void *pdoc, Node *node);
99 static char *s_chtml20_end_dir_tag (void *pdoc, Node *node);
100 static char *s_chtml20_start_dl_tag (void *pdoc, Node *node);
101 static char *s_chtml20_end_dl_tag (void *pdoc, Node *node);
102 static char *s_chtml20_start_dt_tag (void *pdoc, Node *node);
103 static char *s_chtml20_end_dt_tag (void *pdoc, Node *node);
104 static char *s_chtml20_start_dd_tag (void *pdoc, Node *node);
105 static char *s_chtml20_end_dd_tag (void *pdoc, Node *node);
106 static char *s_chtml20_start_menu_tag (void *pdoc, Node *node);
107 static char *s_chtml20_end_menu_tag (void *pdoc, Node *node);
108 static char *s_chtml20_start_plaintext_tag (void *pdoc, Node *node);
109 static char *s_chtml20_start_plaintext_tag_inner (void *pdoc, Node *node);
110 static char *s_chtml20_end_plaintext_tag (void *pdoc, Node *node);
111 static char *s_chtml20_start_blink_tag (void *pdoc, Node *node);
112 static char *s_chtml20_end_blink_tag (void *pdoc, Node *node);
113 static char *s_chtml20_start_marquee_tag (void *pdoc, Node *node);
114 static char *s_chtml20_end_marquee_tag (void *pdoc, Node *node);
115 static char *s_chtml20_newline_mark (void *pdoc, Node *node);
117 static void s_init_chtml20(chtml20_t *chtml, Doc *doc, request_rec *r, device_table *spec);
119 static int s_chtml20_search_emoji(chtml20_t *chtml, char *txt, char **rslt);
121 static char *s_chtml20_chxjif_tag(void *pdoc, Node *node);
122 static char *s_chtml20_text_tag(void *pdoc, Node *node);
125 tag_handler chtml20_handler[] = {
128 s_chtml20_start_html_tag,
129 s_chtml20_end_html_tag,
133 s_chtml20_start_meta_tag,
134 s_chtml20_end_meta_tag,
138 s_chtml20_start_textarea_tag,
139 s_chtml20_end_textarea_tag,
143 s_chtml20_start_p_tag,
148 s_chtml20_start_pre_tag,
149 s_chtml20_end_pre_tag,
153 s_chtml20_start_ul_tag,
154 s_chtml20_end_ul_tag,
158 s_chtml20_start_li_tag,
159 s_chtml20_end_li_tag,
163 s_chtml20_start_ol_tag,
164 s_chtml20_end_ol_tag,
168 s_chtml20_start_h1_tag,
169 s_chtml20_end_h1_tag,
173 s_chtml20_start_h2_tag,
174 s_chtml20_end_h2_tag,
178 s_chtml20_start_h3_tag,
179 s_chtml20_end_h3_tag,
183 s_chtml20_start_h4_tag,
184 s_chtml20_end_h4_tag,
188 s_chtml20_start_h5_tag,
189 s_chtml20_end_h5_tag,
193 s_chtml20_start_h6_tag,
194 s_chtml20_end_h6_tag,
198 s_chtml20_start_head_tag,
199 s_chtml20_end_head_tag,
203 s_chtml20_start_title_tag,
204 s_chtml20_end_title_tag,
208 s_chtml20_start_base_tag,
209 s_chtml20_end_base_tag,
213 s_chtml20_start_body_tag,
214 s_chtml20_end_body_tag,
218 s_chtml20_start_a_tag,
223 s_chtml20_start_br_tag,
224 s_chtml20_end_br_tag,
233 s_chtml20_start_tr_tag,
234 s_chtml20_end_tr_tag,
248 s_chtml20_start_font_tag,
249 s_chtml20_end_font_tag,
253 s_chtml20_start_form_tag,
254 s_chtml20_end_form_tag,
258 s_chtml20_start_input_tag,
259 s_chtml20_end_input_tag,
263 s_chtml20_start_center_tag,
264 s_chtml20_end_center_tag,
268 s_chtml20_start_hr_tag,
269 s_chtml20_end_hr_tag,
273 s_chtml20_start_img_tag,
274 s_chtml20_end_img_tag,
278 s_chtml20_start_select_tag,
279 s_chtml20_end_select_tag,
283 s_chtml20_start_option_tag,
284 s_chtml20_end_option_tag,
288 s_chtml20_start_div_tag,
289 s_chtml20_end_div_tag,
293 s_chtml20_chxjif_tag,
338 s_chtml20_start_dt_tag,
339 s_chtml20_end_dt_tag,
353 s_chtml20_start_blockquote_tag,
354 s_chtml20_end_blockquote_tag,
358 s_chtml20_start_dir_tag,
359 s_chtml20_end_dir_tag,
363 s_chtml20_start_dl_tag,
364 s_chtml20_end_dl_tag,
368 s_chtml20_start_dd_tag,
369 s_chtml20_end_dd_tag,
373 s_chtml20_start_menu_tag,
374 s_chtml20_end_menu_tag,
378 s_chtml20_start_plaintext_tag,
379 s_chtml20_end_plaintext_tag,
383 s_chtml20_start_blink_tag,
384 s_chtml20_end_blink_tag,
388 s_chtml20_start_marquee_tag,
389 s_chtml20_end_marquee_tag,
393 s_chtml20_newline_mark,
399 * converts from CHTML5.0 to CHTML2.0.
401 * @param r [i] Requet_rec is appointed.
402 * @param spec [i] The result of the device specification processing which
403 * was done in advance is appointed.
404 * @param src [i] The character string before the converting is appointed.
405 * @return The character string after the converting is returned.
408 chxj_convert_chtml20(
414 chxjconvrule_entry *entryp,
423 /*--------------------------------------------------------------------------*/
425 /*--------------------------------------------------------------------------*/
427 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
429 DBG(r,"i found qrcode xml");
432 DBG(r,"not found qrcode xml");
434 /*--------------------------------------------------------------------------*/
435 /* The CHTML structure is initialized. */
436 /*--------------------------------------------------------------------------*/
437 s_init_chtml20(&chtml20, &doc, r, spec);
440 chtml20.entryp = entryp;
441 chtml20.cookie = cookie;
443 chxj_set_content_type(r, "text/html; charset=Windows-31J");
445 /*--------------------------------------------------------------------------*/
446 /* The character string of the input is analyzed. */
447 /*--------------------------------------------------------------------------*/
448 qs_init_malloc(&doc);
449 qs_init_root_node(&doc);
451 ss = apr_pcalloc(r->pool, srclen + 1);
452 memset(ss, 0, srclen + 1);
453 memcpy(ss, src, srclen);
456 chxj_dump_out("[src] CHTML -> CHTML2.0", ss, srclen);
459 qs_parse_string(&doc,ss, strlen(ss));
461 chxj_buffered_write_init(r->pool, &doc.buf);
462 /*--------------------------------------------------------------------------*/
463 /* It converts it from CHTML to CHTML. */
464 /*--------------------------------------------------------------------------*/
465 chxj_node_convert(spec,r,(void *)&chtml20, &doc, qs_get_root(&doc), 0);
466 chtml20.out = chxj_buffered_write_flush(chtml20.out, &doc.buf);
467 dst = apr_pstrdup(r->pool, chtml20.out);
468 chxj_buffered_write_terminate(&doc.buf);
470 qs_all_free(&doc,QX_LOGMARK);
473 return apr_pstrdup(r->pool,ss);
476 if (strlen(dst) == 0) {
477 dst = apr_psprintf(r->pool, "\n");
480 *dstlen = strlen(dst);
483 chxj_dump_out("[dst] CHTML -> CHTML2.0", dst, *dstlen);
490 * The CHTML structure is initialized.
492 * @param chtml20 [i/o] The pointer to the HDML structure that wants to be
493 * initialized is specified.
494 * @param doc [i] The Doc structure that should be set to the initialized
495 * HDML structure is specified.
496 * @param r [i] To use POOL, the pointer to request_rec is specified.
497 * @param spec [i] The pointer to the device_table
500 s_init_chtml20(chtml20_t *chtml20, Doc *doc, request_rec *r, device_table *spec)
502 memset(doc, 0, sizeof(Doc));
503 memset(chtml20, 0, sizeof(chtml20_t));
507 chtml20->spec = spec;
508 chtml20->out = qs_alloc_zero_byte_string(r->pool);
509 chtml20->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
511 chtml20->doc->parse_mode = PARSE_MODE_CHTML;
516 * Corresponding EMOJI to a current character-code is retrieved.
517 * The substitution character string is stored in the rslt pointer if agreeing.
519 * @param chtml20 [i] The pointer to the CHTML structure is specified.
520 * @param txt [i] The character string to want to examine whether it is
521 * EMOJI is specified.
522 * @param rslt [o] The pointer to the pointer that stores the result is
524 * @return When corresponding EMOJI exists, it returns it excluding 0.
527 s_chtml20_search_emoji(chtml20_t *chtml20, char *txt, char **rslt)
534 spec = chtml20->spec;
540 DBG(r,"spec is NULL");
542 for (ee = chtml20->conf->emoji;
546 if (ee->imode == NULL) {
547 DBG(r,"emoji->imode is NULL");
551 if (ee->imode->string != NULL
552 && strlen(ee->imode->string) > 0
553 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
554 if (spec == NULL || spec->emoji_type == NULL) {
555 *rslt = apr_palloc(r->pool, 3);
556 (*rslt)[0] = ee->imode->hex1byte & 0xff;
557 (*rslt)[1] = ee->imode->hex2byte & 0xff;
559 return strlen(ee->imode->string);
571 * It is a handler who processes the HTML tag.
573 * @param pdoc [i/o] The pointer to the CHTML structure at the output
574 * destination is specified.
575 * @param node [i] The HTML tag node is specified.
576 * @return The conversion result is returned.
579 s_chtml20_start_html_tag(void *pdoc, Node *UNUSED(node))
585 chtml20 = GET_CHTML20(pdoc);
589 /*--------------------------------------------------------------------------*/
591 /*--------------------------------------------------------------------------*/
598 * It is a handler who processes the HTML tag.
600 * @param pdoc [i/o] The pointer to the CHTML structure at the output
601 * destination is specified.
602 * @param node [i] The HTML tag node is specified.
603 * @return The conversion result is returned.
606 s_chtml20_end_html_tag(void *pdoc, Node *UNUSED(child))
612 chtml20 = GET_CHTML20(pdoc);
622 * It is a handler who processes the META tag.
624 * @param pdoc [i/o] The pointer to the CHTML structure at the output
625 * destination is specified.
626 * @param node [i] The META tag node is specified.
627 * @return The conversion result is returned.
630 s_chtml20_start_meta_tag(void *pdoc, Node *node)
636 int content_type_flag;
639 chtml20 = GET_CHTML20(pdoc);
643 content_type_flag = 0;
647 /*--------------------------------------------------------------------------*/
649 /*--------------------------------------------------------------------------*/
650 for (attr = qs_get_attr(doc,node);
652 attr = qs_get_next_attr(doc,attr)) {
653 char *name = qs_get_attr_name(doc,attr);
654 char *value = qs_get_attr_value(doc,attr);
658 if (strcasecmp(name, "http-equiv") == 0 && value && *value) {
659 /*----------------------------------------------------------------------*/
661 /*----------------------------------------------------------------------*/
662 W_L(" http-equiv=\"");
665 if (STRCASEEQ('c','C',"content-type", value)) {
666 content_type_flag = 1;
668 if (STRCASEEQ('r','R',"refresh", value)) {
676 if (strcasecmp(name, "content") == 0 && value && *value) {
677 if (content_type_flag) {
680 W_L("=\"text/html; charset=Windows-31J\"");
682 else if (refresh_flag) {
683 char *buf = apr_pstrdup(r->pool, value);
687 url = strchr(buf, ';');
689 sec = apr_pstrdup(r->pool, buf);
692 url = chxj_encoding_parameter(r, url);
693 url = chxj_add_cookie_parameter(r, url, chtml20->cookie);
724 * It is a handler who processes the META tag.
726 * @param pdoc [i/o] The pointer to the CHTML structure at the output
727 * destination is specified.
728 * @param node [i] The META tag node is specified.
729 * @return The conversion result is returned.
732 s_chtml20_end_meta_tag(void *pdoc, Node *UNUSED(child))
734 chtml20_t *chtml20 = GET_CHTML20(pdoc);
741 * It is a handler who processes the HEAD tag.
743 * @param pdoc [i/o] The pointer to the CHTML structure at the output
744 * destination is specified.
745 * @param node [i] The HEAD tag node is specified.
746 * @return The conversion result is returned.
749 s_chtml20_start_head_tag(void *pdoc, Node *UNUSED(node))
754 chtml20 = GET_CHTML20(pdoc);
764 * It is a handler who processes the HEAD tag.
766 * @param pdoc [i/o] The pointer to the CHTML structure at the output
767 * destination is specified.
768 * @param node [i] The HEAD tag node is specified.
769 * @return The conversion result is returned.
772 s_chtml20_end_head_tag(void *pdoc, Node *UNUSED(child))
778 chtml20 = GET_CHTML20(pdoc);
789 * It is a handler who processes the TITLE tag.
791 * @param pdoc [i/o] The pointer to the CHTML structure at the output
792 * destination is specified.
793 * @param node [i] The TITLE tag node is specified.
794 * @return The conversion result is returned.
797 s_chtml20_start_title_tag(void *pdoc, Node *UNUSED(node))
803 chtml20 = GET_CHTML20(pdoc);
814 * It is a handler who processes the TITLE tag.
816 * @param pdoc [i/o] The pointer to the CHTML structure at the output
817 * destination is specified.
818 * @param node [i] The TITLE tag node is specified.
819 * @return The conversion result is returned.
822 s_chtml20_end_title_tag(void *pdoc, Node *UNUSED(child))
828 chtml20 = GET_CHTML20(pdoc);
839 * It is a handler who processes the BASE tag.
841 * @param pdoc [i/o] The pointer to the CHTML structure at the output
842 * destination is specified.
843 * @param node [i] The BASE tag node is specified.
844 * @return The conversion result is returned.
847 s_chtml20_start_base_tag(void *pdoc, Node *node)
854 chtml20 = GET_CHTML20(pdoc);
859 /*--------------------------------------------------------------------------*/
861 /*--------------------------------------------------------------------------*/
862 for (attr = qs_get_attr(doc,node);
864 attr = qs_get_next_attr(doc,attr)) {
865 char *name = qs_get_attr_name(doc,attr);
866 char *value = qs_get_attr_value(doc,attr);
867 if (STRCASEEQ('h','H',"href", name)) {
880 * It is a handler who processes the BASE tag.
882 * @param pdoc [i/o] The pointer to the CHTML structure at the output
883 * destination is specified.
884 * @param node [i] The BASE tag node is specified.
885 * @return The conversion result is returned.
888 s_chtml20_end_base_tag(void *pdoc, Node *UNUSED(child))
894 chtml20 = GET_CHTML20(pdoc);
903 * It is a handler who processes the BODY tag.
905 * @param pdoc [i/o] The pointer to the CHTML structure at the output
906 * destination is specified.
907 * @param node [i] The BODY tag node is specified.
908 * @return The conversion result is returned.
911 s_chtml20_start_body_tag(void *pdoc, Node *node)
918 chtml20 = GET_CHTML20(pdoc);
923 /*--------------------------------------------------------------------------*/
925 /*--------------------------------------------------------------------------*/
926 for (attr = qs_get_attr(doc,node);
928 attr = qs_get_next_attr(doc,attr)) {
929 char *name = qs_get_attr_name(doc,attr);
930 char *value = qs_get_attr_value(doc,attr);
934 if (strcasecmp(name, "bgcolor") == 0 && value && *value != 0) {
935 /*----------------------------------------------------------------------*/
937 /*----------------------------------------------------------------------*/
946 if (strcasecmp(name, "text") == 0 && value && *value != 0) {
947 /*----------------------------------------------------------------------*/
949 /*----------------------------------------------------------------------*/
958 if (strcasecmp(name, "link") == 0 && value && *value != 0) {
959 /*----------------------------------------------------------------------*/
961 /*----------------------------------------------------------------------*/
970 if (strcasecmp(name, "alink") == 0) {
971 /*----------------------------------------------------------------------*/
973 /*----------------------------------------------------------------------*/
980 if (strcasecmp(name, "vlink") == 0) {
981 /*----------------------------------------------------------------------*/
983 /*----------------------------------------------------------------------*/
999 * It is a handler who processes the BODY tag.
1001 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1002 * destination is specified.
1003 * @param node [i] The BODY tag node is specified.
1004 * @return The conversion result is returned.
1007 s_chtml20_end_body_tag(void *pdoc, Node *UNUSED(child))
1013 chtml20 = GET_CHTML20(pdoc);
1019 return chtml20->out;
1024 * It is a handler who processes the A tag.
1026 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1027 * destination is specified.
1028 * @param node [i] The A tag node is specified.
1029 * @return The conversion result is returned.
1032 s_chtml20_start_a_tag(void *pdoc, Node *node)
1039 chtml20 = GET_CHTML20(pdoc);
1044 /*--------------------------------------------------------------------------*/
1045 /* Get Attributes */
1046 /*--------------------------------------------------------------------------*/
1047 for (attr = qs_get_attr(doc,node);
1049 attr = qs_get_next_attr(doc,attr)) {
1050 char *name = qs_get_attr_name(doc,attr);
1051 char *value = qs_get_attr_value(doc,attr);
1055 if (strcasecmp(name, "name") == 0) {
1056 /*--------------------------------------------------------------------*/
1058 /*--------------------------------------------------------------------*/
1067 if (strcasecmp(name, "href") == 0) {
1068 /*--------------------------------------------------------------------*/
1070 /*--------------------------------------------------------------------*/
1071 value = chxj_encoding_parameter(r, value);
1072 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
1081 if (strcasecmp(name, "accesskey") == 0) {
1082 /*--------------------------------------------------------------------*/
1084 /*--------------------------------------------------------------------*/
1085 W_L(" accesskey=\"");
1093 if (strcasecmp(name, "cti") == 0) {
1094 /*--------------------------------------------------------------------*/
1096 /*--------------------------------------------------------------------*/
1105 if (strcasecmp(name, "ijam") == 0) {
1106 /*--------------------------------------------------------------------*/
1108 /*--------------------------------------------------------------------*/
1112 if (strcasecmp(name, "ista") == 0) {
1113 /*--------------------------------------------------------------------*/
1115 /*--------------------------------------------------------------------*/
1119 if (strcasecmp(name, "ilet") == 0) {
1120 /*--------------------------------------------------------------------*/
1122 /*--------------------------------------------------------------------*/
1126 if (strcasecmp(name, "iswf") == 0) {
1127 /*--------------------------------------------------------------------*/
1129 /*--------------------------------------------------------------------*/
1133 if (strcasecmp(name, "irst") == 0) {
1134 /*--------------------------------------------------------------------*/
1136 /*--------------------------------------------------------------------*/
1143 if (strcasecmp(name, "utn") == 0) {
1144 /*--------------------------------------------------------------------*/
1146 /*--------------------------------------------------------------------*/
1153 if (strcasecmp(name, "telbook") == 0) {
1154 /*--------------------------------------------------------------------*/
1156 /*--------------------------------------------------------------------*/
1163 if (strcasecmp(name, "kana") == 0) {
1164 /*--------------------------------------------------------------------*/
1166 /*--------------------------------------------------------------------*/
1173 if (strcasecmp(name, "email") == 0) {
1174 /*--------------------------------------------------------------------*/
1176 /*--------------------------------------------------------------------*/
1186 return chtml20->out;
1191 * It is a handler who processes the A tag.
1193 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1194 * destination is specified.
1195 * @param node [i] The A tag node is specified.
1196 * @return The conversion result is returned.
1199 s_chtml20_end_a_tag(void *pdoc, Node *UNUSED(child))
1205 chtml20 = GET_CHTML20(pdoc);
1211 return chtml20->out;
1216 * It is a handler who processes the BR tag.
1218 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1219 * destination is specified.
1220 * @param node [i] The BR tag node is specified.
1221 * @return The conversion result is returned.
1224 s_chtml20_start_br_tag(void *pdoc, Node *node)
1231 chtml20 = GET_CHTML20(pdoc);
1236 /*--------------------------------------------------------------------------*/
1237 /* Get Attributes */
1238 /*--------------------------------------------------------------------------*/
1239 for (attr = qs_get_attr(doc,node);
1241 attr = qs_get_next_attr(doc,attr)) {
1242 char *name = qs_get_attr_name(doc,attr);
1243 char *value = qs_get_attr_value(doc,attr);
1244 if (STRCASEEQ('c','C',"clear",name)) {
1245 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1254 return chtml20->out;
1259 * It is a handler who processes the BR tag.
1261 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1262 * destination is specified.
1263 * @param node [i] The BR tag node is specified.
1264 * @return The conversion result is returned.
1267 s_chtml20_end_br_tag(void *pdoc, Node *UNUSED(child))
1273 chtml20 = GET_CHTML20(pdoc);
1277 return chtml20->out;
1282 * It is a handler who processes the TR tag.
1284 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1285 * destination is specified.
1286 * @param node [i] The TR tag node is specified.
1287 * @return The conversion result is returned.
1290 s_chtml20_start_tr_tag(void *pdoc, Node *UNUSED(node))
1296 chtml20 = GET_CHTML20(pdoc);
1300 return chtml20->out;
1305 * It is a handler who processes the TR tag.
1307 * @param chtml20 [i/o] The pointer to the CHTML structure at the output
1308 * destination is specified.
1309 * @param node [i] The TR tag node is specified.
1310 * @return The conversion result is returned.
1313 s_chtml20_end_tr_tag(void *pdoc, Node *UNUSED(child))
1319 chtml20 = GET_CHTML20(pdoc);
1325 return chtml20->out;
1330 * It is a handler who processes the FONT tag.
1332 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1333 * destination is specified.
1334 * @param node [i] The FONT tag node is specified.
1335 * @return The conversion result is returned.
1338 s_chtml20_start_font_tag(void *pdoc, Node *node)
1346 chtml20 = GET_CHTML20(pdoc);
1351 /*--------------------------------------------------------------------------*/
1352 /* Get Attributes */
1353 /*--------------------------------------------------------------------------*/
1354 for (attr = qs_get_attr(doc,node);
1355 attr && color == NULL;
1356 attr = qs_get_next_attr(doc,attr)) {
1357 char *name = qs_get_attr_name(doc,attr);
1358 char *value = qs_get_attr_value(doc,attr);
1362 if (strcasecmp(name, "color") == 0 && value && *value) {
1363 color = apr_pstrdup(doc->buf.pool, value);
1369 if (strcasecmp(name, "size") == 0) {
1370 /*--------------------------------------------------------------------*/
1372 /*--------------------------------------------------------------------*/
1382 W_L("<font color=\"");
1385 chtml20->font_flag++;
1387 return chtml20->out;
1392 * It is a handler who processes the FONT tag.
1394 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1395 * destination is specified.
1396 * @param node [i] The FONT tag node is specified.
1397 * @return The conversion result is returned.
1400 s_chtml20_end_font_tag(void *pdoc, Node *UNUSED(child))
1406 chtml20 = GET_CHTML20(pdoc);
1410 if (chtml20->font_flag) {
1412 chtml20->font_flag--;
1414 return chtml20->out;
1419 * It is a handler who processes the FORM tag.
1421 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1422 * destination is specified.
1423 * @param node [i] The FORM tag node is specified.
1424 * @return The conversion result is returned.
1427 s_chtml20_start_form_tag(void *pdoc, Node *node)
1433 char *new_hidden_tag = NULL;
1435 chtml20 = GET_CHTML20(pdoc);
1440 /*--------------------------------------------------------------------------*/
1441 /* Get Attributes */
1442 /*--------------------------------------------------------------------------*/
1443 for (attr = qs_get_attr(doc,node);
1445 attr = qs_get_next_attr(doc,attr)) {
1446 char *name = qs_get_attr_name(doc,attr);
1447 char *value = qs_get_attr_value(doc,attr);
1451 if (strcasecmp(name, "action") == 0) {
1452 /*--------------------------------------------------------------------*/
1454 /*--------------------------------------------------------------------*/
1455 value = chxj_encoding_parameter(r, value);
1456 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
1458 q = strchr(value, '?');
1460 new_hidden_tag = chxj_form_action_to_hidden_tag(doc->pool, value, 0);
1471 if (strcasecmp(name, "method") == 0) {
1472 /*--------------------------------------------------------------------*/
1474 /*--------------------------------------------------------------------*/
1483 if (strcasecmp(name, "utn") == 0) {
1484 /*--------------------------------------------------------------------*/
1486 /*--------------------------------------------------------------------*/
1496 if (new_hidden_tag) {
1497 W_V(new_hidden_tag);
1500 return chtml20->out;
1505 * It is a handler who processes the FORM tag.
1507 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1508 * destination is specified.
1509 * @param node [i] The FORM tag node is specified.
1510 * @return The conversion result is returned.
1513 s_chtml20_end_form_tag(void *pdoc, Node *UNUSED(child))
1519 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) {
1596 W_V(chxj_add_slash_to_doublequote(doc->pool, 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));
1635 return chtml20->out;
1640 * It is a handler who processes the INPUT tag.
1642 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1643 * destination is specified.
1644 * @param node [i] The INPUT tag node is specified.
1645 * @return The conversion result is returned.
1648 s_chtml20_end_input_tag(void *pdoc, Node *UNUSED(child))
1654 chtml20 = GET_CHTML20(pdoc);
1658 return chtml20->out;
1663 * It is a handler who processes the CENTER tag.
1665 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1666 * destination is specified.
1667 * @param node [i] The CENTER tag node is specified.
1668 * @return The conversion result is returned.
1671 s_chtml20_start_center_tag(void *pdoc, Node *UNUSED(node))
1677 chtml20 = GET_CHTML20(pdoc);
1682 return chtml20->out;
1687 * It is a handler who processes the CENTER tag.
1689 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1690 * destination is specified.
1691 * @param node [i] The CENTER tag node is specified.
1692 * @return The conversion result is returned.
1695 s_chtml20_end_center_tag(void *pdoc, Node *UNUSED(child))
1701 chtml20 = GET_CHTML20(pdoc);
1707 return chtml20->out;
1712 * It is a handler who processes the UL tag.
1714 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1715 * destination is specified.
1716 * @param node [i] The UL tag node is specified.
1717 * @return The conversion result is returned.
1720 s_chtml20_start_ul_tag(void *pdoc, Node *UNUSED(node))
1726 chtml20 = GET_CHTML20(pdoc);
1732 return chtml20->out;
1737 * It is a handler who processes the UL tag.
1739 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1740 * destination is specified.
1741 * @param node [i] The UL tag node is specified.
1742 * @return The conversion result is returned.
1745 s_chtml20_end_ul_tag(void *pdoc, Node *UNUSED(child))
1751 chtml20 = GET_CHTML20(pdoc);
1757 return chtml20->out;
1762 * It is a handler who processes the OL tag.
1764 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1765 * destination is specified.
1766 * @param node [i] The OL tag node is specified.
1767 * @return The conversion result is returned.
1770 s_chtml20_start_ol_tag(void *pdoc, Node *node)
1777 chtml20 = GET_CHTML20(pdoc);
1782 /*--------------------------------------------------------------------------*/
1783 /* Get Attributes */
1784 /*--------------------------------------------------------------------------*/
1785 for (attr = qs_get_attr(doc,node);
1787 attr = qs_get_next_attr(doc,attr)) {
1788 char *name = qs_get_attr_name(doc,attr);
1789 char *value = qs_get_attr_value(doc,attr);
1790 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
1795 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
1803 return chtml20->out;
1808 * It is a handler who processes the OL tag.
1810 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1811 * destination is specified.
1812 * @param node [i] The OL tag node is specified.
1813 * @return The conversion result is returned.
1816 s_chtml20_end_ol_tag(void *pdoc, Node *UNUSED(child))
1822 chtml20 = GET_CHTML20(pdoc);
1828 return chtml20->out;
1833 * It is a handler who processes the LI tag.
1835 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1836 * destination is specified.
1837 * @param node [i] The LI tag node is specified.
1838 * @return The conversion result is returned.
1841 s_chtml20_start_li_tag(void *pdoc, Node *node)
1848 chtml20 = GET_CHTML20(pdoc);
1853 /*--------------------------------------------------------------------------*/
1854 /* Get Attributes */
1855 /*--------------------------------------------------------------------------*/
1856 for (attr = qs_get_attr(doc,node);
1858 attr = qs_get_next_attr(doc,attr)) {
1859 char *name = qs_get_attr_name(doc,attr);
1860 char *value = qs_get_attr_value(doc,attr);
1861 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
1866 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
1873 return chtml20->out;
1878 * It is a handler who processes the LI tag.
1880 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1881 * destination is specified.
1882 * @param node [i] The LI tag node is specified.
1883 * @return The conversion result is returned.
1886 s_chtml20_end_li_tag(void *pdoc, Node *UNUSED(child))
1888 chtml20_t *chtml20 = GET_CHTML20(pdoc);
1889 return chtml20->out;
1894 * It is a handler who processes the HR tag.
1896 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1897 * destination is specified.
1898 * @param node [i] The HR tag node is specified.
1899 * @return The conversion result is returned.
1902 s_chtml20_start_hr_tag(void *pdoc, Node *node)
1909 chtml20 = GET_CHTML20(pdoc);
1915 for (attr = qs_get_attr(doc,node);
1917 attr = qs_get_next_attr(doc,attr)) {
1918 char *name = qs_get_attr_name(doc,attr);
1919 char *value = qs_get_attr_value(doc,attr);
1923 if (strcasecmp(name, "align") == 0) {
1924 /*--------------------------------------------------------------------*/
1926 /*--------------------------------------------------------------------*/
1927 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1937 if (strcasecmp(name, "size") == 0) {
1938 /*--------------------------------------------------------------------*/
1940 /*--------------------------------------------------------------------*/
1941 if (value && value[0] != '\0') {
1951 if (strcasecmp(name, "width") == 0) {
1952 /*--------------------------------------------------------------------*/
1954 /*--------------------------------------------------------------------*/
1955 if (value && value[0] != '\0') {
1965 if (strcasecmp(name, "noshade") == 0) {
1966 /*--------------------------------------------------------------------*/
1968 /*--------------------------------------------------------------------*/
1975 if (strcasecmp(name, "color") == 0) {
1976 /*--------------------------------------------------------------------*/
1978 /*--------------------------------------------------------------------*/
1988 return chtml20->out;
1993 * It is a handler who processes the HR tag.
1995 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1996 * destination is specified.
1997 * @param node [i] The HR tag node is specified.
1998 * @return The conversion result is returned.
2001 s_chtml20_end_hr_tag(void *pdoc, Node *UNUSED(child))
2003 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2004 return chtml20->out;
2009 * It is a handler who processes the IMG tag.
2011 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2012 * destination is specified.
2013 * @param node [i] The IMG tag node is specified.
2014 * @return The conversion result is returned.
2017 s_chtml20_start_img_tag(void *pdoc, Node *node)
2023 #ifndef IMG_NOT_CONVERT_FILENAME
2027 chtml20 = GET_CHTML20(pdoc);
2031 #ifndef IMG_NOT_CONVERT_FILENAME
2032 spec = chtml20->spec;
2036 /*-------------------------------------------------------------------------*/
2037 /* Get Attributes */
2038 /*-------------------------------------------------------------------------*/
2039 for (attr = qs_get_attr(doc,node);
2041 attr = qs_get_next_attr(doc,attr)) {
2042 char *name = qs_get_attr_name(doc,attr);
2043 char *value = qs_get_attr_value(doc,attr);
2047 if (strcasecmp(name, "src") == 0) {
2048 /*-------------------------------------------------------------------*/
2050 /*-------------------------------------------------------------------*/
2051 #ifdef IMG_NOT_CONVERT_FILENAME
2052 value = chxj_encoding_parameter(r, value);
2053 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
2055 value = apr_psprintf(doc->buf.pool,
2058 (strchr(value, '?')) ? '&' : '?',
2059 CHXJ_COOKIE_NOUPDATE_PARAM);
2065 value = chxj_img_conv(r, spec, value);
2066 value = chxj_encoding_parameter(r, value);
2067 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
2069 value = apr_psprintf(doc->buf.pool,
2072 (strchr(value, '?')) ? '&' : '?',
2073 CHXJ_COOKIE_NOUPDATE_PARAM);
2084 if (strcasecmp(name, "align" ) == 0) {
2085 /*--------------------------------------------------------------------*/
2087 /*--------------------------------------------------------------------*/
2089 if (STRCASEEQ('t','T',"top", value) ||
2090 STRCASEEQ('m','M',"middle",value) ||
2091 STRCASEEQ('b','B',"bottom",value) ||
2092 STRCASEEQ('l','L',"left", value) ||
2093 STRCASEEQ('r','R',"right", value)) {
2098 else if (STRCASEEQ('c','C',"center", value)) {
2105 else if (strcasecmp(name, "alt" ) == 0 && value && *value) {
2106 /*--------------------------------------------------------------------*/
2108 /*--------------------------------------------------------------------*/
2117 if (strcasecmp(name, "width" ) == 0 && value && *value) {
2118 /*--------------------------------------------------------------------*/
2120 /*--------------------------------------------------------------------*/
2129 if (strcasecmp(name, "height") == 0 && value && *value) {
2130 /*--------------------------------------------------------------------*/
2132 /*--------------------------------------------------------------------*/
2137 else if (strcasecmp(name, "hspace") == 0 && value && *value) {
2138 /*--------------------------------------------------------------------*/
2140 /*--------------------------------------------------------------------*/
2149 if (strcasecmp(name, "vspace") == 0 && value && *value) {
2150 /*--------------------------------------------------------------------*/
2152 /*--------------------------------------------------------------------*/
2164 return chtml20->out;
2169 * It is a handler who processes the IMG tag.
2171 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2172 * destination is specified.
2173 * @param node [i] The IMG tag node is specified.
2174 * @return The conversion result is returned.
2177 s_chtml20_end_img_tag(void *pdoc, Node *UNUSED(child))
2179 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2181 return chtml20->out;
2186 * It is a handler who processes the SELECT tag.
2188 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2189 * destination is specified.
2190 * @param node [i] The SELECT tag node is specified.
2191 * @return The conversion result is returned.
2194 s_chtml20_start_select_tag(void *pdoc, Node *child)
2201 chtml20 = GET_CHTML20(pdoc);
2207 char *multiple = NULL;
2210 for (attr = qs_get_attr(doc,child);
2212 attr = qs_get_next_attr(doc,attr)) {
2213 char *nm = qs_get_attr_name(doc,attr);
2214 char *val = qs_get_attr_value(doc,attr);
2218 if (strcasecmp(nm, "size") == 0) {
2219 /*--------------------------------------------------------------------*/
2220 /* CHTML 1.0 version 2.0 */
2221 /*--------------------------------------------------------------------*/
2222 size = apr_pstrdup(doc->buf.pool, val);
2228 if (strcasecmp(nm, "name") == 0) {
2229 /*--------------------------------------------------------------------*/
2230 /* CHTML 1.0 version 2.0 */
2231 /*--------------------------------------------------------------------*/
2232 name = apr_pstrdup(doc->buf.pool, val);
2238 if (strcasecmp(nm, "multiple") == 0) {
2239 /*--------------------------------------------------------------------*/
2240 /* CHTML 1.0 version 2.0 */
2241 /*--------------------------------------------------------------------*/
2242 multiple = apr_pstrdup(doc->buf.pool, val);
2250 if (size && *size) {
2255 if (name && *name) {
2264 return chtml20->out;
2269 * It is a handler who processes the SELECT tag.
2271 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2272 * destination is specified.
2273 * @param node [i] The SELECT tag node is specified.
2274 * @return The conversion result is returned.
2277 s_chtml20_end_select_tag(void *pdoc, Node *UNUSED(child))
2282 chtml20 = GET_CHTML20(pdoc);
2286 return chtml20->out;
2291 * It is a handler who processes the OPTION tag.
2293 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2294 * destination is specified.
2295 * @param node [i] The OPTION tag node is specified.
2296 * @return The conversion result is returned.
2299 s_chtml20_start_option_tag(void *pdoc, Node *child)
2306 chtml20 = GET_CHTML20(pdoc);
2310 char *selected = NULL;
2314 for (attr = qs_get_attr(doc,child);
2316 attr = qs_get_next_attr(doc,attr)) {
2317 char *nm = qs_get_attr_name(doc,attr);
2318 char *val = qs_get_attr_value(doc,attr);
2322 if (strcasecmp(nm, "selected") == 0) {
2323 /*--------------------------------------------------------------------*/
2324 /* CHTML 1.0 version 2.0 */
2325 /*--------------------------------------------------------------------*/
2326 selected = apr_pstrdup(doc->buf.pool, val);
2332 if (strcasecmp(nm, "value") == 0) {
2333 /*--------------------------------------------------------------------*/
2334 /* CHTML 1.0 version 2.0 */
2335 /*--------------------------------------------------------------------*/
2336 value = apr_pstrdup(doc->buf.pool, val);
2345 if (value && *value) {
2355 return chtml20->out;
2360 * It is a handler who processes the OPTION tag.
2362 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2363 * destination is specified.
2364 * @param node [i] The OPTION tag node is specified.
2365 * @return The conversion result is returned.
2368 s_chtml20_end_option_tag(void *pdoc, Node *UNUSED(child))
2370 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2374 return chtml20->out;
2379 * It is a handler who processes the DIV tag.
2381 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2382 * destination is specified.
2383 * @param node [i] The DIV tag node is specified.
2384 * @return The conversion result is returned.
2387 s_chtml20_start_div_tag(void *pdoc, Node *child)
2394 chtml20 = GET_CHTML20(pdoc);
2402 for (attr = qs_get_attr(doc,child);
2404 attr = qs_get_next_attr(doc,attr)) {
2405 char *nm = qs_get_attr_name(doc,attr);
2406 char *val = qs_get_attr_value(doc,attr);
2407 if (STRCASEEQ('a','A', "align", nm)) {
2408 /*----------------------------------------------------------------------*/
2409 /* CHTML 1.0 (W3C version 3.2) */
2410 /*----------------------------------------------------------------------*/
2411 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2412 align = apr_pstrdup(doc->buf.pool, val);
2422 return chtml20->out;
2427 * It is a handler who processes the DIV tag.
2429 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2430 * destination is specified.
2431 * @param node [i] The DIV tag node is specified.
2432 * @return The conversion result is returned.
2435 s_chtml20_end_div_tag(void *pdoc, Node *UNUSED(child))
2437 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2438 Doc *doc = chtml20->doc;
2441 return chtml20->out;
2446 * It is a handler who processes the H1 tag.
2448 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2449 * destination is specified.
2450 * @param node [i] The H1 tag node is specified.
2451 * @return The conversion result is returned.
2454 s_chtml20_start_h1_tag(void *pdoc, Node *node)
2461 chtml20 = GET_CHTML20(pdoc);
2466 for (attr = qs_get_attr(doc,node);
2468 attr = qs_get_next_attr(doc,attr)) {
2469 char *name = qs_get_attr_name(doc,attr);
2470 char *value = qs_get_attr_value(doc,attr);
2471 if (STRCASEEQ('a','A',"align", name)) {
2472 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2481 return chtml20->out;
2486 * It is a handler who processes the H1 tag.
2488 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2489 * destination is specified.
2490 * @param node [i] The H1 tag node is specified.
2491 * @return The conversion result is returned.
2494 s_chtml20_end_h1_tag(void *pdoc, Node *UNUSED(child))
2499 chtml20 = GET_CHTML20(pdoc);
2503 return chtml20->out;
2508 * It is a handler who processes the H2 tag.
2510 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2511 * destination is specified.
2512 * @param node [i] The H2 tag node is specified.
2513 * @return The conversion result is returned.
2516 s_chtml20_start_h2_tag(void *pdoc, Node *node)
2523 chtml20 = GET_CHTML20(pdoc);
2528 for (attr = qs_get_attr(doc,node);
2530 attr = qs_get_next_attr(doc,attr)) {
2531 char *name = qs_get_attr_name(doc,attr);
2532 char *value = qs_get_attr_value(doc,attr);
2533 if (STRCASEEQ('a','A',"align", name)) {
2534 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2543 return chtml20->out;
2548 * It is a handler who processes the H2 tag.
2550 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2551 * destination is specified.
2552 * @param node [i] The H2 tag node is specified.
2553 * @return The conversion result is returned.
2556 s_chtml20_end_h2_tag(void *pdoc, Node *UNUSED(child))
2558 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2559 Doc *doc = chtml20->doc;
2563 return chtml20->out;
2568 * It is a handler who processes the H3 tag.
2570 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2571 * destination is specified.
2572 * @param node [i] The H3 tag node is specified.
2573 * @return The conversion result is returned.
2576 s_chtml20_start_h3_tag(void *pdoc, Node *node)
2583 chtml20 = GET_CHTML20(pdoc);
2588 for (attr = qs_get_attr(doc,node);
2590 attr = qs_get_next_attr(doc,attr)) {
2591 char *name = qs_get_attr_name(doc,attr);
2592 char *value = qs_get_attr_value(doc,attr);
2593 if (STRCASEEQ('a','A',"align", name)) {
2594 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2603 return chtml20->out;
2608 * It is a handler who processes the H3 tag.
2610 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2611 * destination is specified.
2612 * @param node [i] The H3 tag node is specified.
2613 * @return The conversion result is returned.
2616 s_chtml20_end_h3_tag(void *pdoc, Node *UNUSED(child))
2618 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2619 Doc *doc = chtml20->doc;
2622 return chtml20->out;
2627 * It is a handler who processes the H4 tag.
2629 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2630 * destination is specified.
2631 * @param node [i] The H4 tag node is specified.
2632 * @return The conversion result is returned.
2635 s_chtml20_start_h4_tag(void *pdoc, Node *node)
2642 chtml20 = GET_CHTML20(pdoc);
2647 for (attr = qs_get_attr(doc,node);
2649 attr = qs_get_next_attr(doc,attr)) {
2650 char *name = qs_get_attr_name(doc,attr);
2651 char *value = qs_get_attr_value(doc,attr);
2652 if (STRCASEEQ('a','A',"align", name)) {
2653 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2662 return chtml20->out;
2667 * It is a handler who processes the H4 tag.
2669 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2670 * destination is specified.
2671 * @param node [i] The H4 tag node is specified.
2672 * @return The conversion result is returned.
2675 s_chtml20_end_h4_tag(void *pdoc, Node *UNUSED(child))
2677 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2678 Doc *doc = chtml20->doc;
2681 return chtml20->out;
2686 * It is a handler who processes the H5 tag.
2688 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2689 * destination is specified.
2690 * @param node [i] The H5 tag node is specified.
2691 * @return The conversion result is returned.
2694 s_chtml20_start_h5_tag(void *pdoc, Node *node)
2701 chtml20 = GET_CHTML20(pdoc);
2706 for (attr = qs_get_attr(doc,node);
2708 attr = qs_get_next_attr(doc,attr)) {
2709 char *name = qs_get_attr_name(doc,attr);
2710 char *value = qs_get_attr_value(doc,attr);
2711 if (STRCASEEQ('a','A',"align", name)) {
2712 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2721 return chtml20->out;
2726 * It is a handler who processes the H5 tag.
2728 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2729 * destination is specified.
2730 * @param node [i] The H5 tag node is specified.
2731 * @return The conversion result is returned.
2734 s_chtml20_end_h5_tag(void *pdoc, Node *UNUSED(child))
2736 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2737 Doc *doc = chtml20->doc;
2740 return chtml20->out;
2745 * It is a handler who processes the H6 tag.
2747 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2748 * destination is specified.
2749 * @param node [i] The H6 tag node is specified.
2750 * @return The conversion result is returned.
2753 s_chtml20_start_h6_tag(void *pdoc, Node *node)
2760 chtml20 = GET_CHTML20(pdoc);
2765 for (attr = qs_get_attr(doc,node);
2767 attr = qs_get_next_attr(doc,attr)) {
2768 char *name = qs_get_attr_name(doc,attr);
2769 char *value = qs_get_attr_value(doc,attr);
2770 if (STRCASEEQ('a','A',"align", name)) {
2771 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2780 return chtml20->out;
2785 * It is a handler who processes the H6 tag.
2787 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2788 * destination is specified.
2789 * @param node [i] The H6 tag node is specified.
2790 * @return The conversion result is returned.
2793 s_chtml20_end_h6_tag(void *pdoc, Node *UNUSED(child))
2795 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2796 Doc *doc = chtml20->doc;
2799 return chtml20->out;
2804 * It is a handler who processes the PRE tag.
2806 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2807 * destination is specified.
2808 * @param node [i] The PRE tag node is specified.
2809 * @return The conversion result is returned.
2812 s_chtml20_start_pre_tag(void *pdoc, Node *UNUSED(node))
2814 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2815 Doc *doc = chtml20->doc;
2817 chtml20->pre_flag++;
2819 return chtml20->out;
2824 * It is a handler who processes the PRE tag.
2826 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2827 * destination is specified.
2828 * @param node [i] The PRE tag node is specified.
2829 * @return The conversion result is returned.
2832 s_chtml20_end_pre_tag(void *pdoc, Node *UNUSED(child))
2834 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2835 Doc *doc = chtml20->doc;
2838 chtml20->pre_flag--;
2840 return chtml20->out;
2845 * It is a handler who processes the P tag.
2847 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2848 * destination is specified.
2849 * @param node [i] The P tag node is specified.
2850 * @return The conversion result is returned.
2853 s_chtml20_start_p_tag(void *pdoc, Node *node)
2861 chtml20 = GET_CHTML20(pdoc);
2866 for (attr = qs_get_attr(doc,node);
2868 attr = qs_get_next_attr(doc,attr)) {
2869 char *nm = qs_get_attr_name(doc,attr);
2870 char *val = qs_get_attr_value(doc,attr);
2871 if (STRCASEEQ('a','A',"align", nm)) {
2872 /*----------------------------------------------------------------------*/
2873 /* CHTML 1.0 (W3C version 3.2) */
2874 /*----------------------------------------------------------------------*/
2875 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2876 align = apr_pstrdup(doc->buf.pool, val);
2887 return chtml20->out;
2892 * It is a handler who processes the P tag.
2894 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2895 * destination is specified.
2896 * @param node [i] The P tag node is specified.
2897 * @return The conversion result is returned.
2900 s_chtml20_end_p_tag(void *pdoc, Node *UNUSED(child))
2906 chtml20 = GET_CHTML20(pdoc);
2911 return chtml20->out;
2916 s_chtml20_chxjif_tag(void *pdoc, Node *node)
2923 chtml20 = GET_CHTML20(pdoc);
2927 for (child = qs_get_child_node(doc, node);
2929 child = qs_get_next_node(doc, child)) {
2932 s_chtml20_chxjif_tag(pdoc, child);
2940 * It is a handler who processes the TEXTARE tag.
2942 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2943 * destination is specified.
2944 * @param node [i] The TEXTAREA tag node is specified.
2945 * @return The conversion result is returned.
2948 s_chtml20_start_textarea_tag(void *pdoc, Node *node)
2955 chtml20 = GET_CHTML20(pdoc);
2959 chtml20->textarea_flag++;
2961 for (attr = qs_get_attr(doc,node);
2963 attr = qs_get_next_attr(doc,attr)) {
2964 char *name = qs_get_attr_name(doc,attr);
2965 char *value = qs_get_attr_value(doc,attr);
2969 if (strcasecmp(name, "accesskey") == 0 && value && *value != 0) {
2970 W_L(" accesskey=\"");
2978 if (strcasecmp(name, "name") == 0 && value && *value != 0) {
2987 if (strcasecmp(name, "rows") == 0 && value && *value != 0) {
2996 if (strcasecmp(name, "cols") == 0 && value && *value != 0) {
3005 if (strcasecmp(name, "istyle") == 0 && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
3017 return chtml20->out;
3022 * It is a handler who processes the TEXTAREA tag.
3024 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3025 * destination is specified.
3026 * @param node [i] The TEXTAREA tag node is specified.
3027 * @return The conversion result is returned.
3030 s_chtml20_end_textarea_tag(void *pdoc, Node *UNUSED(child))
3032 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3033 Doc *doc = chtml20->doc;
3036 chtml20->textarea_flag--;
3038 return chtml20->out;
3043 s_chtml20_text_tag(void *pdoc, Node *child)
3055 chtml20 = GET_CHTML20(pdoc);
3059 textval = qs_get_node_value(doc,child);
3060 if (strlen(textval) == 0) {
3061 return chtml20->out;
3064 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
3065 memset(tmp, 0, qs_get_node_size(doc,child)+1);
3067 tdst = qs_alloc_zero_byte_string(doc->buf.pool);
3068 memset(one_byte, 0, sizeof(one_byte));
3071 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
3073 int rtn = s_chtml20_search_emoji(chtml20, &textval[ii], &out);
3075 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
3079 if (is_sjis_kanji(textval[ii])) {
3080 one_byte[0] = textval[ii+0];
3081 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3082 one_byte[0] = textval[ii+1];
3083 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3087 if (chtml20->pre_flag) {
3088 one_byte[0] = textval[ii+0];
3089 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3092 if (chtml20->textarea_flag) {
3093 one_byte[0] = textval[ii+0];
3094 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3097 if (textval[ii] != '\r' && textval[ii] != '\n') {
3098 one_byte[0] = textval[ii+0];
3099 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3103 return chtml20->out;
3108 * It is a handler who processes the BLOCKQUOTE tag.
3110 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3111 * destination is specified.
3112 * @param node [i] The BLOCKQUOTE tag node is specified.
3113 * @return The conversion result is returned.
3116 s_chtml20_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
3118 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3119 Doc *doc = chtml20->doc;
3120 W_L("<blockquote>");
3121 return chtml20->out;
3126 * It is a handler who processes the BLOCKQUOTE tag.
3128 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3129 * destination is specified.
3130 * @param node [i] The BLOCKQUOTE tag node is specified.
3131 * @return The conversion result is returned.
3134 s_chtml20_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
3136 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3137 Doc *doc = chtml20->doc;
3138 W_L("</blockquote>");
3139 return chtml20->out;
3144 * It is a handler who processes the DIR tag.
3146 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3147 * destination is specified.
3148 * @param node [i] The DIR tag node is specified.
3149 * @return The conversion result is returned.
3152 s_chtml20_start_dir_tag(void *pdoc, Node *UNUSED(child))
3154 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3155 Doc *doc = chtml20->doc;
3157 return chtml20->out;
3162 * It is a handler who processes the DIR tag.
3164 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3165 * destination is specified.
3166 * @param node [i] The DIR tag node is specified.
3167 * @return The conversion result is returned.
3170 s_chtml20_end_dir_tag(void *pdoc, Node *UNUSED(child))
3172 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3173 Doc *doc = chtml20->doc;
3176 return chtml20->out;
3181 * It is a handler who processes the DL tag.
3183 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3184 * destination is specified.
3185 * @param node [i] The DL tag node is specified.
3186 * @return The conversion result is returned.
3189 s_chtml20_start_dl_tag(void *pdoc, Node *UNUSED(child))
3191 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3192 Doc *doc = chtml20->doc;
3194 return chtml20->out;
3199 * It is a handler who processes the DL tag.
3201 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3202 * destination is specified.
3203 * @param node [i] The DL tag node is specified.
3204 * @return The conversion result is returned.
3207 s_chtml20_end_dl_tag(void *pdoc, Node *UNUSED(child))
3209 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3210 Doc *doc = chtml20->doc;
3212 return chtml20->out;
3217 * It is a handter who processes the DT tag.
3219 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3220 * destination is specified.
3221 * @param node [i] The DT tag node is specified.
3222 * @return The conversion result is returned.
3225 s_chtml20_start_dt_tag(void *pdoc, Node *UNUSED(child))
3227 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3228 Doc *doc = chtml20->doc;
3230 return chtml20->out;
3235 * It is a handter who processes the DT tag.
3237 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3238 * destination is specified.
3239 * @param node [i] The DT tag node is specified.
3240 * @return The conversion result is returned.
3243 s_chtml20_end_dt_tag(void *pdoc, Node *UNUSED(child))
3245 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3247 return chtml20->out;
3252 * It is a handder who processes the DD tag.
3254 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3255 * destination is specified.
3256 * @param node [i] The DD tag node is specified.
3257 * @return The conversion result is returned.
3260 s_chtml20_start_dd_tag(void *pdoc, Node *UNUSED(child))
3262 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3263 Doc *doc = chtml20->doc;
3265 return chtml20->out;
3270 * It is a handder who processes the DD tag.
3272 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3273 * destination is specified.
3274 * @param node [i] The DD tag node is specified.
3275 * @return The conversion result is returned.
3278 s_chtml20_end_dd_tag(void *pdoc, Node *UNUSED(child))
3280 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3282 return chtml20->out;
3287 * It is a hanmenuer who processes the MENU tag.
3289 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3290 * destination is specified.
3291 * @param node [i] The MENU tag node is specified.
3292 * @return The conversion result is returned.
3295 s_chtml20_start_menu_tag(void *pdoc, Node *UNUSED(child))
3297 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3298 Doc *doc = chtml20->doc;
3301 return chtml20->out;
3306 * It is a hanmenuer who processes the MENU tag.
3308 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3309 * destination is specified.
3310 * @param node [i] The MENU tag node is specified.
3311 * @return The conversion result is returned.
3314 s_chtml20_end_menu_tag(void *pdoc, Node *UNUSED(child))
3316 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3317 Doc *doc = chtml20->doc;
3320 return chtml20->out;
3325 * It is a hanplaintexter who processes the PLAINTEXT tag.
3327 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3328 * destination is specified.
3329 * @param node [i] The PLAINTEXT tag node is specified.
3330 * @return The conversion result is returned.
3333 s_chtml20_start_plaintext_tag(void *pdoc, Node *node)
3335 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3336 Doc *doc = chtml20->doc;
3339 s_chtml20_start_plaintext_tag_inner(pdoc,node);
3340 return chtml20->out;
3344 s_chtml20_start_plaintext_tag_inner(void *pdoc, Node *node)
3346 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3347 Doc *doc = chtml20->doc;
3350 for (child = qs_get_child_node(doc, node);
3352 child = qs_get_next_node(doc, child)) {
3354 s_chtml20_start_plaintext_tag_inner(pdoc, child);
3356 return chtml20->out;
3361 * It is a hanplaintexter who processes the PLAINTEXT tag.
3363 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3364 * destination is specified.
3365 * @param node [i] The PLAINTEXT tag node is specified.
3366 * @return The conversion result is returned.
3369 s_chtml20_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3371 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3372 return chtml20->out;
3376 * It is a hanblinker who processes the BLINK tag.
3378 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3379 * destination is specified.
3380 * @param node [i] The BLINK tag node is specified.
3381 * @return The conversion result is returned.
3384 s_chtml20_start_blink_tag(void *pdoc, Node *UNUSED(child))
3386 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3387 Doc *doc = chtml20->doc;
3389 return chtml20->out;
3394 * It is a hanblinker who processes the BLINK tag.
3396 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3397 * destination is specified.
3398 * @param node [i] The BLINK tag node is specified.
3399 * @return The conversion result is returned.
3402 s_chtml20_end_blink_tag(void *pdoc, Node *UNUSED(child))
3404 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3405 Doc *doc = chtml20->doc;
3407 return chtml20->out;
3412 * It is a hanmarqueeer who processes the MARQUEE tag.
3414 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3415 * destination is specified.
3416 * @param node [i] The MARQUEE tag node is specified.
3417 * @return The conversion result is returned.
3420 s_chtml20_start_marquee_tag(void *pdoc, Node *node)
3422 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3423 Doc *doc = chtml20->doc;
3426 /*--------------------------------------------------------------------------*/
3427 /* Get Attributes */
3428 /*--------------------------------------------------------------------------*/
3429 for (attr = qs_get_attr(doc,node);
3431 attr = qs_get_next_attr(doc,attr)) {
3432 char *name = qs_get_attr_name(doc,attr);
3433 char *value = qs_get_attr_value(doc,attr);
3434 if (STRCASEEQ('d','D',"direction", name)) {
3435 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3436 W_L(" direction=\"");
3441 else if (STRCASEEQ('b','B',"behavior",name)) {
3442 if (value && (STRCASEEQ('s','S',"scroll",value) || STRCASEEQ('s','S',"slide",value) || STRCASEEQ('a','A',"alternate",value))) {
3443 W_L(" behavior=\"");
3448 else if (STRCASEEQ('l','L',"loop",name)) {
3449 if (value && *value) {
3457 return chtml20->out;
3462 * It is a hanmarqueeer who processes the MARQUEE tag.
3464 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3465 * destination is specified.
3466 * @param node [i] The MARQUEE tag node is specified.
3467 * @return The conversion result is returned.
3470 s_chtml20_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3472 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3473 Doc *doc = chtml20->doc;
3475 return chtml20->out;
3480 * * It is handler who processes the New Line Code.
3483 s_chtml20_newline_mark(void *pdoc, Node *UNUSED(node))
3485 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3486 Doc *doc = chtml20->doc;
3488 return chtml20->out;