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;
1434 char *attr_method = NULL;
1435 char *attr_action = NULL;
1437 chtml20 = GET_CHTML20(pdoc);
1441 /*--------------------------------------------------------------------------*/
1442 /* Get Attributes */
1443 /*--------------------------------------------------------------------------*/
1444 for (attr = qs_get_attr(doc,node);
1446 attr = qs_get_next_attr(doc,attr)) {
1449 name = qs_get_attr_name(doc,attr);
1450 value = qs_get_attr_value(doc,attr);
1455 if (strcasecmp(name, "action") == 0) {
1456 /*--------------------------------------------------------------------*/
1458 /*--------------------------------------------------------------------*/
1459 attr_action = chxj_encoding_parameter(r, value);
1460 attr_action= chxj_add_cookie_parameter(r, attr_action, chtml20->cookie);
1466 if (strcasecmp(name, "method") == 0) {
1467 /*--------------------------------------------------------------------*/
1469 /*--------------------------------------------------------------------*/
1470 attr_method = apr_pstrdup(doc->pool, value);
1476 if (strcasecmp(name, "utn") == 0) {
1477 /*--------------------------------------------------------------------*/
1479 /*--------------------------------------------------------------------*/
1489 int post_flag = (attr_method && strcasecmp(attr_method, "post") == 0) ? 1 : 0;
1494 q = strchr(attr_action, '?');
1496 new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 0, post_flag);
1497 if (new_hidden_tag) {
1511 if (new_hidden_tag) {
1512 W_V(new_hidden_tag);
1514 return chtml20->out;
1519 * It is a handler who processes the FORM tag.
1521 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1522 * destination is specified.
1523 * @param node [i] The FORM tag node is specified.
1524 * @return The conversion result is returned.
1527 s_chtml20_end_form_tag(void *pdoc, Node *UNUSED(child))
1533 chtml20 = GET_CHTML20(pdoc);
1539 return chtml20->out;
1544 * It is a handler who processes the INPUT tag.
1546 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1547 * destination is specified.
1548 * @param node [i] The INPUT tag node is specified.
1549 * @return The conversion result is returned.
1552 s_chtml20_start_input_tag(void *pdoc, Node *node)
1557 char *max_length = NULL;
1561 char *istyle = NULL;
1563 char *checked = NULL;
1564 char *accesskey = NULL;
1566 chtml20 = GET_CHTML20(pdoc);
1572 /*--------------------------------------------------------------------------*/
1573 /* Get Attributes */
1574 /*--------------------------------------------------------------------------*/
1575 type = qs_get_type_attr(doc, node, doc->buf.pool);
1576 name = qs_get_name_attr(doc, node, doc->buf.pool);
1577 value = qs_get_value_attr(doc,node,doc->buf.pool);
1578 istyle = qs_get_istyle_attr(doc,node,doc->buf.pool);
1579 max_length = qs_get_maxlength_attr(doc,node,doc->buf.pool);
1580 checked = qs_get_checked_attr(doc,node,doc->buf.pool);
1581 accesskey = qs_get_accesskey_attr(doc, node, doc->buf.pool);
1582 size = qs_get_size_attr(doc, node, doc->buf.pool);
1585 type = qs_trim_string(doc->buf.pool, type);
1586 if (type && (STRCASEEQ('t','T',"text", type) ||
1587 STRCASEEQ('p','P',"password",type) ||
1588 STRCASEEQ('c','C',"checkbox",type) ||
1589 STRCASEEQ('r','R',"radio", type) ||
1590 STRCASEEQ('h','H',"hidden", type) ||
1591 STRCASEEQ('s','S',"submit", type) ||
1592 STRCASEEQ('r','R',"reset", type))) {
1598 if (size && *size) {
1603 if (name && *name) {
1608 if (value && *value) {
1610 W_V(chxj_add_slash_to_doublequote(doc->pool, value));
1613 if (accesskey && *accesskey) {
1614 W_L(" accesskey=\"");
1619 /*------------------------------------------------------------------------*/
1621 /*------------------------------------------------------------------------*/
1622 if (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4') {
1628 /*--------------------------------------------------------------------------*/
1629 /* The figure is default for the password. */
1630 /*--------------------------------------------------------------------------*/
1631 if (max_length && *max_length) {
1632 if (chxj_chk_numeric(max_length) != 0) {
1633 max_length = apr_psprintf(doc->buf.pool, "0");
1635 if (istyle && *istyle == '1') {
1636 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length) * 2);
1640 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length));
1649 return chtml20->out;
1654 * It is a handler who processes the INPUT tag.
1656 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1657 * destination is specified.
1658 * @param node [i] The INPUT tag node is specified.
1659 * @return The conversion result is returned.
1662 s_chtml20_end_input_tag(void *pdoc, Node *UNUSED(child))
1668 chtml20 = GET_CHTML20(pdoc);
1672 return chtml20->out;
1677 * It is a handler who processes the CENTER tag.
1679 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1680 * destination is specified.
1681 * @param node [i] The CENTER tag node is specified.
1682 * @return The conversion result is returned.
1685 s_chtml20_start_center_tag(void *pdoc, Node *UNUSED(node))
1691 chtml20 = GET_CHTML20(pdoc);
1696 return chtml20->out;
1701 * It is a handler who processes the CENTER tag.
1703 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1704 * destination is specified.
1705 * @param node [i] The CENTER tag node is specified.
1706 * @return The conversion result is returned.
1709 s_chtml20_end_center_tag(void *pdoc, Node *UNUSED(child))
1715 chtml20 = GET_CHTML20(pdoc);
1721 return chtml20->out;
1726 * It is a handler who processes the UL tag.
1728 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1729 * destination is specified.
1730 * @param node [i] The UL tag node is specified.
1731 * @return The conversion result is returned.
1734 s_chtml20_start_ul_tag(void *pdoc, Node *UNUSED(node))
1740 chtml20 = GET_CHTML20(pdoc);
1746 return chtml20->out;
1751 * It is a handler who processes the UL tag.
1753 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1754 * destination is specified.
1755 * @param node [i] The UL tag node is specified.
1756 * @return The conversion result is returned.
1759 s_chtml20_end_ul_tag(void *pdoc, Node *UNUSED(child))
1765 chtml20 = GET_CHTML20(pdoc);
1771 return chtml20->out;
1776 * It is a handler who processes the OL tag.
1778 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1779 * destination is specified.
1780 * @param node [i] The OL tag node is specified.
1781 * @return The conversion result is returned.
1784 s_chtml20_start_ol_tag(void *pdoc, Node *node)
1791 chtml20 = GET_CHTML20(pdoc);
1796 /*--------------------------------------------------------------------------*/
1797 /* Get Attributes */
1798 /*--------------------------------------------------------------------------*/
1799 for (attr = qs_get_attr(doc,node);
1801 attr = qs_get_next_attr(doc,attr)) {
1802 char *name = qs_get_attr_name(doc,attr);
1803 char *value = qs_get_attr_value(doc,attr);
1804 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
1809 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
1817 return chtml20->out;
1822 * It is a handler who processes the OL tag.
1824 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1825 * destination is specified.
1826 * @param node [i] The OL tag node is specified.
1827 * @return The conversion result is returned.
1830 s_chtml20_end_ol_tag(void *pdoc, Node *UNUSED(child))
1836 chtml20 = GET_CHTML20(pdoc);
1842 return chtml20->out;
1847 * It is a handler who processes the LI tag.
1849 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1850 * destination is specified.
1851 * @param node [i] The LI tag node is specified.
1852 * @return The conversion result is returned.
1855 s_chtml20_start_li_tag(void *pdoc, Node *node)
1862 chtml20 = GET_CHTML20(pdoc);
1867 /*--------------------------------------------------------------------------*/
1868 /* Get Attributes */
1869 /*--------------------------------------------------------------------------*/
1870 for (attr = qs_get_attr(doc,node);
1872 attr = qs_get_next_attr(doc,attr)) {
1873 char *name = qs_get_attr_name(doc,attr);
1874 char *value = qs_get_attr_value(doc,attr);
1875 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
1880 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
1887 return chtml20->out;
1892 * It is a handler who processes the LI tag.
1894 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1895 * destination is specified.
1896 * @param node [i] The LI tag node is specified.
1897 * @return The conversion result is returned.
1900 s_chtml20_end_li_tag(void *pdoc, Node *UNUSED(child))
1902 chtml20_t *chtml20 = GET_CHTML20(pdoc);
1903 return chtml20->out;
1908 * It is a handler who processes the HR tag.
1910 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1911 * destination is specified.
1912 * @param node [i] The HR tag node is specified.
1913 * @return The conversion result is returned.
1916 s_chtml20_start_hr_tag(void *pdoc, Node *node)
1923 chtml20 = GET_CHTML20(pdoc);
1929 for (attr = qs_get_attr(doc,node);
1931 attr = qs_get_next_attr(doc,attr)) {
1932 char *name = qs_get_attr_name(doc,attr);
1933 char *value = qs_get_attr_value(doc,attr);
1937 if (strcasecmp(name, "align") == 0) {
1938 /*--------------------------------------------------------------------*/
1940 /*--------------------------------------------------------------------*/
1941 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1951 if (strcasecmp(name, "size") == 0) {
1952 /*--------------------------------------------------------------------*/
1954 /*--------------------------------------------------------------------*/
1955 if (value && value[0] != '\0') {
1965 if (strcasecmp(name, "width") == 0) {
1966 /*--------------------------------------------------------------------*/
1968 /*--------------------------------------------------------------------*/
1969 if (value && value[0] != '\0') {
1979 if (strcasecmp(name, "noshade") == 0) {
1980 /*--------------------------------------------------------------------*/
1982 /*--------------------------------------------------------------------*/
1989 if (strcasecmp(name, "color") == 0) {
1990 /*--------------------------------------------------------------------*/
1992 /*--------------------------------------------------------------------*/
2002 return chtml20->out;
2007 * It is a handler who processes the HR tag.
2009 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2010 * destination is specified.
2011 * @param node [i] The HR tag node is specified.
2012 * @return The conversion result is returned.
2015 s_chtml20_end_hr_tag(void *pdoc, Node *UNUSED(child))
2017 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2018 return chtml20->out;
2023 * It is a handler who processes the IMG tag.
2025 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2026 * destination is specified.
2027 * @param node [i] The IMG tag node is specified.
2028 * @return The conversion result is returned.
2031 s_chtml20_start_img_tag(void *pdoc, Node *node)
2037 #ifndef IMG_NOT_CONVERT_FILENAME
2041 chtml20 = GET_CHTML20(pdoc);
2045 #ifndef IMG_NOT_CONVERT_FILENAME
2046 spec = chtml20->spec;
2050 /*-------------------------------------------------------------------------*/
2051 /* Get Attributes */
2052 /*-------------------------------------------------------------------------*/
2053 for (attr = qs_get_attr(doc,node);
2055 attr = qs_get_next_attr(doc,attr)) {
2056 char *name = qs_get_attr_name(doc,attr);
2057 char *value = qs_get_attr_value(doc,attr);
2061 if (strcasecmp(name, "src") == 0) {
2062 /*-------------------------------------------------------------------*/
2064 /*-------------------------------------------------------------------*/
2065 #ifdef IMG_NOT_CONVERT_FILENAME
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);
2079 value = chxj_img_conv(r, spec, value);
2080 value = chxj_encoding_parameter(r, value);
2081 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
2083 value = apr_psprintf(doc->buf.pool,
2086 (strchr(value, '?')) ? '&' : '?',
2087 CHXJ_COOKIE_NOUPDATE_PARAM);
2098 if (strcasecmp(name, "align" ) == 0) {
2099 /*--------------------------------------------------------------------*/
2101 /*--------------------------------------------------------------------*/
2103 if (STRCASEEQ('t','T',"top", value) ||
2104 STRCASEEQ('m','M',"middle",value) ||
2105 STRCASEEQ('b','B',"bottom",value) ||
2106 STRCASEEQ('l','L',"left", value) ||
2107 STRCASEEQ('r','R',"right", value)) {
2112 else if (STRCASEEQ('c','C',"center", value)) {
2119 else if (strcasecmp(name, "alt" ) == 0 && value && *value) {
2120 /*--------------------------------------------------------------------*/
2122 /*--------------------------------------------------------------------*/
2131 if (strcasecmp(name, "width" ) == 0 && value && *value) {
2132 /*--------------------------------------------------------------------*/
2134 /*--------------------------------------------------------------------*/
2143 if (strcasecmp(name, "height") == 0 && value && *value) {
2144 /*--------------------------------------------------------------------*/
2146 /*--------------------------------------------------------------------*/
2151 else if (strcasecmp(name, "hspace") == 0 && value && *value) {
2152 /*--------------------------------------------------------------------*/
2154 /*--------------------------------------------------------------------*/
2163 if (strcasecmp(name, "vspace") == 0 && value && *value) {
2164 /*--------------------------------------------------------------------*/
2166 /*--------------------------------------------------------------------*/
2178 return chtml20->out;
2183 * It is a handler who processes the IMG tag.
2185 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2186 * destination is specified.
2187 * @param node [i] The IMG tag node is specified.
2188 * @return The conversion result is returned.
2191 s_chtml20_end_img_tag(void *pdoc, Node *UNUSED(child))
2193 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2195 return chtml20->out;
2200 * It is a handler who processes the SELECT tag.
2202 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2203 * destination is specified.
2204 * @param node [i] The SELECT tag node is specified.
2205 * @return The conversion result is returned.
2208 s_chtml20_start_select_tag(void *pdoc, Node *child)
2215 chtml20 = GET_CHTML20(pdoc);
2221 char *multiple = NULL;
2224 for (attr = qs_get_attr(doc,child);
2226 attr = qs_get_next_attr(doc,attr)) {
2227 char *nm = qs_get_attr_name(doc,attr);
2228 char *val = qs_get_attr_value(doc,attr);
2232 if (strcasecmp(nm, "size") == 0) {
2233 /*--------------------------------------------------------------------*/
2234 /* CHTML 1.0 version 2.0 */
2235 /*--------------------------------------------------------------------*/
2236 size = apr_pstrdup(doc->buf.pool, val);
2242 if (strcasecmp(nm, "name") == 0) {
2243 /*--------------------------------------------------------------------*/
2244 /* CHTML 1.0 version 2.0 */
2245 /*--------------------------------------------------------------------*/
2246 name = apr_pstrdup(doc->buf.pool, val);
2252 if (strcasecmp(nm, "multiple") == 0) {
2253 /*--------------------------------------------------------------------*/
2254 /* CHTML 1.0 version 2.0 */
2255 /*--------------------------------------------------------------------*/
2256 multiple = apr_pstrdup(doc->buf.pool, val);
2264 if (size && *size) {
2269 if (name && *name) {
2278 return chtml20->out;
2283 * It is a handler who processes the SELECT tag.
2285 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2286 * destination is specified.
2287 * @param node [i] The SELECT tag node is specified.
2288 * @return The conversion result is returned.
2291 s_chtml20_end_select_tag(void *pdoc, Node *UNUSED(child))
2296 chtml20 = GET_CHTML20(pdoc);
2300 return chtml20->out;
2305 * It is a handler who processes the OPTION tag.
2307 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2308 * destination is specified.
2309 * @param node [i] The OPTION tag node is specified.
2310 * @return The conversion result is returned.
2313 s_chtml20_start_option_tag(void *pdoc, Node *child)
2320 chtml20 = GET_CHTML20(pdoc);
2324 char *selected = NULL;
2328 for (attr = qs_get_attr(doc,child);
2330 attr = qs_get_next_attr(doc,attr)) {
2331 char *nm = qs_get_attr_name(doc,attr);
2332 char *val = qs_get_attr_value(doc,attr);
2336 if (strcasecmp(nm, "selected") == 0) {
2337 /*--------------------------------------------------------------------*/
2338 /* CHTML 1.0 version 2.0 */
2339 /*--------------------------------------------------------------------*/
2340 selected = apr_pstrdup(doc->buf.pool, val);
2346 if (strcasecmp(nm, "value") == 0) {
2347 /*--------------------------------------------------------------------*/
2348 /* CHTML 1.0 version 2.0 */
2349 /*--------------------------------------------------------------------*/
2350 value = apr_pstrdup(doc->buf.pool, val);
2359 if (value && *value) {
2369 return chtml20->out;
2374 * It is a handler who processes the OPTION tag.
2376 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2377 * destination is specified.
2378 * @param node [i] The OPTION tag node is specified.
2379 * @return The conversion result is returned.
2382 s_chtml20_end_option_tag(void *pdoc, Node *UNUSED(child))
2384 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2388 return chtml20->out;
2393 * It is a handler who processes the DIV tag.
2395 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2396 * destination is specified.
2397 * @param node [i] The DIV tag node is specified.
2398 * @return The conversion result is returned.
2401 s_chtml20_start_div_tag(void *pdoc, Node *child)
2408 chtml20 = GET_CHTML20(pdoc);
2416 for (attr = qs_get_attr(doc,child);
2418 attr = qs_get_next_attr(doc,attr)) {
2419 char *nm = qs_get_attr_name(doc,attr);
2420 char *val = qs_get_attr_value(doc,attr);
2421 if (STRCASEEQ('a','A', "align", nm)) {
2422 /*----------------------------------------------------------------------*/
2423 /* CHTML 1.0 (W3C version 3.2) */
2424 /*----------------------------------------------------------------------*/
2425 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2426 align = apr_pstrdup(doc->buf.pool, val);
2436 return chtml20->out;
2441 * It is a handler who processes the DIV tag.
2443 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2444 * destination is specified.
2445 * @param node [i] The DIV tag node is specified.
2446 * @return The conversion result is returned.
2449 s_chtml20_end_div_tag(void *pdoc, Node *UNUSED(child))
2451 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2452 Doc *doc = chtml20->doc;
2455 return chtml20->out;
2460 * It is a handler who processes the H1 tag.
2462 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2463 * destination is specified.
2464 * @param node [i] The H1 tag node is specified.
2465 * @return The conversion result is returned.
2468 s_chtml20_start_h1_tag(void *pdoc, Node *node)
2475 chtml20 = GET_CHTML20(pdoc);
2480 for (attr = qs_get_attr(doc,node);
2482 attr = qs_get_next_attr(doc,attr)) {
2483 char *name = qs_get_attr_name(doc,attr);
2484 char *value = qs_get_attr_value(doc,attr);
2485 if (STRCASEEQ('a','A',"align", name)) {
2486 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2495 return chtml20->out;
2500 * It is a handler who processes the H1 tag.
2502 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2503 * destination is specified.
2504 * @param node [i] The H1 tag node is specified.
2505 * @return The conversion result is returned.
2508 s_chtml20_end_h1_tag(void *pdoc, Node *UNUSED(child))
2513 chtml20 = GET_CHTML20(pdoc);
2517 return chtml20->out;
2522 * It is a handler who processes the H2 tag.
2524 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2525 * destination is specified.
2526 * @param node [i] The H2 tag node is specified.
2527 * @return The conversion result is returned.
2530 s_chtml20_start_h2_tag(void *pdoc, Node *node)
2537 chtml20 = GET_CHTML20(pdoc);
2542 for (attr = qs_get_attr(doc,node);
2544 attr = qs_get_next_attr(doc,attr)) {
2545 char *name = qs_get_attr_name(doc,attr);
2546 char *value = qs_get_attr_value(doc,attr);
2547 if (STRCASEEQ('a','A',"align", name)) {
2548 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2557 return chtml20->out;
2562 * It is a handler who processes the H2 tag.
2564 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2565 * destination is specified.
2566 * @param node [i] The H2 tag node is specified.
2567 * @return The conversion result is returned.
2570 s_chtml20_end_h2_tag(void *pdoc, Node *UNUSED(child))
2572 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2573 Doc *doc = chtml20->doc;
2577 return chtml20->out;
2582 * It is a handler who processes the H3 tag.
2584 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2585 * destination is specified.
2586 * @param node [i] The H3 tag node is specified.
2587 * @return The conversion result is returned.
2590 s_chtml20_start_h3_tag(void *pdoc, Node *node)
2597 chtml20 = GET_CHTML20(pdoc);
2602 for (attr = qs_get_attr(doc,node);
2604 attr = qs_get_next_attr(doc,attr)) {
2605 char *name = qs_get_attr_name(doc,attr);
2606 char *value = qs_get_attr_value(doc,attr);
2607 if (STRCASEEQ('a','A',"align", name)) {
2608 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2617 return chtml20->out;
2622 * It is a handler who processes the H3 tag.
2624 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2625 * destination is specified.
2626 * @param node [i] The H3 tag node is specified.
2627 * @return The conversion result is returned.
2630 s_chtml20_end_h3_tag(void *pdoc, Node *UNUSED(child))
2632 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2633 Doc *doc = chtml20->doc;
2636 return chtml20->out;
2641 * It is a handler who processes the H4 tag.
2643 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2644 * destination is specified.
2645 * @param node [i] The H4 tag node is specified.
2646 * @return The conversion result is returned.
2649 s_chtml20_start_h4_tag(void *pdoc, Node *node)
2656 chtml20 = GET_CHTML20(pdoc);
2661 for (attr = qs_get_attr(doc,node);
2663 attr = qs_get_next_attr(doc,attr)) {
2664 char *name = qs_get_attr_name(doc,attr);
2665 char *value = qs_get_attr_value(doc,attr);
2666 if (STRCASEEQ('a','A',"align", name)) {
2667 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2676 return chtml20->out;
2681 * It is a handler who processes the H4 tag.
2683 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2684 * destination is specified.
2685 * @param node [i] The H4 tag node is specified.
2686 * @return The conversion result is returned.
2689 s_chtml20_end_h4_tag(void *pdoc, Node *UNUSED(child))
2691 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2692 Doc *doc = chtml20->doc;
2695 return chtml20->out;
2700 * It is a handler who processes the H5 tag.
2702 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2703 * destination is specified.
2704 * @param node [i] The H5 tag node is specified.
2705 * @return The conversion result is returned.
2708 s_chtml20_start_h5_tag(void *pdoc, Node *node)
2715 chtml20 = GET_CHTML20(pdoc);
2720 for (attr = qs_get_attr(doc,node);
2722 attr = qs_get_next_attr(doc,attr)) {
2723 char *name = qs_get_attr_name(doc,attr);
2724 char *value = qs_get_attr_value(doc,attr);
2725 if (STRCASEEQ('a','A',"align", name)) {
2726 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2735 return chtml20->out;
2740 * It is a handler who processes the H5 tag.
2742 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2743 * destination is specified.
2744 * @param node [i] The H5 tag node is specified.
2745 * @return The conversion result is returned.
2748 s_chtml20_end_h5_tag(void *pdoc, Node *UNUSED(child))
2750 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2751 Doc *doc = chtml20->doc;
2754 return chtml20->out;
2759 * It is a handler who processes the H6 tag.
2761 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2762 * destination is specified.
2763 * @param node [i] The H6 tag node is specified.
2764 * @return The conversion result is returned.
2767 s_chtml20_start_h6_tag(void *pdoc, Node *node)
2774 chtml20 = GET_CHTML20(pdoc);
2779 for (attr = qs_get_attr(doc,node);
2781 attr = qs_get_next_attr(doc,attr)) {
2782 char *name = qs_get_attr_name(doc,attr);
2783 char *value = qs_get_attr_value(doc,attr);
2784 if (STRCASEEQ('a','A',"align", name)) {
2785 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2794 return chtml20->out;
2799 * It is a handler who processes the H6 tag.
2801 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2802 * destination is specified.
2803 * @param node [i] The H6 tag node is specified.
2804 * @return The conversion result is returned.
2807 s_chtml20_end_h6_tag(void *pdoc, Node *UNUSED(child))
2809 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2810 Doc *doc = chtml20->doc;
2813 return chtml20->out;
2818 * It is a handler who processes the PRE tag.
2820 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2821 * destination is specified.
2822 * @param node [i] The PRE tag node is specified.
2823 * @return The conversion result is returned.
2826 s_chtml20_start_pre_tag(void *pdoc, Node *UNUSED(node))
2828 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2829 Doc *doc = chtml20->doc;
2831 chtml20->pre_flag++;
2833 return chtml20->out;
2838 * It is a handler who processes the PRE tag.
2840 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2841 * destination is specified.
2842 * @param node [i] The PRE tag node is specified.
2843 * @return The conversion result is returned.
2846 s_chtml20_end_pre_tag(void *pdoc, Node *UNUSED(child))
2848 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2849 Doc *doc = chtml20->doc;
2852 chtml20->pre_flag--;
2854 return chtml20->out;
2859 * It is a handler who processes the P tag.
2861 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2862 * destination is specified.
2863 * @param node [i] The P tag node is specified.
2864 * @return The conversion result is returned.
2867 s_chtml20_start_p_tag(void *pdoc, Node *node)
2875 chtml20 = GET_CHTML20(pdoc);
2880 for (attr = qs_get_attr(doc,node);
2882 attr = qs_get_next_attr(doc,attr)) {
2883 char *nm = qs_get_attr_name(doc,attr);
2884 char *val = qs_get_attr_value(doc,attr);
2885 if (STRCASEEQ('a','A',"align", nm)) {
2886 /*----------------------------------------------------------------------*/
2887 /* CHTML 1.0 (W3C version 3.2) */
2888 /*----------------------------------------------------------------------*/
2889 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2890 align = apr_pstrdup(doc->buf.pool, val);
2901 return chtml20->out;
2906 * It is a handler who processes the P tag.
2908 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2909 * destination is specified.
2910 * @param node [i] The P tag node is specified.
2911 * @return The conversion result is returned.
2914 s_chtml20_end_p_tag(void *pdoc, Node *UNUSED(child))
2920 chtml20 = GET_CHTML20(pdoc);
2925 return chtml20->out;
2930 s_chtml20_chxjif_tag(void *pdoc, Node *node)
2937 chtml20 = GET_CHTML20(pdoc);
2941 for (child = qs_get_child_node(doc, node);
2943 child = qs_get_next_node(doc, child)) {
2946 s_chtml20_chxjif_tag(pdoc, child);
2954 * It is a handler who processes the TEXTARE tag.
2956 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2957 * destination is specified.
2958 * @param node [i] The TEXTAREA tag node is specified.
2959 * @return The conversion result is returned.
2962 s_chtml20_start_textarea_tag(void *pdoc, Node *node)
2969 chtml20 = GET_CHTML20(pdoc);
2973 chtml20->textarea_flag++;
2975 for (attr = qs_get_attr(doc,node);
2977 attr = qs_get_next_attr(doc,attr)) {
2978 char *name = qs_get_attr_name(doc,attr);
2979 char *value = qs_get_attr_value(doc,attr);
2983 if (strcasecmp(name, "accesskey") == 0 && value && *value != 0) {
2984 W_L(" accesskey=\"");
2992 if (strcasecmp(name, "name") == 0 && value && *value != 0) {
3001 if (strcasecmp(name, "rows") == 0 && value && *value != 0) {
3010 if (strcasecmp(name, "cols") == 0 && value && *value != 0) {
3019 if (strcasecmp(name, "istyle") == 0 && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
3031 return chtml20->out;
3036 * It is a handler who processes the TEXTAREA tag.
3038 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3039 * destination is specified.
3040 * @param node [i] The TEXTAREA tag node is specified.
3041 * @return The conversion result is returned.
3044 s_chtml20_end_textarea_tag(void *pdoc, Node *UNUSED(child))
3046 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3047 Doc *doc = chtml20->doc;
3050 chtml20->textarea_flag--;
3052 return chtml20->out;
3057 s_chtml20_text_tag(void *pdoc, Node *child)
3069 chtml20 = GET_CHTML20(pdoc);
3073 textval = qs_get_node_value(doc,child);
3074 if (strlen(textval) == 0) {
3075 return chtml20->out;
3078 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
3079 memset(tmp, 0, qs_get_node_size(doc,child)+1);
3081 tdst = qs_alloc_zero_byte_string(doc->buf.pool);
3082 memset(one_byte, 0, sizeof(one_byte));
3085 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
3087 int rtn = s_chtml20_search_emoji(chtml20, &textval[ii], &out);
3089 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
3093 if (is_sjis_kanji(textval[ii])) {
3094 one_byte[0] = textval[ii+0];
3095 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3096 one_byte[0] = textval[ii+1];
3097 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3101 if (chtml20->pre_flag) {
3102 one_byte[0] = textval[ii+0];
3103 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3106 if (chtml20->textarea_flag) {
3107 one_byte[0] = textval[ii+0];
3108 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3111 if (textval[ii] != '\r' && textval[ii] != '\n') {
3112 one_byte[0] = textval[ii+0];
3113 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3117 return chtml20->out;
3122 * It is a handler who processes the BLOCKQUOTE tag.
3124 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3125 * destination is specified.
3126 * @param node [i] The BLOCKQUOTE tag node is specified.
3127 * @return The conversion result is returned.
3130 s_chtml20_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
3132 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3133 Doc *doc = chtml20->doc;
3134 W_L("<blockquote>");
3135 return chtml20->out;
3140 * It is a handler who processes the BLOCKQUOTE tag.
3142 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3143 * destination is specified.
3144 * @param node [i] The BLOCKQUOTE tag node is specified.
3145 * @return The conversion result is returned.
3148 s_chtml20_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
3150 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3151 Doc *doc = chtml20->doc;
3152 W_L("</blockquote>");
3153 return chtml20->out;
3158 * It is a handler who processes the DIR tag.
3160 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3161 * destination is specified.
3162 * @param node [i] The DIR tag node is specified.
3163 * @return The conversion result is returned.
3166 s_chtml20_start_dir_tag(void *pdoc, Node *UNUSED(child))
3168 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3169 Doc *doc = chtml20->doc;
3171 return chtml20->out;
3176 * It is a handler who processes the DIR tag.
3178 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3179 * destination is specified.
3180 * @param node [i] The DIR tag node is specified.
3181 * @return The conversion result is returned.
3184 s_chtml20_end_dir_tag(void *pdoc, Node *UNUSED(child))
3186 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3187 Doc *doc = chtml20->doc;
3190 return chtml20->out;
3195 * It is a handler who processes the DL tag.
3197 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3198 * destination is specified.
3199 * @param node [i] The DL tag node is specified.
3200 * @return The conversion result is returned.
3203 s_chtml20_start_dl_tag(void *pdoc, Node *UNUSED(child))
3205 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3206 Doc *doc = chtml20->doc;
3208 return chtml20->out;
3213 * It is a handler who processes the DL tag.
3215 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3216 * destination is specified.
3217 * @param node [i] The DL tag node is specified.
3218 * @return The conversion result is returned.
3221 s_chtml20_end_dl_tag(void *pdoc, Node *UNUSED(child))
3223 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3224 Doc *doc = chtml20->doc;
3226 return chtml20->out;
3231 * It is a handter who processes the DT tag.
3233 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3234 * destination is specified.
3235 * @param node [i] The DT tag node is specified.
3236 * @return The conversion result is returned.
3239 s_chtml20_start_dt_tag(void *pdoc, Node *UNUSED(child))
3241 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3242 Doc *doc = chtml20->doc;
3244 return chtml20->out;
3249 * It is a handter who processes the DT tag.
3251 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3252 * destination is specified.
3253 * @param node [i] The DT tag node is specified.
3254 * @return The conversion result is returned.
3257 s_chtml20_end_dt_tag(void *pdoc, Node *UNUSED(child))
3259 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3261 return chtml20->out;
3266 * It is a handder who processes the DD tag.
3268 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3269 * destination is specified.
3270 * @param node [i] The DD tag node is specified.
3271 * @return The conversion result is returned.
3274 s_chtml20_start_dd_tag(void *pdoc, Node *UNUSED(child))
3276 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3277 Doc *doc = chtml20->doc;
3279 return chtml20->out;
3284 * It is a handder who processes the DD tag.
3286 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3287 * destination is specified.
3288 * @param node [i] The DD tag node is specified.
3289 * @return The conversion result is returned.
3292 s_chtml20_end_dd_tag(void *pdoc, Node *UNUSED(child))
3294 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3296 return chtml20->out;
3301 * It is a hanmenuer who processes the MENU tag.
3303 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3304 * destination is specified.
3305 * @param node [i] The MENU tag node is specified.
3306 * @return The conversion result is returned.
3309 s_chtml20_start_menu_tag(void *pdoc, Node *UNUSED(child))
3311 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3312 Doc *doc = chtml20->doc;
3315 return chtml20->out;
3320 * It is a hanmenuer who processes the MENU tag.
3322 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3323 * destination is specified.
3324 * @param node [i] The MENU tag node is specified.
3325 * @return The conversion result is returned.
3328 s_chtml20_end_menu_tag(void *pdoc, Node *UNUSED(child))
3330 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3331 Doc *doc = chtml20->doc;
3334 return chtml20->out;
3339 * It is a hanplaintexter who processes the PLAINTEXT tag.
3341 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3342 * destination is specified.
3343 * @param node [i] The PLAINTEXT tag node is specified.
3344 * @return The conversion result is returned.
3347 s_chtml20_start_plaintext_tag(void *pdoc, Node *node)
3349 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3350 Doc *doc = chtml20->doc;
3353 s_chtml20_start_plaintext_tag_inner(pdoc,node);
3354 return chtml20->out;
3358 s_chtml20_start_plaintext_tag_inner(void *pdoc, Node *node)
3360 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3361 Doc *doc = chtml20->doc;
3364 for (child = qs_get_child_node(doc, node);
3366 child = qs_get_next_node(doc, child)) {
3368 s_chtml20_start_plaintext_tag_inner(pdoc, child);
3370 return chtml20->out;
3375 * It is a hanplaintexter who processes the PLAINTEXT tag.
3377 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3378 * destination is specified.
3379 * @param node [i] The PLAINTEXT tag node is specified.
3380 * @return The conversion result is returned.
3383 s_chtml20_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3385 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3386 return chtml20->out;
3390 * It is a hanblinker who processes the BLINK tag.
3392 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3393 * destination is specified.
3394 * @param node [i] The BLINK tag node is specified.
3395 * @return The conversion result is returned.
3398 s_chtml20_start_blink_tag(void *pdoc, Node *UNUSED(child))
3400 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3401 Doc *doc = chtml20->doc;
3403 return chtml20->out;
3408 * It is a hanblinker who processes the BLINK tag.
3410 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3411 * destination is specified.
3412 * @param node [i] The BLINK tag node is specified.
3413 * @return The conversion result is returned.
3416 s_chtml20_end_blink_tag(void *pdoc, Node *UNUSED(child))
3418 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3419 Doc *doc = chtml20->doc;
3421 return chtml20->out;
3426 * It is a hanmarqueeer who processes the MARQUEE tag.
3428 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3429 * destination is specified.
3430 * @param node [i] The MARQUEE tag node is specified.
3431 * @return The conversion result is returned.
3434 s_chtml20_start_marquee_tag(void *pdoc, Node *node)
3436 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3437 Doc *doc = chtml20->doc;
3440 /*--------------------------------------------------------------------------*/
3441 /* Get Attributes */
3442 /*--------------------------------------------------------------------------*/
3443 for (attr = qs_get_attr(doc,node);
3445 attr = qs_get_next_attr(doc,attr)) {
3446 char *name = qs_get_attr_name(doc,attr);
3447 char *value = qs_get_attr_value(doc,attr);
3448 if (STRCASEEQ('d','D',"direction", name)) {
3449 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3450 W_L(" direction=\"");
3455 else if (STRCASEEQ('b','B',"behavior",name)) {
3456 if (value && (STRCASEEQ('s','S',"scroll",value) || STRCASEEQ('s','S',"slide",value) || STRCASEEQ('a','A',"alternate",value))) {
3457 W_L(" behavior=\"");
3462 else if (STRCASEEQ('l','L',"loop",name)) {
3463 if (value && *value) {
3471 return chtml20->out;
3476 * It is a hanmarqueeer who processes the MARQUEE tag.
3478 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3479 * destination is specified.
3480 * @param node [i] The MARQUEE tag node is specified.
3481 * @return The conversion result is returned.
3484 s_chtml20_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3486 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3487 Doc *doc = chtml20->doc;
3489 return chtml20->out;
3494 * * It is handler who processes the New Line Code.
3497 s_chtml20_newline_mark(void *pdoc, Node *UNUSED(node))
3499 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3500 Doc *doc = chtml20->doc;
3502 return chtml20->out;