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))
28 #define W20_L(X) do { chtml20->out = BUFFERED_WRITE_LITERAL(chtml20->out, &doc->buf, (X)); } while(0)
29 #define W20_V(X) do { chtml20->out = (X) ? BUFFERED_WRITE_VALUE(chtml20->out, &doc->buf, (X)) \
30 : BUFFERED_WRITE_LITERAL(chtml20->out, &doc->buf, ""); } while(0)
32 static char *s_chtml20_start_html_tag (void *pdoc, Node *node);
33 static char *s_chtml20_end_html_tag (void *pdoc, Node *node);
34 static char *s_chtml20_start_meta_tag (void *pdoc, Node *node);
35 static char *s_chtml20_end_meta_tag (void *pdoc, Node *node);
36 static char *s_chtml20_start_textarea_tag(void *pdoc, Node *node);
37 static char *s_chtml20_end_textarea_tag (void *pdoc, Node *node);
38 static char *s_chtml20_start_p_tag (void *pdoc, Node *node);
39 static char *s_chtml20_end_p_tag (void *pdoc, Node *node);
40 static char *s_chtml20_start_pre_tag (void *pdoc, Node *node);
41 static char *s_chtml20_end_pre_tag (void *pdoc, Node *node);
42 static char *s_chtml20_start_h1_tag (void *pdoc, Node *node);
43 static char *s_chtml20_end_h1_tag (void *pdoc, Node *node);
44 static char *s_chtml20_start_h2_tag (void *pdoc, Node *node);
45 static char *s_chtml20_end_h2_tag (void *pdoc, Node *node);
46 static char *s_chtml20_start_h3_tag (void *pdoc, Node *node);
47 static char *s_chtml20_end_h3_tag (void *pdoc, Node *node);
48 static char *s_chtml20_start_h4_tag (void *pdoc, Node *node);
49 static char *s_chtml20_end_h4_tag (void *pdoc, Node *node);
50 static char *s_chtml20_start_h5_tag (void *pdoc, Node *node);
51 static char *s_chtml20_end_h5_tag (void *pdoc, Node *node);
52 static char *s_chtml20_start_h6_tag (void *pdoc, Node *node);
53 static char *s_chtml20_end_h6_tag (void *pdoc, Node *node);
54 static char *s_chtml20_start_ul_tag (void *pdoc, Node *node);
55 static char *s_chtml20_end_ul_tag (void *pdoc, Node *node);
56 static char *s_chtml20_start_ol_tag (void *pdoc, Node *node);
57 static char *s_chtml20_end_ol_tag (void *pdoc, Node *node);
58 static char *s_chtml20_start_li_tag (void *pdoc, Node *node);
59 static char *s_chtml20_end_li_tag (void *pdoc, Node *node);
60 static char *s_chtml20_start_head_tag (void *pdoc, Node *node);
61 static char *s_chtml20_end_head_tag (void *pdoc, Node *node);
62 static char *s_chtml20_start_title_tag (void *pdoc, Node *node);
63 static char *s_chtml20_end_title_tag (void *pdoc, Node *node);
64 static char *s_chtml20_start_base_tag (void *pdoc, Node *node);
65 static char *s_chtml20_end_base_tag (void *pdoc, Node *node);
66 static char *s_chtml20_start_body_tag (void *pdoc, Node *node);
67 static char *s_chtml20_end_body_tag (void *pdoc, Node *node);
68 static char *s_chtml20_start_a_tag (void *pdoc, Node *node);
69 static char *s_chtml20_end_a_tag (void *pdoc, Node *node);
70 static char *s_chtml20_start_br_tag (void *pdoc, Node *node);
71 static char *s_chtml20_end_br_tag (void *pdoc, Node *node);
72 static char *s_chtml20_start_tr_tag (void *pdoc, Node *node);
73 static char *s_chtml20_end_tr_tag (void *pdoc, Node *node);
74 static char *s_chtml20_start_font_tag (void *pdoc, Node *node);
75 static char *s_chtml20_end_font_tag (void *pdoc, Node *node);
76 static char *s_chtml20_start_form_tag (void *pdoc, Node *node);
77 static char *s_chtml20_end_form_tag (void *pdoc, Node *node);
78 static char *s_chtml20_start_input_tag (void *pdoc, Node *node);
79 static char *s_chtml20_end_input_tag (void *pdoc, Node *node);
80 static char *s_chtml20_start_center_tag (void *pdoc, Node *node);
81 static char *s_chtml20_end_center_tag (void *pdoc, Node *node);
82 static char *s_chtml20_start_hr_tag (void *pdoc, Node *node);
83 static char *s_chtml20_end_hr_tag (void *pdoc, Node *node);
84 static char *s_chtml20_start_img_tag (void *pdoc, Node *node);
85 static char *s_chtml20_end_img_tag (void *pdoc, Node *node);
86 static char *s_chtml20_start_select_tag (void *pdoc, Node *node);
87 static char *s_chtml20_end_select_tag (void *pdoc, Node *node);
88 static char *s_chtml20_start_option_tag (void *pdoc, Node *node);
89 static char *s_chtml20_end_option_tag (void *pdoc, Node *node);
90 static char *s_chtml20_start_div_tag (void *pdoc, Node *node);
91 static char *s_chtml20_end_div_tag (void *pdoc, Node *node);
93 static void s_init_chtml20(chtml20_t *chtml, Doc *doc, request_rec *r, device_table *spec);
95 static int s_chtml20_search_emoji(chtml20_t *chtml, char *txt, char **rslt);
97 static char *s_chtml20_chxjif_tag(void *pdoc, Node *node);
98 static char *s_chtml20_text_tag(void *pdoc, Node *node);
101 tag_handler chtml20_handler[] = {
104 s_chtml20_start_html_tag,
105 s_chtml20_end_html_tag,
109 s_chtml20_start_meta_tag,
110 s_chtml20_end_meta_tag,
114 s_chtml20_start_textarea_tag,
115 s_chtml20_end_textarea_tag,
119 s_chtml20_start_p_tag,
124 s_chtml20_start_pre_tag,
125 s_chtml20_end_pre_tag,
129 s_chtml20_start_ul_tag,
130 s_chtml20_end_ul_tag,
134 s_chtml20_start_li_tag,
135 s_chtml20_end_li_tag,
139 s_chtml20_start_ol_tag,
140 s_chtml20_end_ol_tag,
144 s_chtml20_start_h1_tag,
145 s_chtml20_end_h1_tag,
149 s_chtml20_start_h2_tag,
150 s_chtml20_end_h2_tag,
154 s_chtml20_start_h3_tag,
155 s_chtml20_end_h3_tag,
159 s_chtml20_start_h4_tag,
160 s_chtml20_end_h4_tag,
164 s_chtml20_start_h5_tag,
165 s_chtml20_end_h5_tag,
169 s_chtml20_start_h6_tag,
170 s_chtml20_end_h6_tag,
174 s_chtml20_start_head_tag,
175 s_chtml20_end_head_tag,
179 s_chtml20_start_title_tag,
180 s_chtml20_end_title_tag,
184 s_chtml20_start_base_tag,
185 s_chtml20_end_base_tag,
189 s_chtml20_start_body_tag,
190 s_chtml20_end_body_tag,
194 s_chtml20_start_a_tag,
199 s_chtml20_start_br_tag,
200 s_chtml20_end_br_tag,
209 s_chtml20_start_tr_tag,
210 s_chtml20_end_tr_tag,
224 s_chtml20_start_font_tag,
225 s_chtml20_end_font_tag,
229 s_chtml20_start_form_tag,
230 s_chtml20_end_form_tag,
234 s_chtml20_start_input_tag,
235 s_chtml20_end_input_tag,
239 s_chtml20_start_center_tag,
240 s_chtml20_end_center_tag,
244 s_chtml20_start_hr_tag,
245 s_chtml20_end_hr_tag,
249 s_chtml20_start_img_tag,
250 s_chtml20_end_img_tag,
254 s_chtml20_start_select_tag,
255 s_chtml20_end_select_tag,
259 s_chtml20_start_option_tag,
260 s_chtml20_end_option_tag,
264 s_chtml20_start_div_tag,
265 s_chtml20_end_div_tag,
269 s_chtml20_chxjif_tag,
350 * converts from CHTML5.0 to CHTML2.0.
352 * @param r [i] Requet_rec is appointed.
353 * @param spec [i] The result of the device specification processing which
354 * was done in advance is appointed.
355 * @param src [i] The character string before the converting is appointed.
356 * @return The character string after the converting is returned.
359 chxj_exchange_chtml20(
365 chxjconvrule_entry *entryp,
374 /*--------------------------------------------------------------------------*/
376 /*--------------------------------------------------------------------------*/
378 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
380 DBG(r,"i found qrcode xml");
383 DBG(r,"not found qrcode xml");
385 /*--------------------------------------------------------------------------*/
386 /* The CHTML structure is initialized. */
387 /*--------------------------------------------------------------------------*/
388 s_init_chtml20(&chtml20, &doc, r, spec);
391 chtml20.entryp = entryp;
392 chtml20.cookie = cookie;
394 chxj_set_content_type(r, "text/html; charset=Windows-31J");
396 /*--------------------------------------------------------------------------*/
397 /* The character string of the input is analyzed. */
398 /*--------------------------------------------------------------------------*/
399 qs_init_malloc(&doc);
400 qs_init_root_node(&doc);
402 ss = apr_pcalloc(r->pool, srclen + 1);
403 memset(ss, 0, srclen + 1);
404 memcpy(ss, src, srclen);
407 chxj_dump_out("[src] CHTML -> CHTML2.0", ss, srclen);
410 qs_parse_string(&doc,ss, strlen(ss));
412 chxj_buffered_write_init(r->pool, &doc.buf);
413 /*--------------------------------------------------------------------------*/
414 /* It converts it from CHTML to CHTML. */
415 /*--------------------------------------------------------------------------*/
416 chxj_node_exchange(spec,r,(void *)&chtml20, &doc, qs_get_root(&doc), 0);
417 chtml20.out = chxj_buffered_write_flush(chtml20.out, &doc.buf);
418 dst = apr_pstrdup(r->pool, chtml20.out);
419 chxj_buffered_write_terminate(&doc.buf);
421 qs_all_free(&doc,QX_LOGMARK);
424 return apr_pstrdup(r->pool,ss);
427 if (strlen(dst) == 0) {
428 dst = apr_psprintf(r->pool, "\n");
431 *dstlen = strlen(dst);
434 chxj_dump_out("[dst] CHTML -> CHTML2.0", dst, *dstlen);
441 * The CHTML structure is initialized.
443 * @param chtml20 [i/o] The pointer to the HDML structure that wants to be
444 * initialized is specified.
445 * @param doc [i] The Doc structure that should be set to the initialized
446 * HDML structure is specified.
447 * @param r [i] To use POOL, the pointer to request_rec is specified.
448 * @param spec [i] The pointer to the device_table
451 s_init_chtml20(chtml20_t *chtml20, Doc *doc, request_rec *r, device_table *spec)
453 memset(doc, 0, sizeof(Doc));
454 memset(chtml20, 0, sizeof(chtml20_t));
458 chtml20->spec = spec;
459 chtml20->out = qs_alloc_zero_byte_string(r);
460 chtml20->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
462 chtml20->doc->parse_mode = PARSE_MODE_CHTML;
467 * Corresponding EMOJI to a current character-code is retrieved.
468 * The substitution character string is stored in the rslt pointer if agreeing.
470 * @param chtml20 [i] The pointer to the CHTML structure is specified.
471 * @param txt [i] The character string to want to examine whether it is
472 * EMOJI is specified.
473 * @param rslt [o] The pointer to the pointer that stores the result is
475 * @return When corresponding EMOJI exists, it returns it excluding 0.
478 s_chtml20_search_emoji(chtml20_t *chtml20, char *txt, char **rslt)
485 spec = chtml20->spec;
491 DBG(r,"spec is NULL");
493 for (ee = chtml20->conf->emoji;
497 if (ee->imode == NULL) {
498 DBG(r,"emoji->imode is NULL");
502 if (ee->imode->string != NULL
503 && strlen(ee->imode->string) > 0
504 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
505 if (spec == NULL || spec->emoji_type == NULL) {
506 *rslt = apr_palloc(r->pool, 3);
507 (*rslt)[0] = ee->imode->hex1byte & 0xff;
508 (*rslt)[1] = ee->imode->hex2byte & 0xff;
510 return strlen(ee->imode->string);
522 * It is a handler who processes the HTML tag.
524 * @param pdoc [i/o] The pointer to the CHTML structure at the output
525 * destination is specified.
526 * @param node [i] The HTML tag node is specified.
527 * @return The conversion result is returned.
530 s_chtml20_start_html_tag(void *pdoc, Node *UNUSED(node))
536 chtml20 = GET_CHTML20(pdoc);
540 /*--------------------------------------------------------------------------*/
542 /*--------------------------------------------------------------------------*/
549 * It is a handler who processes the HTML tag.
551 * @param pdoc [i/o] The pointer to the CHTML structure at the output
552 * destination is specified.
553 * @param node [i] The HTML tag node is specified.
554 * @return The conversion result is returned.
557 s_chtml20_end_html_tag(void *pdoc, Node *UNUSED(child))
563 chtml20 = GET_CHTML20(pdoc);
573 * It is a handler who processes the META tag.
575 * @param pdoc [i/o] The pointer to the CHTML structure at the output
576 * destination is specified.
577 * @param node [i] The META tag node is specified.
578 * @return The conversion result is returned.
581 s_chtml20_start_meta_tag(void *pdoc, Node *node)
587 int content_type_flag;
590 chtml20 = GET_CHTML20(pdoc);
594 content_type_flag = 0;
598 /*--------------------------------------------------------------------------*/
600 /*--------------------------------------------------------------------------*/
601 for (attr = qs_get_attr(doc,node);
603 attr = qs_get_next_attr(doc,attr)) {
608 name = qs_get_attr_name(doc,attr);
609 value = qs_get_attr_value(doc,attr);
614 if (strcasecmp(name, "http-equiv") == 0) {
615 /*----------------------------------------------------------------------*/
617 /*----------------------------------------------------------------------*/
618 W20_L(" http-equiv=\"");
621 if (STRCASEEQ('c','C',"content-type", value)) {
622 content_type_flag = 1;
624 if (STRCASEEQ('r','R',"refresh", value)) {
632 if (strcasecmp(name, "content") == 0) {
633 if (content_type_flag) {
636 W20_L("=\"text/html; charset=Windows-31J\"");
638 else if (refresh_flag) {
639 char *buf = apr_pstrdup(r->pool, value);
643 url = strchr(buf, ';');
645 sec = apr_pstrdup(r->pool, buf);
648 url = chxj_encoding_parameter(r, url);
649 url = chxj_add_cookie_parameter(r, url, chtml20->cookie);
679 * It is a handler who processes the META tag.
681 * @param pdoc [i/o] The pointer to the CHTML structure at the output
682 * destination is specified.
683 * @param node [i] The META tag node is specified.
684 * @return The conversion result is returned.
687 s_chtml20_end_meta_tag(void *pdoc, Node *UNUSED(child))
691 chtml20 = GET_CHTML20(pdoc);
698 * It is a handler who processes the HEAD tag.
700 * @param pdoc [i/o] The pointer to the CHTML structure at the output
701 * destination is specified.
702 * @param node [i] The HEAD tag node is specified.
703 * @return The conversion result is returned.
706 s_chtml20_start_head_tag(void *pdoc, Node *UNUSED(node))
712 chtml20 = GET_CHTML20(pdoc);
722 * It is a handler who processes the HEAD tag.
724 * @param pdoc [i/o] The pointer to the CHTML structure at the output
725 * destination is specified.
726 * @param node [i] The HEAD tag node is specified.
727 * @return The conversion result is returned.
730 s_chtml20_end_head_tag(void *pdoc, Node *UNUSED(child))
736 chtml20 = GET_CHTML20(pdoc);
740 W20_L("</head>\r\n");
746 * It is a handler who processes the TITLE tag.
748 * @param pdoc [i/o] The pointer to the CHTML structure at the output
749 * destination is specified.
750 * @param node [i] The TITLE tag node is specified.
751 * @return The conversion result is returned.
754 s_chtml20_start_title_tag(void *pdoc, Node *UNUSED(node))
760 chtml20 = GET_CHTML20(pdoc);
770 * It is a handler who processes the TITLE tag.
772 * @param pdoc [i/o] The pointer to the CHTML structure at the output
773 * destination is specified.
774 * @param node [i] The TITLE tag node is specified.
775 * @return The conversion result is returned.
778 s_chtml20_end_title_tag(void *pdoc, Node *UNUSED(child))
784 chtml20 = GET_CHTML20(pdoc);
788 W20_L("</title>\r\n");
794 * It is a handler who processes the BASE tag.
796 * @param pdoc [i/o] The pointer to the CHTML structure at the output
797 * destination is specified.
798 * @param node [i] The BASE tag node is specified.
799 * @return The conversion result is returned.
802 s_chtml20_start_base_tag(void *pdoc, Node *node)
809 chtml20 = GET_CHTML20(pdoc);
814 /*--------------------------------------------------------------------------*/
816 /*--------------------------------------------------------------------------*/
817 for (attr = qs_get_attr(doc,node);
819 attr = qs_get_next_attr(doc,attr)) {
824 name = qs_get_attr_name(doc,attr);
825 value = qs_get_attr_value(doc,attr);
827 if (STRCASEEQ('h','H',"href", name)) {
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_end_base_tag(void *pdoc, Node *UNUSED(child))
853 chtml20 = GET_CHTML20(pdoc);
862 * It is a handler who processes the BODY tag.
864 * @param pdoc [i/o] The pointer to the CHTML structure at the output
865 * destination is specified.
866 * @param node [i] The BODY tag node is specified.
867 * @return The conversion result is returned.
870 s_chtml20_start_body_tag(void *pdoc, Node *node)
877 chtml20 = GET_CHTML20(pdoc);
882 /*--------------------------------------------------------------------------*/
884 /*--------------------------------------------------------------------------*/
885 for (attr = qs_get_attr(doc,node);
887 attr = qs_get_next_attr(doc,attr)) {
891 name = qs_get_attr_name(doc,attr);
892 value = qs_get_attr_value(doc,attr);
897 if (strcasecmp(name, "bgcolor") == 0) {
898 /*----------------------------------------------------------------------*/
900 /*----------------------------------------------------------------------*/
901 W20_L(" bgcolor=\"");
909 if (strcasecmp(name, "text") == 0) {
910 /*----------------------------------------------------------------------*/
912 /*----------------------------------------------------------------------*/
921 if (strcasecmp(name, "link") == 0) {
922 /*----------------------------------------------------------------------*/
924 /*----------------------------------------------------------------------*/
933 if (strcasecmp(name, "alink") == 0) {
934 /*----------------------------------------------------------------------*/
936 /*----------------------------------------------------------------------*/
943 if (strcasecmp(name, "vlink") == 0) {
944 /*----------------------------------------------------------------------*/
946 /*----------------------------------------------------------------------*/
961 * It is a handler who processes the BODY tag.
963 * @param pdoc [i/o] The pointer to the CHTML structure at the output
964 * destination is specified.
965 * @param node [i] The BODY tag node is specified.
966 * @return The conversion result is returned.
969 s_chtml20_end_body_tag(void *pdoc, Node *UNUSED(child))
975 chtml20 = GET_CHTML20(pdoc);
979 W20_L("</body>\r\n");
985 * It is a handler who processes the A tag.
987 * @param pdoc [i/o] The pointer to the CHTML structure at the output
988 * destination is specified.
989 * @param node [i] The A tag node is specified.
990 * @return The conversion result is returned.
993 s_chtml20_start_a_tag(void *pdoc, Node *node)
1000 chtml20 = GET_CHTML20(pdoc);
1005 /*--------------------------------------------------------------------------*/
1006 /* Get Attributes */
1007 /*--------------------------------------------------------------------------*/
1008 for (attr = qs_get_attr(doc,node);
1010 attr = qs_get_next_attr(doc,attr)) {
1015 name = qs_get_attr_name(doc,attr);
1016 value = qs_get_attr_value(doc,attr);
1021 if (strcasecmp(name, "name") == 0) {
1022 /*--------------------------------------------------------------------*/
1024 /*--------------------------------------------------------------------*/
1033 if (strcasecmp(name, "href") == 0) {
1034 /*--------------------------------------------------------------------*/
1036 /*--------------------------------------------------------------------*/
1037 value = chxj_encoding_parameter(r, value);
1038 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
1047 if (strcasecmp(name, "accesskey") == 0) {
1048 /*--------------------------------------------------------------------*/
1050 /*--------------------------------------------------------------------*/
1051 W20_L(" accesskey=\"");
1059 if (strcasecmp(name, "cti") == 0) {
1060 /*--------------------------------------------------------------------*/
1062 /*--------------------------------------------------------------------*/
1071 if (strcasecmp(name, "ijam") == 0) {
1072 /*--------------------------------------------------------------------*/
1074 /*--------------------------------------------------------------------*/
1078 if (strcasecmp(name, "ista") == 0) {
1079 /*--------------------------------------------------------------------*/
1081 /*--------------------------------------------------------------------*/
1085 if (strcasecmp(name, "ilet") == 0) {
1086 /*--------------------------------------------------------------------*/
1088 /*--------------------------------------------------------------------*/
1092 if (strcasecmp(name, "iswf") == 0) {
1093 /*--------------------------------------------------------------------*/
1095 /*--------------------------------------------------------------------*/
1099 if (strcasecmp(name, "irst") == 0) {
1100 /*--------------------------------------------------------------------*/
1102 /*--------------------------------------------------------------------*/
1109 if (strcasecmp(name, "utn") == 0) {
1110 /*--------------------------------------------------------------------*/
1112 /*--------------------------------------------------------------------*/
1119 if (strcasecmp(name, "telbook") == 0) {
1120 /*--------------------------------------------------------------------*/
1122 /*--------------------------------------------------------------------*/
1129 if (strcasecmp(name, "kana") == 0) {
1130 /*--------------------------------------------------------------------*/
1132 /*--------------------------------------------------------------------*/
1139 if (strcasecmp(name, "email") == 0) {
1140 /*--------------------------------------------------------------------*/
1142 /*--------------------------------------------------------------------*/
1152 return chtml20->out;
1157 * It is a handler who processes the A tag.
1159 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1160 * destination is specified.
1161 * @param node [i] The A tag node is specified.
1162 * @return The conversion result is returned.
1165 s_chtml20_end_a_tag(void *pdoc, Node *UNUSED(child))
1171 chtml20 = GET_CHTML20(pdoc);
1176 return chtml20->out;
1181 * It is a handler who processes the BR tag.
1183 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1184 * destination is specified.
1185 * @param node [i] The BR tag node is specified.
1186 * @return The conversion result is returned.
1189 s_chtml20_start_br_tag(void *pdoc, Node *UNUSED(node))
1195 chtml20 = GET_CHTML20(pdoc);
1200 return chtml20->out;
1205 * It is a handler who processes the BR tag.
1207 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1208 * destination is specified.
1209 * @param node [i] The BR tag node is specified.
1210 * @return The conversion result is returned.
1213 s_chtml20_end_br_tag(void *pdoc, Node *UNUSED(child))
1219 chtml20 = GET_CHTML20(pdoc);
1223 return chtml20->out;
1228 * It is a handler who processes the TR tag.
1230 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1231 * destination is specified.
1232 * @param node [i] The TR tag node is specified.
1233 * @return The conversion result is returned.
1236 s_chtml20_start_tr_tag(void *pdoc, Node *UNUSED(node))
1242 chtml20 = GET_CHTML20(pdoc);
1246 return chtml20->out;
1251 * It is a handler who processes the TR tag.
1253 * @param chtml20 [i/o] The pointer to the CHTML structure at the output
1254 * destination is specified.
1255 * @param node [i] The TR tag node is specified.
1256 * @return The conversion result is returned.
1259 s_chtml20_end_tr_tag(void *pdoc, Node *UNUSED(child))
1265 chtml20 = GET_CHTML20(pdoc);
1270 return chtml20->out;
1275 * It is a handler who processes the FONT tag.
1277 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1278 * destination is specified.
1279 * @param node [i] The FONT tag node is specified.
1280 * @return The conversion result is returned.
1283 s_chtml20_start_font_tag(void *pdoc, Node *node)
1290 chtml20 = GET_CHTML20(pdoc);
1296 /*--------------------------------------------------------------------------*/
1297 /* Get Attributes */
1298 /*--------------------------------------------------------------------------*/
1299 for (attr = qs_get_attr(doc,node);
1301 attr = qs_get_next_attr(doc,attr)) {
1306 name = qs_get_attr_name(doc,attr);
1307 value = qs_get_attr_value(doc,attr);
1312 if (strcasecmp(name, "color") == 0) {
1321 if (strcasecmp(name, "size") == 0) {
1322 /*--------------------------------------------------------------------*/
1324 /*--------------------------------------------------------------------*/
1334 return chtml20->out;
1339 * It is a handler who processes the FONT tag.
1341 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1342 * destination is specified.
1343 * @param node [i] The FONT tag node is specified.
1344 * @return The conversion result is returned.
1347 s_chtml20_end_font_tag(void *pdoc, Node *UNUSED(child))
1353 chtml20 = GET_CHTML20(pdoc);
1358 return chtml20->out;
1363 * It is a handler who processes the FORM tag.
1365 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1366 * destination is specified.
1367 * @param node [i] The FORM tag node is specified.
1368 * @return The conversion result is returned.
1371 s_chtml20_start_form_tag(void *pdoc, Node *node)
1378 chtml20 = GET_CHTML20(pdoc);
1383 /*--------------------------------------------------------------------------*/
1384 /* Get Attributes */
1385 /*--------------------------------------------------------------------------*/
1386 for (attr = qs_get_attr(doc,node);
1388 attr = qs_get_next_attr(doc,attr)) {
1393 name = qs_get_attr_name(doc,attr);
1394 value = qs_get_attr_value(doc,attr);
1399 if (strcasecmp(name, "action") == 0) {
1400 /*--------------------------------------------------------------------*/
1402 /*--------------------------------------------------------------------*/
1403 value = chxj_encoding_parameter(r, value);
1404 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
1406 W20_L(" action=\"");
1414 if (strcasecmp(name, "method") == 0) {
1415 /*--------------------------------------------------------------------*/
1417 /*--------------------------------------------------------------------*/
1418 W20_L(" method=\"");
1426 if (strcasecmp(name, "utn") == 0) {
1427 /*--------------------------------------------------------------------*/
1429 /*--------------------------------------------------------------------*/
1439 return chtml20->out;
1444 * It is a handler who processes the FORM tag.
1446 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1447 * destination is specified.
1448 * @param node [i] The FORM tag node is specified.
1449 * @return The conversion result is returned.
1452 s_chtml20_end_form_tag(void *pdoc, Node *UNUSED(child))
1458 chtml20 = GET_CHTML20(pdoc);
1463 return chtml20->out;
1468 * It is a handler who processes the INPUT tag.
1470 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1471 * destination is specified.
1472 * @param node [i] The INPUT tag node is specified.
1473 * @return The conversion result is returned.
1476 s_chtml20_start_input_tag(void *pdoc, Node *node)
1481 char *max_length = NULL;
1485 char *istyle = NULL;
1487 char *checked = NULL;
1488 char *accesskey = NULL;
1490 chtml20 = GET_CHTML20(pdoc);
1496 /*--------------------------------------------------------------------------*/
1497 /* Get Attributes */
1498 /*--------------------------------------------------------------------------*/
1500 type = qs_get_type_attr(doc, node, r);
1501 name = qs_get_name_attr(doc, node, r);
1502 value = qs_get_value_attr(doc,node,r);
1503 istyle = qs_get_istyle_attr(doc,node,r);
1504 max_length = qs_get_maxlength_attr(doc,node,r);
1505 checked = qs_get_checked_attr(doc,node,r);
1506 accesskey = qs_get_accesskey_attr(doc, node, r);
1507 size = qs_get_size_attr(doc, node, r);
1534 W20_L(" accesskey=\"");
1540 /*------------------------------------------------------------------------*/
1542 /*------------------------------------------------------------------------*/
1543 W20_L(" istyle=\"");
1548 /*--------------------------------------------------------------------------*/
1549 /* The figure is default for the password. */
1550 /*--------------------------------------------------------------------------*/
1552 if (chxj_chk_numeric(max_length) != 0)
1553 max_length = apr_psprintf(doc->buf.pool, "0");
1554 if (istyle != NULL && strcasecmp(istyle, "1") == 0) {
1555 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length) * 2);
1559 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length));
1568 return chtml20->out;
1573 * It is a handler who processes the INPUT tag.
1575 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1576 * destination is specified.
1577 * @param node [i] The INPUT tag node is specified.
1578 * @return The conversion result is returned.
1581 s_chtml20_end_input_tag(void *pdoc, Node *UNUSED(child))
1587 chtml20 = GET_CHTML20(pdoc);
1591 return chtml20->out;
1596 * It is a handler who processes the CENTER tag.
1598 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1599 * destination is specified.
1600 * @param node [i] The CENTER tag node is specified.
1601 * @return The conversion result is returned.
1604 s_chtml20_start_center_tag(void *pdoc, Node *UNUSED(node))
1610 chtml20 = GET_CHTML20(pdoc);
1615 return chtml20->out;
1620 * It is a handler who processes the CENTER tag.
1622 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1623 * destination is specified.
1624 * @param node [i] The CENTER tag node is specified.
1625 * @return The conversion result is returned.
1628 s_chtml20_end_center_tag(void *pdoc, Node *UNUSED(child))
1634 chtml20 = GET_CHTML20(pdoc);
1639 return chtml20->out;
1644 * It is a handler who processes the UL tag.
1646 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1647 * destination is specified.
1648 * @param node [i] The UL tag node is specified.
1649 * @return The conversion result is returned.
1652 s_chtml20_start_ul_tag(void *pdoc, Node *UNUSED(node))
1658 chtml20 = GET_CHTML20(pdoc);
1663 return chtml20->out;
1668 * It is a handler who processes the UL tag.
1670 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1671 * destination is specified.
1672 * @param node [i] The UL tag node is specified.
1673 * @return The conversion result is returned.
1676 s_chtml20_end_ul_tag(void *pdoc, Node *UNUSED(child))
1682 chtml20 = GET_CHTML20(pdoc);
1687 return chtml20->out;
1692 * It is a handler who processes the OL tag.
1694 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1695 * destination is specified.
1696 * @param node [i] The OL tag node is specified.
1697 * @return The conversion result is returned.
1700 s_chtml20_start_ol_tag(void *pdoc, Node *UNUSED(node))
1706 chtml20 = GET_CHTML20(pdoc);
1711 return chtml20->out;
1716 * It is a handler who processes the OL tag.
1718 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1719 * destination is specified.
1720 * @param node [i] The OL tag node is specified.
1721 * @return The conversion result is returned.
1724 s_chtml20_end_ol_tag(void *pdoc, Node *UNUSED(child))
1730 chtml20 = GET_CHTML20(pdoc);
1735 return chtml20->out;
1740 * It is a handler who processes the LI tag.
1742 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1743 * destination is specified.
1744 * @param node [i] The LI tag node is specified.
1745 * @return The conversion result is returned.
1748 s_chtml20_start_li_tag(void *pdoc, Node *UNUSED(node))
1754 chtml20 = GET_CHTML20(pdoc);
1759 return chtml20->out;
1764 * It is a handler who processes the LI tag.
1766 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1767 * destination is specified.
1768 * @param node [i] The LI tag node is specified.
1769 * @return The conversion result is returned.
1772 s_chtml20_end_li_tag(void *pdoc, Node *UNUSED(child))
1778 chtml20 = GET_CHTML20(pdoc);
1783 return chtml20->out;
1788 * It is a handler who processes the HR tag.
1790 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1791 * destination is specified.
1792 * @param node [i] The HR tag node is specified.
1793 * @return The conversion result is returned.
1796 s_chtml20_start_hr_tag(void *pdoc, Node *node)
1803 chtml20 = GET_CHTML20(pdoc);
1809 for (attr = qs_get_attr(doc,node);
1811 attr = qs_get_next_attr(doc,attr)) {
1816 name = qs_get_attr_name(doc,attr);
1817 value = qs_get_attr_value(doc,attr);
1822 if (strcasecmp(name, "align") == 0) {
1823 /*--------------------------------------------------------------------*/
1825 /*--------------------------------------------------------------------*/
1834 if (strcasecmp(name, "size") == 0) {
1835 /*--------------------------------------------------------------------*/
1837 /*--------------------------------------------------------------------*/
1846 if (strcasecmp(name, "width") == 0) {
1847 /*--------------------------------------------------------------------*/
1849 /*--------------------------------------------------------------------*/
1858 if (strcasecmp(name, "noshade") == 0) {
1859 /*--------------------------------------------------------------------*/
1861 /*--------------------------------------------------------------------*/
1868 if (strcasecmp(name, "color") == 0) {
1869 /*--------------------------------------------------------------------*/
1871 /*--------------------------------------------------------------------*/
1881 return chtml20->out;
1886 * It is a handler who processes the HR tag.
1888 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1889 * destination is specified.
1890 * @param node [i] The HR tag node is specified.
1891 * @return The conversion result is returned.
1894 s_chtml20_end_hr_tag(void *pdoc, Node *UNUSED(child))
1900 chtml20 = GET_CHTML20(pdoc);
1904 return chtml20->out;
1909 * It is a handler who processes the IMG tag.
1911 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1912 * destination is specified.
1913 * @param node [i] The IMG tag node is specified.
1914 * @return The conversion result is returned.
1917 s_chtml20_start_img_tag(void *pdoc, Node *node)
1923 #ifndef IMG_NOT_CONVERT_FILENAME
1927 chtml20 = GET_CHTML20(pdoc);
1931 #ifndef IMG_NOT_CONVERT_FILENAME
1932 spec = chtml20->spec;
1936 /*-------------------------------------------------------------------------*/
1937 /* Get Attributes */
1938 /*-------------------------------------------------------------------------*/
1939 for (attr = qs_get_attr(doc,node);
1941 attr = qs_get_next_attr(doc,attr)) {
1946 name = qs_get_attr_name(doc,attr);
1947 value = qs_get_attr_value(doc,attr);
1952 if (strcasecmp(name, "src") == 0) {
1953 /*-------------------------------------------------------------------*/
1955 /*-------------------------------------------------------------------*/
1956 #ifdef IMG_NOT_CONVERT_FILENAME
1957 value = chxj_encoding_parameter(r, value);
1958 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
1960 value = apr_psprintf(doc->buf.pool,
1963 (strchr(value, '?')) ? '&' : '?',
1964 CHXJ_COOKIE_NOUPDATE_PARAM);
1970 value = chxj_img_conv(r, spec, value);
1971 value = chxj_encoding_parameter(r, value);
1972 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
1974 value = apr_psprintf(doc->buf.pool,
1977 (strchr(value, '?')) ? '&' : '?',
1978 CHXJ_COOKIE_NOUPDATE_PARAM);
1989 if (strcasecmp(name, "align" ) == 0) {
1990 /*--------------------------------------------------------------------*/
1992 /*--------------------------------------------------------------------*/
1998 if (strcasecmp(name, "alt" ) == 0) {
1999 /*--------------------------------------------------------------------*/
2001 /*--------------------------------------------------------------------*/
2007 if (strcasecmp(name, "align" ) == 0) {
2008 /*--------------------------------------------------------------------*/
2010 /*--------------------------------------------------------------------*/
2017 if (strcasecmp(name, "width" ) == 0) {
2018 /*--------------------------------------------------------------------*/
2020 /*--------------------------------------------------------------------*/
2029 if (strcasecmp(name, "height") == 0) {
2030 /*--------------------------------------------------------------------*/
2032 /*--------------------------------------------------------------------*/
2033 W20_L(" height=\"");
2038 if (strcasecmp(name, "hspace") == 0) {
2039 /*--------------------------------------------------------------------*/
2041 /*--------------------------------------------------------------------*/
2042 W20_L(" hspace=\"");
2050 if (strcasecmp(name, "vspace") == 0) {
2051 /*--------------------------------------------------------------------*/
2053 /*--------------------------------------------------------------------*/
2054 W20_L(" vspace=\"");
2065 return chtml20->out;
2070 * It is a handler who processes the IMG tag.
2072 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2073 * destination is specified.
2074 * @param node [i] The IMG tag node is specified.
2075 * @return The conversion result is returned.
2078 s_chtml20_end_img_tag(void *pdoc, Node *UNUSED(child))
2084 chtml20 = GET_CHTML20(pdoc);
2088 return chtml20->out;
2093 * It is a handler who processes the SELECT tag.
2095 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2096 * destination is specified.
2097 * @param node [i] The SELECT tag node is specified.
2098 * @return The conversion result is returned.
2101 s_chtml20_start_select_tag(void *pdoc, Node *child)
2108 chtml20 = GET_CHTML20(pdoc);
2116 for (attr = qs_get_attr(doc,child);
2118 attr = qs_get_next_attr(doc,attr)) {
2123 nm = qs_get_attr_name(doc,attr);
2124 val = qs_get_attr_value(doc,attr);
2129 if (strcasecmp(nm, "size") == 0) {
2130 /*--------------------------------------------------------------------*/
2131 /* CHTML 1.0 version 2.0 */
2132 /*--------------------------------------------------------------------*/
2133 size = apr_pstrdup(doc->buf.pool, val);
2139 if (strcasecmp(nm, "name") == 0) {
2140 /*--------------------------------------------------------------------*/
2141 /* CHTML 1.0 version 2.0 */
2142 /*--------------------------------------------------------------------*/
2143 name = apr_pstrdup(doc->buf.pool, val);
2149 if (strcasecmp(nm, "multiple") == 0) {
2150 /*--------------------------------------------------------------------*/
2151 /* CHTML 1.0 version 2.0 */
2152 /*--------------------------------------------------------------------*/
2175 return chtml20->out;
2180 * It is a handler who processes the SELECT tag.
2182 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2183 * destination is specified.
2184 * @param node [i] The SELECT tag node is specified.
2185 * @return The conversion result is returned.
2188 s_chtml20_end_select_tag(void *pdoc, Node *UNUSED(child))
2194 chtml20 = GET_CHTML20(pdoc);
2198 W20_L("</select>\r\n");
2199 return chtml20->out;
2204 * It is a handler who processes the OPTION tag.
2206 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2207 * destination is specified.
2208 * @param node [i] The OPTION tag node is specified.
2209 * @return The conversion result is returned.
2212 s_chtml20_start_option_tag(void *pdoc, Node *child)
2219 chtml20 = GET_CHTML20(pdoc);
2223 char *selected = NULL;
2227 for (attr = qs_get_attr(doc,child);
2229 attr = qs_get_next_attr(doc,attr)) {
2234 nm = qs_get_attr_name(doc,attr);
2235 val = qs_get_attr_value(doc,attr);
2240 if (strcasecmp(nm, "selected") == 0) {
2241 /*--------------------------------------------------------------------*/
2242 /* CHTML 1.0 version 2.0 */
2243 /*--------------------------------------------------------------------*/
2244 selected = apr_pstrdup(doc->buf.pool, val);
2250 if (strcasecmp(nm, "value") == 0) {
2251 /*--------------------------------------------------------------------*/
2252 /* CHTML 1.0 version 2.0 */
2253 /*--------------------------------------------------------------------*/
2254 value = apr_pstrdup(doc->buf.pool, val);
2269 W20_L(" value=\"\"");
2273 W20_L(" selected ");
2276 return chtml20->out;
2281 * It is a handler who processes the OPTION tag.
2283 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2284 * destination is specified.
2285 * @param node [i] The OPTION tag node is specified.
2286 * @return The conversion result is returned.
2289 s_chtml20_end_option_tag(void *pdoc, Node *UNUSED(child))
2295 chtml20 = GET_CHTML20(pdoc);
2301 return chtml20->out;
2306 * It is a handler who processes the DIV tag.
2308 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2309 * destination is specified.
2310 * @param node [i] The DIV tag node is specified.
2311 * @return The conversion result is returned.
2314 s_chtml20_start_div_tag(void *pdoc, Node *child)
2321 chtml20 = GET_CHTML20(pdoc);
2329 for (attr = qs_get_attr(doc,child);
2331 attr = qs_get_next_attr(doc,attr)) {
2336 nm = qs_get_attr_name(doc,attr);
2337 val = qs_get_attr_value(doc,attr);
2339 if (STRCASEEQ('a','A', "align", nm)) {
2340 /*----------------------------------------------------------------------*/
2341 /* CHTML 1.0 (W3C version 3.2) */
2342 /*----------------------------------------------------------------------*/
2343 align = apr_pstrdup(doc->buf.pool, val);
2354 return chtml20->out;
2359 * It is a handler who processes the DIV tag.
2361 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2362 * destination is specified.
2363 * @param node [i] The DIV tag node is specified.
2364 * @return The conversion result is returned.
2367 s_chtml20_end_div_tag(void *pdoc, Node *UNUSED(child))
2373 chtml20 = GET_CHTML20(pdoc);
2377 W20_L("</div>\r\n");
2378 return chtml20->out;
2383 * It is a handler who processes the H1 tag.
2385 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2386 * destination is specified.
2387 * @param node [i] The H1 tag node is specified.
2388 * @return The conversion result is returned.
2391 s_chtml20_start_h1_tag(void *pdoc, Node *UNUSED(node))
2397 chtml20 = GET_CHTML20(pdoc);
2402 return chtml20->out;
2407 * It is a handler who processes the H1 tag.
2409 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2410 * destination is specified.
2411 * @param node [i] The H1 tag node is specified.
2412 * @return The conversion result is returned.
2415 s_chtml20_end_h1_tag(void *pdoc, Node *UNUSED(child))
2421 chtml20 = GET_CHTML20(pdoc);
2426 return chtml20->out;
2431 * It is a handler who processes the H2 tag.
2433 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2434 * destination is specified.
2435 * @param node [i] The H2 tag node is specified.
2436 * @return The conversion result is returned.
2439 s_chtml20_start_h2_tag(void *pdoc, Node *UNUSED(node))
2445 chtml20 = GET_CHTML20(pdoc);
2450 return chtml20->out;
2455 * It is a handler who processes the H2 tag.
2457 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2458 * destination is specified.
2459 * @param node [i] The H2 tag node is specified.
2460 * @return The conversion result is returned.
2463 s_chtml20_end_h2_tag(void *pdoc, Node *UNUSED(child))
2469 chtml20 = GET_CHTML20(pdoc);
2474 return chtml20->out;
2479 * It is a handler who processes the H3 tag.
2481 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2482 * destination is specified.
2483 * @param node [i] The H3 tag node is specified.
2484 * @return The conversion result is returned.
2487 s_chtml20_start_h3_tag(void *pdoc, Node *UNUSED(node))
2493 chtml20 = GET_CHTML20(pdoc);
2498 return chtml20->out;
2503 * It is a handler who processes the H3 tag.
2505 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2506 * destination is specified.
2507 * @param node [i] The H3 tag node is specified.
2508 * @return The conversion result is returned.
2511 s_chtml20_end_h3_tag(void *pdoc, Node *UNUSED(child))
2517 chtml20 = GET_CHTML20(pdoc);
2522 return chtml20->out;
2527 * It is a handler who processes the H4 tag.
2529 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2530 * destination is specified.
2531 * @param node [i] The H4 tag node is specified.
2532 * @return The conversion result is returned.
2535 s_chtml20_start_h4_tag(void *pdoc, Node *UNUSED(node))
2541 chtml20 = GET_CHTML20(pdoc);
2546 return chtml20->out;
2551 * It is a handler who processes the H4 tag.
2553 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2554 * destination is specified.
2555 * @param node [i] The H4 tag node is specified.
2556 * @return The conversion result is returned.
2559 s_chtml20_end_h4_tag(void *pdoc, Node *UNUSED(child))
2565 chtml20 = GET_CHTML20(pdoc);
2570 return chtml20->out;
2575 * It is a handler who processes the H5 tag.
2577 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2578 * destination is specified.
2579 * @param node [i] The H5 tag node is specified.
2580 * @return The conversion result is returned.
2583 s_chtml20_start_h5_tag(void *pdoc, Node *UNUSED(node))
2589 chtml20 = GET_CHTML20(pdoc);
2594 return chtml20->out;
2599 * It is a handler who processes the H5 tag.
2601 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2602 * destination is specified.
2603 * @param node [i] The H5 tag node is specified.
2604 * @return The conversion result is returned.
2607 s_chtml20_end_h5_tag(void *pdoc, Node *UNUSED(child))
2613 chtml20 = GET_CHTML20(pdoc);
2618 return chtml20->out;
2623 * It is a handler who processes the H6 tag.
2625 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2626 * destination is specified.
2627 * @param node [i] The H6 tag node is specified.
2628 * @return The conversion result is returned.
2631 s_chtml20_start_h6_tag(void *pdoc, Node *UNUSED(node))
2637 chtml20 = GET_CHTML20(pdoc);
2642 return chtml20->out;
2647 * It is a handler who processes the H6 tag.
2649 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2650 * destination is specified.
2651 * @param node [i] The H6 tag node is specified.
2652 * @return The conversion result is returned.
2655 s_chtml20_end_h6_tag(void *pdoc, Node *UNUSED(child))
2661 chtml20 = GET_CHTML20(pdoc);
2666 return chtml20->out;
2671 * It is a handler who processes the PRE tag.
2673 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2674 * destination is specified.
2675 * @param node [i] The PRE tag node is specified.
2676 * @return The conversion result is returned.
2679 s_chtml20_start_pre_tag(void *pdoc, Node *UNUSED(node))
2685 chtml20 = GET_CHTML20(pdoc);
2689 chtml20->pre_flag++;
2691 return chtml20->out;
2696 * It is a handler who processes the PRE tag.
2698 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2699 * destination is specified.
2700 * @param node [i] The PRE tag node is specified.
2701 * @return The conversion result is returned.
2704 s_chtml20_end_pre_tag(void *pdoc, Node *UNUSED(child))
2710 chtml20 = GET_CHTML20(pdoc);
2715 chtml20->pre_flag--;
2717 return chtml20->out;
2722 * It is a handler who processes the P tag.
2724 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2725 * destination is specified.
2726 * @param node [i] The P tag node is specified.
2727 * @return The conversion result is returned.
2730 s_chtml20_start_p_tag(void *pdoc, Node *UNUSED(node))
2736 chtml20 = GET_CHTML20(pdoc);
2741 return chtml20->out;
2746 * It is a handler who processes the P tag.
2748 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2749 * destination is specified.
2750 * @param node [i] The P tag node is specified.
2751 * @return The conversion result is returned.
2754 s_chtml20_end_p_tag(void *pdoc, Node *UNUSED(child))
2760 chtml20 = GET_CHTML20(pdoc);
2765 return chtml20->out;
2770 s_chtml20_chxjif_tag(void *pdoc, Node *node)
2777 chtml20 = GET_CHTML20(pdoc);
2781 for (child = qs_get_child_node(doc, node);
2783 child = qs_get_next_node(doc, child)) {
2785 W20_V(child->otext);
2786 s_chtml20_chxjif_tag(pdoc, child);
2794 * It is a handler who processes the TEXTARE tag.
2796 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2797 * destination is specified.
2798 * @param node [i] The TEXTAREA tag node is specified.
2799 * @return The conversion result is returned.
2802 s_chtml20_start_textarea_tag(void *pdoc, Node *node)
2809 chtml20 = GET_CHTML20(pdoc);
2813 chtml20->textarea_flag++;
2814 W20_L("<textarea ");
2815 for (attr = qs_get_attr(doc,node);
2817 attr = qs_get_next_attr(doc,attr)) {
2822 name = qs_get_attr_name(doc,attr);
2823 value = qs_get_attr_value(doc,attr);
2828 if (strcasecmp(name, "name") == 0) {
2837 if (strcasecmp(name, "rows") == 0) {
2846 if (strcasecmp(name, "cols") == 0) {
2858 return chtml20->out;
2863 * It is a handler who processes the TEXTAREA tag.
2865 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2866 * destination is specified.
2867 * @param node [i] The TEXTAREA tag node is specified.
2868 * @return The conversion result is returned.
2871 s_chtml20_end_textarea_tag(void *pdoc, Node *UNUSED(child))
2877 chtml20 = GET_CHTML20(pdoc);
2881 W20_L("</textarea>\r\n");
2882 chtml20->textarea_flag--;
2884 return chtml20->out;
2889 s_chtml20_text_tag(void *pdoc, Node *child)
2901 chtml20 = GET_CHTML20(pdoc);
2905 textval = qs_get_node_value(doc,child);
2906 textval = qs_trim_string(chtml20->doc->r, textval);
2907 if (strlen(textval) == 0)
2908 return chtml20->out;
2910 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
2911 memset(tmp, 0, qs_get_node_size(doc,child)+1);
2913 tdst = qs_alloc_zero_byte_string(r);
2914 memset(one_byte, 0, sizeof(one_byte));
2917 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
2919 int rtn = s_chtml20_search_emoji(chtml20, &textval[ii], &out);
2921 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
2925 if (is_sjis_kanji(textval[ii])) {
2926 one_byte[0] = textval[ii+0];
2927 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2928 one_byte[0] = textval[ii+1];
2929 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2933 if (chtml20->pre_flag) {
2934 one_byte[0] = textval[ii+0];
2935 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2938 if (chtml20->textarea_flag) {
2939 one_byte[0] = textval[ii+0];
2940 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2943 if (textval[ii] != '\r' && textval[ii] != '\n') {
2944 one_byte[0] = textval[ii+0];
2945 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2949 return chtml20->out;