2 * Copyright (C) 2005-2009 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"
25 #include "chxj_header_inf.h"
28 #define GET_CHTML20(X) ((chtml20_t*)(X))
31 #define W_L(X) do { chtml20->out = BUFFERED_WRITE_LITERAL(chtml20->out, &doc->buf, (X)); } while(0)
32 #define W_V(X) do { chtml20->out = (X) ? BUFFERED_WRITE_VALUE(chtml20->out, &doc->buf, (X)) \
33 : BUFFERED_WRITE_LITERAL(chtml20->out, &doc->buf, ""); } while(0)
35 #define W_NLCODE() do { char *nlcode = TO_NLCODE(chtml20->conf); W_V(nlcode); } while (0)
37 static char *s_chtml20_start_html_tag (void *pdoc, Node *node);
38 static char *s_chtml20_end_html_tag (void *pdoc, Node *node);
39 static char *s_chtml20_start_meta_tag (void *pdoc, Node *node);
40 static char *s_chtml20_end_meta_tag (void *pdoc, Node *node);
41 static char *s_chtml20_start_textarea_tag(void *pdoc, Node *node);
42 static char *s_chtml20_end_textarea_tag (void *pdoc, Node *node);
43 static char *s_chtml20_start_p_tag (void *pdoc, Node *node);
44 static char *s_chtml20_end_p_tag (void *pdoc, Node *node);
45 static char *s_chtml20_start_pre_tag (void *pdoc, Node *node);
46 static char *s_chtml20_end_pre_tag (void *pdoc, Node *node);
47 static char *s_chtml20_start_h1_tag (void *pdoc, Node *node);
48 static char *s_chtml20_end_h1_tag (void *pdoc, Node *node);
49 static char *s_chtml20_start_h2_tag (void *pdoc, Node *node);
50 static char *s_chtml20_end_h2_tag (void *pdoc, Node *node);
51 static char *s_chtml20_start_h3_tag (void *pdoc, Node *node);
52 static char *s_chtml20_end_h3_tag (void *pdoc, Node *node);
53 static char *s_chtml20_start_h4_tag (void *pdoc, Node *node);
54 static char *s_chtml20_end_h4_tag (void *pdoc, Node *node);
55 static char *s_chtml20_start_h5_tag (void *pdoc, Node *node);
56 static char *s_chtml20_end_h5_tag (void *pdoc, Node *node);
57 static char *s_chtml20_start_h6_tag (void *pdoc, Node *node);
58 static char *s_chtml20_end_h6_tag (void *pdoc, Node *node);
59 static char *s_chtml20_start_ul_tag (void *pdoc, Node *node);
60 static char *s_chtml20_end_ul_tag (void *pdoc, Node *node);
61 static char *s_chtml20_start_ol_tag (void *pdoc, Node *node);
62 static char *s_chtml20_end_ol_tag (void *pdoc, Node *node);
63 static char *s_chtml20_start_li_tag (void *pdoc, Node *node);
64 static char *s_chtml20_end_li_tag (void *pdoc, Node *node);
65 static char *s_chtml20_start_head_tag (void *pdoc, Node *node);
66 static char *s_chtml20_end_head_tag (void *pdoc, Node *node);
67 static char *s_chtml20_start_title_tag (void *pdoc, Node *node);
68 static char *s_chtml20_end_title_tag (void *pdoc, Node *node);
69 static char *s_chtml20_start_base_tag (void *pdoc, Node *node);
70 static char *s_chtml20_end_base_tag (void *pdoc, Node *node);
71 static char *s_chtml20_start_body_tag (void *pdoc, Node *node);
72 static char *s_chtml20_end_body_tag (void *pdoc, Node *node);
73 static char *s_chtml20_start_a_tag (void *pdoc, Node *node);
74 static char *s_chtml20_end_a_tag (void *pdoc, Node *node);
75 static char *s_chtml20_start_br_tag (void *pdoc, Node *node);
76 static char *s_chtml20_end_br_tag (void *pdoc, Node *node);
77 static char *s_chtml20_start_tr_tag (void *pdoc, Node *node);
78 static char *s_chtml20_end_tr_tag (void *pdoc, Node *node);
79 static char *s_chtml20_start_font_tag (void *pdoc, Node *node);
80 static char *s_chtml20_end_font_tag (void *pdoc, Node *node);
81 static char *s_chtml20_start_form_tag (void *pdoc, Node *node);
82 static char *s_chtml20_end_form_tag (void *pdoc, Node *node);
83 static char *s_chtml20_start_input_tag (void *pdoc, Node *node);
84 static char *s_chtml20_end_input_tag (void *pdoc, Node *node);
85 static char *s_chtml20_start_center_tag (void *pdoc, Node *node);
86 static char *s_chtml20_end_center_tag (void *pdoc, Node *node);
87 static char *s_chtml20_start_hr_tag (void *pdoc, Node *node);
88 static char *s_chtml20_end_hr_tag (void *pdoc, Node *node);
89 static char *s_chtml20_start_img_tag (void *pdoc, Node *node);
90 static char *s_chtml20_end_img_tag (void *pdoc, Node *node);
91 static char *s_chtml20_start_select_tag (void *pdoc, Node *node);
92 static char *s_chtml20_end_select_tag (void *pdoc, Node *node);
93 static char *s_chtml20_start_option_tag (void *pdoc, Node *node);
94 static char *s_chtml20_end_option_tag (void *pdoc, Node *node);
95 static char *s_chtml20_start_div_tag (void *pdoc, Node *node);
96 static char *s_chtml20_end_div_tag (void *pdoc, Node *node);
97 static char *s_chtml20_start_blockquote_tag(void *pdoc, Node *node);
98 static char *s_chtml20_end_blockquote_tag (void *pdoc, Node *node);
99 static char *s_chtml20_start_dir_tag (void *pdoc, Node *node);
100 static char *s_chtml20_end_dir_tag (void *pdoc, Node *node);
101 static char *s_chtml20_start_dl_tag (void *pdoc, Node *node);
102 static char *s_chtml20_end_dl_tag (void *pdoc, Node *node);
103 static char *s_chtml20_start_dt_tag (void *pdoc, Node *node);
104 static char *s_chtml20_end_dt_tag (void *pdoc, Node *node);
105 static char *s_chtml20_start_dd_tag (void *pdoc, Node *node);
106 static char *s_chtml20_end_dd_tag (void *pdoc, Node *node);
107 static char *s_chtml20_start_menu_tag (void *pdoc, Node *node);
108 static char *s_chtml20_end_menu_tag (void *pdoc, Node *node);
109 static char *s_chtml20_start_plaintext_tag (void *pdoc, Node *node);
110 static char *s_chtml20_start_plaintext_tag_inner (void *pdoc, Node *node);
111 static char *s_chtml20_end_plaintext_tag (void *pdoc, Node *node);
112 static char *s_chtml20_start_blink_tag (void *pdoc, Node *node);
113 static char *s_chtml20_end_blink_tag (void *pdoc, Node *node);
114 static char *s_chtml20_start_marquee_tag (void *pdoc, Node *node);
115 static char *s_chtml20_end_marquee_tag (void *pdoc, Node *node);
116 static char *s_chtml20_newline_mark (void *pdoc, Node *node);
118 static void s_init_chtml20(chtml20_t *chtml, Doc *doc, request_rec *r, device_table *spec);
120 static int s_chtml20_search_emoji(chtml20_t *chtml, char *txt, char **rslt);
122 static char *s_chtml20_chxjif_tag(void *pdoc, Node *node);
123 static char *s_chtml20_text_tag(void *pdoc, Node *node);
126 tag_handler chtml20_handler[] = {
129 s_chtml20_start_html_tag,
130 s_chtml20_end_html_tag,
134 s_chtml20_start_meta_tag,
135 s_chtml20_end_meta_tag,
139 s_chtml20_start_textarea_tag,
140 s_chtml20_end_textarea_tag,
144 s_chtml20_start_p_tag,
149 s_chtml20_start_pre_tag,
150 s_chtml20_end_pre_tag,
154 s_chtml20_start_ul_tag,
155 s_chtml20_end_ul_tag,
159 s_chtml20_start_li_tag,
160 s_chtml20_end_li_tag,
164 s_chtml20_start_ol_tag,
165 s_chtml20_end_ol_tag,
169 s_chtml20_start_h1_tag,
170 s_chtml20_end_h1_tag,
174 s_chtml20_start_h2_tag,
175 s_chtml20_end_h2_tag,
179 s_chtml20_start_h3_tag,
180 s_chtml20_end_h3_tag,
184 s_chtml20_start_h4_tag,
185 s_chtml20_end_h4_tag,
189 s_chtml20_start_h5_tag,
190 s_chtml20_end_h5_tag,
194 s_chtml20_start_h6_tag,
195 s_chtml20_end_h6_tag,
199 s_chtml20_start_head_tag,
200 s_chtml20_end_head_tag,
204 s_chtml20_start_title_tag,
205 s_chtml20_end_title_tag,
209 s_chtml20_start_base_tag,
210 s_chtml20_end_base_tag,
214 s_chtml20_start_body_tag,
215 s_chtml20_end_body_tag,
219 s_chtml20_start_a_tag,
224 s_chtml20_start_br_tag,
225 s_chtml20_end_br_tag,
234 s_chtml20_start_tr_tag,
235 s_chtml20_end_tr_tag,
249 s_chtml20_start_font_tag,
250 s_chtml20_end_font_tag,
254 s_chtml20_start_form_tag,
255 s_chtml20_end_form_tag,
259 s_chtml20_start_input_tag,
260 s_chtml20_end_input_tag,
264 s_chtml20_start_center_tag,
265 s_chtml20_end_center_tag,
269 s_chtml20_start_hr_tag,
270 s_chtml20_end_hr_tag,
274 s_chtml20_start_img_tag,
275 s_chtml20_end_img_tag,
279 s_chtml20_start_select_tag,
280 s_chtml20_end_select_tag,
284 s_chtml20_start_option_tag,
285 s_chtml20_end_option_tag,
289 s_chtml20_start_div_tag,
290 s_chtml20_end_div_tag,
294 s_chtml20_chxjif_tag,
339 s_chtml20_start_dt_tag,
340 s_chtml20_end_dt_tag,
354 s_chtml20_start_blockquote_tag,
355 s_chtml20_end_blockquote_tag,
359 s_chtml20_start_dir_tag,
360 s_chtml20_end_dir_tag,
364 s_chtml20_start_dl_tag,
365 s_chtml20_end_dl_tag,
369 s_chtml20_start_dd_tag,
370 s_chtml20_end_dd_tag,
374 s_chtml20_start_menu_tag,
375 s_chtml20_end_menu_tag,
379 s_chtml20_start_plaintext_tag,
380 s_chtml20_end_plaintext_tag,
384 s_chtml20_start_blink_tag,
385 s_chtml20_end_blink_tag,
389 s_chtml20_start_marquee_tag,
390 s_chtml20_end_marquee_tag,
394 s_chtml20_newline_mark,
400 * converts from CHTML5.0 to CHTML2.0.
402 * @param r [i] Requet_rec is appointed.
403 * @param spec [i] The result of the device specification processing which
404 * was done in advance is appointed.
405 * @param src [i] The character string before the converting is appointed.
406 * @return The character string after the converting is returned.
409 chxj_convert_chtml20(
415 chxjconvrule_entry *entryp,
424 /*--------------------------------------------------------------------------*/
426 /*--------------------------------------------------------------------------*/
428 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
430 DBG(r,"i found qrcode xml");
433 DBG(r,"not found qrcode xml");
435 /*--------------------------------------------------------------------------*/
436 /* The CHTML structure is initialized. */
437 /*--------------------------------------------------------------------------*/
438 s_init_chtml20(&chtml20, &doc, r, spec);
441 chtml20.entryp = entryp;
442 chtml20.cookie = cookie;
444 chxj_set_content_type(r, chxj_header_inf_set_content_type(r, "text/html; charset=Windows-31J"));
446 /*--------------------------------------------------------------------------*/
447 /* The character string of the input is analyzed. */
448 /*--------------------------------------------------------------------------*/
449 qs_init_malloc(&doc);
450 qs_init_root_node(&doc);
452 ss = apr_pcalloc(r->pool, srclen + 1);
453 memset(ss, 0, srclen + 1);
454 memcpy(ss, src, srclen);
457 chxj_dump_out("[src] CHTML -> CHTML2.0", ss, srclen);
460 qs_parse_string(&doc,ss, strlen(ss));
462 chxj_buffered_write_init(r->pool, &doc.buf);
463 /*--------------------------------------------------------------------------*/
464 /* It converts it from CHTML to CHTML. */
465 /*--------------------------------------------------------------------------*/
466 chxj_node_convert(spec,r,(void *)&chtml20, &doc, qs_get_root(&doc), 0);
467 chtml20.out = chxj_buffered_write_flush(chtml20.out, &doc.buf);
468 dst = apr_pstrdup(r->pool, chtml20.out);
469 chxj_buffered_write_terminate(&doc.buf);
471 qs_all_free(&doc,QX_LOGMARK);
474 return apr_pstrdup(r->pool,ss);
477 if (strlen(dst) == 0) {
478 dst = apr_psprintf(r->pool, "\n");
481 *dstlen = strlen(dst);
484 chxj_dump_out("[dst] CHTML -> CHTML2.0", dst, *dstlen);
491 * The CHTML structure is initialized.
493 * @param chtml20 [i/o] The pointer to the HDML structure that wants to be
494 * initialized is specified.
495 * @param doc [i] The Doc structure that should be set to the initialized
496 * HDML structure is specified.
497 * @param r [i] To use POOL, the pointer to request_rec is specified.
498 * @param spec [i] The pointer to the device_table
501 s_init_chtml20(chtml20_t *chtml20, Doc *doc, request_rec *r, device_table *spec)
503 memset(doc, 0, sizeof(Doc));
504 memset(chtml20, 0, sizeof(chtml20_t));
508 chtml20->spec = spec;
509 chtml20->out = qs_alloc_zero_byte_string(r->pool);
510 chtml20->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
512 chtml20->doc->parse_mode = PARSE_MODE_CHTML;
517 * Corresponding EMOJI to a current character-code is retrieved.
518 * The substitution character string is stored in the rslt pointer if agreeing.
520 * @param chtml20 [i] The pointer to the CHTML structure is specified.
521 * @param txt [i] The character string to want to examine whether it is
522 * EMOJI is specified.
523 * @param rslt [o] The pointer to the pointer that stores the result is
525 * @return When corresponding EMOJI exists, it returns it excluding 0.
528 s_chtml20_search_emoji(chtml20_t *chtml20, char *txt, char **rslt)
535 spec = chtml20->spec;
541 DBG(r,"spec is NULL");
543 for (ee = chtml20->conf->emoji;
547 if (ee->imode == NULL) {
548 DBG(r,"emoji->imode is NULL");
552 if (ee->imode->string != NULL
553 && strlen(ee->imode->string) > 0
554 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
555 if (spec == NULL || spec->emoji_type == NULL) {
556 *rslt = apr_palloc(r->pool, 3);
557 (*rslt)[0] = ee->imode->hex1byte & 0xff;
558 (*rslt)[1] = ee->imode->hex2byte & 0xff;
560 return strlen(ee->imode->string);
571 chxj_chtml20_emoji_only_converter(request_rec *r, const char *src, apr_size_t len)
581 chtml20 = &__chtml20;
583 DBG(r, "REQ[%X] start chxj_chtml20_emoji_eonly_converter()", (apr_size_t)(unsigned int)r);
584 memset(doc, 0, sizeof(Doc));
585 memset(chtml20, 0, sizeof(chtml20_t));
589 chtml20->spec = spec;
590 chtml20->out = qs_alloc_zero_byte_string(r->pool);
591 chtml20->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
592 chtml20->doc->parse_mode = PARSE_MODE_CHTML;
594 apr_pool_create(&pool, r->pool);
596 chxj_buffered_write_init(pool, &doc.buf);
598 for (ii=0; ii<len; ii++) {
602 rtn = s_chtml20_search_emoji(chtml20, &src[ii], &out);
609 if (is_sjis_kanji(src[ii])) {
610 two_byte[0] = src[ii+0];
611 two_byte[1] = src[ii+1];
617 one_byte[0] = src[ii+0];
623 DBG(r, "REQ[%X] end chxj_chtml20_emoji_eonly_converter()", (apr_size_t)(unsigned int)r);
629 * It is a handler who processes the HTML tag.
631 * @param pdoc [i/o] The pointer to the CHTML structure at the output
632 * destination is specified.
633 * @param node [i] The HTML tag node is specified.
634 * @return The conversion result is returned.
637 s_chtml20_start_html_tag(void *pdoc, Node *UNUSED(node))
643 chtml20 = GET_CHTML20(pdoc);
647 /*--------------------------------------------------------------------------*/
649 /*--------------------------------------------------------------------------*/
656 * It is a handler who processes the HTML tag.
658 * @param pdoc [i/o] The pointer to the CHTML structure at the output
659 * destination is specified.
660 * @param node [i] The HTML tag node is specified.
661 * @return The conversion result is returned.
664 s_chtml20_end_html_tag(void *pdoc, Node *UNUSED(child))
670 chtml20 = GET_CHTML20(pdoc);
680 * It is a handler who processes the META tag.
682 * @param pdoc [i/o] The pointer to the CHTML structure at the output
683 * destination is specified.
684 * @param node [i] The META tag node is specified.
685 * @return The conversion result is returned.
688 s_chtml20_start_meta_tag(void *pdoc, Node *node)
694 int content_type_flag;
697 chtml20 = GET_CHTML20(pdoc);
701 content_type_flag = 0;
705 /*--------------------------------------------------------------------------*/
707 /*--------------------------------------------------------------------------*/
708 for (attr = qs_get_attr(doc,node);
710 attr = qs_get_next_attr(doc,attr)) {
711 char *name = qs_get_attr_name(doc,attr);
712 char *value = qs_get_attr_value(doc,attr);
716 if (strcasecmp(name, "http-equiv") == 0 && value && *value) {
717 /*----------------------------------------------------------------------*/
719 /*----------------------------------------------------------------------*/
720 W_L(" http-equiv=\"");
723 if (STRCASEEQ('c','C',"content-type", value)) {
724 content_type_flag = 1;
726 if (STRCASEEQ('r','R',"refresh", value)) {
734 if (strcasecmp(name, "content") == 0 && value && *value) {
735 if (content_type_flag) {
739 W_V(chxj_header_inf_set_content_type(r, "text/html; charset=SHIFT_JIS"));
742 else if (refresh_flag) {
743 char *buf = apr_pstrdup(r->pool, value);
747 url = strchr(buf, ';');
749 sec = apr_pstrdup(r->pool, buf);
752 url = chxj_encoding_parameter(r, url);
753 url = chxj_add_cookie_parameter(r, url, chtml20->cookie);
784 * It is a handler who processes the META tag.
786 * @param pdoc [i/o] The pointer to the CHTML structure at the output
787 * destination is specified.
788 * @param node [i] The META tag node is specified.
789 * @return The conversion result is returned.
792 s_chtml20_end_meta_tag(void *pdoc, Node *UNUSED(child))
794 chtml20_t *chtml20 = GET_CHTML20(pdoc);
801 * It is a handler who processes the HEAD tag.
803 * @param pdoc [i/o] The pointer to the CHTML structure at the output
804 * destination is specified.
805 * @param node [i] The HEAD tag node is specified.
806 * @return The conversion result is returned.
809 s_chtml20_start_head_tag(void *pdoc, Node *UNUSED(node))
814 chtml20 = GET_CHTML20(pdoc);
824 * It is a handler who processes the HEAD tag.
826 * @param pdoc [i/o] The pointer to the CHTML structure at the output
827 * destination is specified.
828 * @param node [i] The HEAD tag node is specified.
829 * @return The conversion result is returned.
832 s_chtml20_end_head_tag(void *pdoc, Node *UNUSED(child))
838 chtml20 = GET_CHTML20(pdoc);
849 * It is a handler who processes the TITLE tag.
851 * @param pdoc [i/o] The pointer to the CHTML structure at the output
852 * destination is specified.
853 * @param node [i] The TITLE tag node is specified.
854 * @return The conversion result is returned.
857 s_chtml20_start_title_tag(void *pdoc, Node *UNUSED(node))
863 chtml20 = GET_CHTML20(pdoc);
874 * It is a handler who processes the TITLE tag.
876 * @param pdoc [i/o] The pointer to the CHTML structure at the output
877 * destination is specified.
878 * @param node [i] The TITLE tag node is specified.
879 * @return The conversion result is returned.
882 s_chtml20_end_title_tag(void *pdoc, Node *UNUSED(child))
888 chtml20 = GET_CHTML20(pdoc);
899 * It is a handler who processes the BASE tag.
901 * @param pdoc [i/o] The pointer to the CHTML structure at the output
902 * destination is specified.
903 * @param node [i] The BASE tag node is specified.
904 * @return The conversion result is returned.
907 s_chtml20_start_base_tag(void *pdoc, Node *node)
914 chtml20 = GET_CHTML20(pdoc);
919 /*--------------------------------------------------------------------------*/
921 /*--------------------------------------------------------------------------*/
922 for (attr = qs_get_attr(doc,node);
924 attr = qs_get_next_attr(doc,attr)) {
925 char *name = qs_get_attr_name(doc,attr);
926 char *value = qs_get_attr_value(doc,attr);
927 if (STRCASEEQ('h','H',"href", name)) {
940 * It is a handler who processes the BASE tag.
942 * @param pdoc [i/o] The pointer to the CHTML structure at the output
943 * destination is specified.
944 * @param node [i] The BASE tag node is specified.
945 * @return The conversion result is returned.
948 s_chtml20_end_base_tag(void *pdoc, Node *UNUSED(child))
954 chtml20 = GET_CHTML20(pdoc);
963 * It is a handler who processes the BODY tag.
965 * @param pdoc [i/o] The pointer to the CHTML structure at the output
966 * destination is specified.
967 * @param node [i] The BODY tag node is specified.
968 * @return The conversion result is returned.
971 s_chtml20_start_body_tag(void *pdoc, Node *node)
978 chtml20 = GET_CHTML20(pdoc);
983 /*--------------------------------------------------------------------------*/
985 /*--------------------------------------------------------------------------*/
986 for (attr = qs_get_attr(doc,node);
988 attr = qs_get_next_attr(doc,attr)) {
989 char *name = qs_get_attr_name(doc,attr);
990 char *value = qs_get_attr_value(doc,attr);
994 if (strcasecmp(name, "bgcolor") == 0 && value && *value != 0) {
995 /*----------------------------------------------------------------------*/
997 /*----------------------------------------------------------------------*/
1006 if (strcasecmp(name, "text") == 0 && value && *value != 0) {
1007 /*----------------------------------------------------------------------*/
1009 /*----------------------------------------------------------------------*/
1018 if (strcasecmp(name, "link") == 0 && value && *value != 0) {
1019 /*----------------------------------------------------------------------*/
1021 /*----------------------------------------------------------------------*/
1030 if (strcasecmp(name, "alink") == 0) {
1031 /*----------------------------------------------------------------------*/
1033 /*----------------------------------------------------------------------*/
1040 if (strcasecmp(name, "vlink") == 0) {
1041 /*----------------------------------------------------------------------*/
1043 /*----------------------------------------------------------------------*/
1054 return chtml20->out;
1059 * It is a handler who processes the BODY tag.
1061 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1062 * destination is specified.
1063 * @param node [i] The BODY tag node is specified.
1064 * @return The conversion result is returned.
1067 s_chtml20_end_body_tag(void *pdoc, Node *UNUSED(child))
1073 chtml20 = GET_CHTML20(pdoc);
1079 return chtml20->out;
1084 * It is a handler who processes the A tag.
1086 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1087 * destination is specified.
1088 * @param node [i] The A tag node is specified.
1089 * @return The conversion result is returned.
1092 s_chtml20_start_a_tag(void *pdoc, Node *node)
1099 chtml20 = GET_CHTML20(pdoc);
1104 /*--------------------------------------------------------------------------*/
1105 /* Get Attributes */
1106 /*--------------------------------------------------------------------------*/
1107 for (attr = qs_get_attr(doc,node);
1109 attr = qs_get_next_attr(doc,attr)) {
1110 char *name = qs_get_attr_name(doc,attr);
1111 char *value = qs_get_attr_value(doc,attr);
1115 if (strcasecmp(name, "name") == 0) {
1116 /*--------------------------------------------------------------------*/
1118 /*--------------------------------------------------------------------*/
1127 if (strcasecmp(name, "href") == 0) {
1128 /*--------------------------------------------------------------------*/
1130 /*--------------------------------------------------------------------*/
1131 value = chxj_encoding_parameter(r, value);
1132 if (! chxj_starts_with(value, "mailto:") && ! chxj_starts_with(value, "tel:")) {
1133 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
1143 if (strcasecmp(name, "accesskey") == 0) {
1144 /*--------------------------------------------------------------------*/
1146 /*--------------------------------------------------------------------*/
1147 W_L(" accesskey=\"");
1155 if (strcasecmp(name, "cti") == 0) {
1156 /*--------------------------------------------------------------------*/
1158 /*--------------------------------------------------------------------*/
1167 if (strcasecmp(name, "ijam") == 0) {
1168 /*--------------------------------------------------------------------*/
1170 /*--------------------------------------------------------------------*/
1174 if (strcasecmp(name, "ista") == 0) {
1175 /*--------------------------------------------------------------------*/
1177 /*--------------------------------------------------------------------*/
1181 if (strcasecmp(name, "ilet") == 0) {
1182 /*--------------------------------------------------------------------*/
1184 /*--------------------------------------------------------------------*/
1188 if (strcasecmp(name, "iswf") == 0) {
1189 /*--------------------------------------------------------------------*/
1191 /*--------------------------------------------------------------------*/
1195 if (strcasecmp(name, "irst") == 0) {
1196 /*--------------------------------------------------------------------*/
1198 /*--------------------------------------------------------------------*/
1205 if (strcasecmp(name, "utn") == 0) {
1206 /*--------------------------------------------------------------------*/
1208 /*--------------------------------------------------------------------*/
1215 if (strcasecmp(name, "telbook") == 0) {
1216 /*--------------------------------------------------------------------*/
1218 /*--------------------------------------------------------------------*/
1225 if (strcasecmp(name, "kana") == 0) {
1226 /*--------------------------------------------------------------------*/
1228 /*--------------------------------------------------------------------*/
1235 if (strcasecmp(name, "email") == 0) {
1236 /*--------------------------------------------------------------------*/
1238 /*--------------------------------------------------------------------*/
1248 return chtml20->out;
1253 * It is a handler who processes the A tag.
1255 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1256 * destination is specified.
1257 * @param node [i] The A tag node is specified.
1258 * @return The conversion result is returned.
1261 s_chtml20_end_a_tag(void *pdoc, Node *UNUSED(child))
1267 chtml20 = GET_CHTML20(pdoc);
1273 return chtml20->out;
1278 * It is a handler who processes the BR tag.
1280 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1281 * destination is specified.
1282 * @param node [i] The BR tag node is specified.
1283 * @return The conversion result is returned.
1286 s_chtml20_start_br_tag(void *pdoc, Node *node)
1293 chtml20 = GET_CHTML20(pdoc);
1298 /*--------------------------------------------------------------------------*/
1299 /* Get Attributes */
1300 /*--------------------------------------------------------------------------*/
1301 for (attr = qs_get_attr(doc,node);
1303 attr = qs_get_next_attr(doc,attr)) {
1304 char *name = qs_get_attr_name(doc,attr);
1305 char *value = qs_get_attr_value(doc,attr);
1306 if (STRCASEEQ('c','C',"clear",name)) {
1307 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1316 return chtml20->out;
1321 * It is a handler who processes the BR tag.
1323 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1324 * destination is specified.
1325 * @param node [i] The BR tag node is specified.
1326 * @return The conversion result is returned.
1329 s_chtml20_end_br_tag(void *pdoc, Node *UNUSED(child))
1335 chtml20 = GET_CHTML20(pdoc);
1339 return chtml20->out;
1344 * It is a handler who processes the TR tag.
1346 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1347 * destination is specified.
1348 * @param node [i] The TR tag node is specified.
1349 * @return The conversion result is returned.
1352 s_chtml20_start_tr_tag(void *pdoc, Node *UNUSED(node))
1358 chtml20 = GET_CHTML20(pdoc);
1362 return chtml20->out;
1367 * It is a handler who processes the TR tag.
1369 * @param chtml20 [i/o] The pointer to the CHTML structure at the output
1370 * destination is specified.
1371 * @param node [i] The TR tag node is specified.
1372 * @return The conversion result is returned.
1375 s_chtml20_end_tr_tag(void *pdoc, Node *UNUSED(child))
1381 chtml20 = GET_CHTML20(pdoc);
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_start_font_tag(void *pdoc, Node *node)
1408 chtml20 = GET_CHTML20(pdoc);
1413 /*--------------------------------------------------------------------------*/
1414 /* Get Attributes */
1415 /*--------------------------------------------------------------------------*/
1416 for (attr = qs_get_attr(doc,node);
1417 attr && color == NULL;
1418 attr = qs_get_next_attr(doc,attr)) {
1419 char *name = qs_get_attr_name(doc,attr);
1420 char *value = qs_get_attr_value(doc,attr);
1424 if (strcasecmp(name, "color") == 0 && value && *value) {
1425 color = apr_pstrdup(doc->buf.pool, value);
1431 if (strcasecmp(name, "size") == 0) {
1432 /*--------------------------------------------------------------------*/
1434 /*--------------------------------------------------------------------*/
1444 W_L("<font color=\"");
1447 chtml20->font_flag++;
1449 return chtml20->out;
1454 * It is a handler who processes the FONT tag.
1456 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1457 * destination is specified.
1458 * @param node [i] The FONT tag node is specified.
1459 * @return The conversion result is returned.
1462 s_chtml20_end_font_tag(void *pdoc, Node *UNUSED(child))
1468 chtml20 = GET_CHTML20(pdoc);
1472 if (chtml20->font_flag) {
1474 chtml20->font_flag--;
1476 return chtml20->out;
1481 * It is a handler who processes the FORM tag.
1483 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1484 * destination is specified.
1485 * @param node [i] The FORM tag node is specified.
1486 * @return The conversion result is returned.
1489 s_chtml20_start_form_tag(void *pdoc, Node *node)
1495 char *new_hidden_tag = NULL;
1496 char *attr_method = NULL;
1497 char *attr_action = NULL;
1499 chtml20 = GET_CHTML20(pdoc);
1503 /*--------------------------------------------------------------------------*/
1504 /* Get Attributes */
1505 /*--------------------------------------------------------------------------*/
1506 for (attr = qs_get_attr(doc,node);
1508 attr = qs_get_next_attr(doc,attr)) {
1511 name = qs_get_attr_name(doc,attr);
1512 value = qs_get_attr_value(doc,attr);
1517 if (strcasecmp(name, "action") == 0) {
1518 /*--------------------------------------------------------------------*/
1520 /*--------------------------------------------------------------------*/
1521 attr_action = chxj_encoding_parameter(r, value);
1522 attr_action= chxj_add_cookie_parameter(r, attr_action, chtml20->cookie);
1528 if (strcasecmp(name, "method") == 0) {
1529 /*--------------------------------------------------------------------*/
1531 /*--------------------------------------------------------------------*/
1532 attr_method = apr_pstrdup(doc->pool, value);
1538 if (strcasecmp(name, "utn") == 0) {
1539 /*--------------------------------------------------------------------*/
1541 /*--------------------------------------------------------------------*/
1551 int post_flag = (attr_method && strcasecmp(attr_method, "post") == 0) ? 1 : 0;
1556 char *new_query_string = NULL;
1557 q = strchr(attr_action, '?');
1559 new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 0, post_flag, &new_query_string, CHXJ_TRUE, CHXJ_FALSE, chtml20->entryp);
1560 if (new_hidden_tag || new_query_string) {
1566 if (new_query_string) {
1568 W_V(new_query_string);
1578 if (new_hidden_tag) {
1579 W_V(new_hidden_tag);
1581 return chtml20->out;
1586 * It is a handler who processes the FORM tag.
1588 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1589 * destination is specified.
1590 * @param node [i] The FORM tag node is specified.
1591 * @return The conversion result is returned.
1594 s_chtml20_end_form_tag(void *pdoc, Node *UNUSED(child))
1600 chtml20 = GET_CHTML20(pdoc);
1606 return chtml20->out;
1611 * It is a handler who processes the INPUT tag.
1613 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1614 * destination is specified.
1615 * @param node [i] The INPUT tag node is specified.
1616 * @return The conversion result is returned.
1619 s_chtml20_start_input_tag(void *pdoc, Node *node)
1624 char *max_length = NULL;
1628 char *istyle = NULL;
1630 char *checked = NULL;
1631 char *accesskey = NULL;
1633 chtml20 = GET_CHTML20(pdoc);
1639 /*--------------------------------------------------------------------------*/
1640 /* Get Attributes */
1641 /*--------------------------------------------------------------------------*/
1642 type = qs_get_type_attr(doc, node, doc->buf.pool);
1643 name = qs_get_name_attr(doc, node, doc->buf.pool);
1644 value = qs_get_value_attr(doc,node,doc->buf.pool);
1645 istyle = qs_get_istyle_attr(doc,node,doc->buf.pool);
1646 max_length = qs_get_maxlength_attr(doc,node,doc->buf.pool);
1647 checked = qs_get_checked_attr(doc,node,doc->buf.pool);
1648 accesskey = qs_get_accesskey_attr(doc, node, doc->buf.pool);
1649 size = qs_get_size_attr(doc, node, doc->buf.pool);
1652 type = qs_trim_string(doc->buf.pool, type);
1653 if (type && (STRCASEEQ('t','T',"text", type) ||
1654 STRCASEEQ('p','P',"password",type) ||
1655 STRCASEEQ('c','C',"checkbox",type) ||
1656 STRCASEEQ('r','R',"radio", type) ||
1657 STRCASEEQ('h','H',"hidden", type) ||
1658 STRCASEEQ('s','S',"submit", type) ||
1659 STRCASEEQ('r','R',"reset", type))) {
1665 if (size && *size) {
1670 if (name && *name) {
1675 if (value && *value) {
1677 W_V(chxj_add_slash_to_doublequote(doc->pool, value));
1680 if (accesskey && *accesskey) {
1681 W_L(" accesskey=\"");
1686 /*------------------------------------------------------------------------*/
1688 /*------------------------------------------------------------------------*/
1689 if (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4') {
1695 /*--------------------------------------------------------------------------*/
1696 /* The figure is default for the password. */
1697 /*--------------------------------------------------------------------------*/
1698 if (max_length && *max_length) {
1699 if (chxj_chk_numeric(max_length) != 0) {
1700 max_length = apr_psprintf(doc->buf.pool, "0");
1702 if (istyle && *istyle == '1') {
1703 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length) * 2);
1707 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length));
1716 return chtml20->out;
1721 * It is a handler who processes the INPUT tag.
1723 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1724 * destination is specified.
1725 * @param node [i] The INPUT tag node is specified.
1726 * @return The conversion result is returned.
1729 s_chtml20_end_input_tag(void *pdoc, Node *UNUSED(child))
1735 chtml20 = GET_CHTML20(pdoc);
1739 return chtml20->out;
1744 * It is a handler who processes the CENTER tag.
1746 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1747 * destination is specified.
1748 * @param node [i] The CENTER tag node is specified.
1749 * @return The conversion result is returned.
1752 s_chtml20_start_center_tag(void *pdoc, Node *UNUSED(node))
1758 chtml20 = GET_CHTML20(pdoc);
1763 return chtml20->out;
1768 * It is a handler who processes the CENTER tag.
1770 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1771 * destination is specified.
1772 * @param node [i] The CENTER tag node is specified.
1773 * @return The conversion result is returned.
1776 s_chtml20_end_center_tag(void *pdoc, Node *UNUSED(child))
1782 chtml20 = GET_CHTML20(pdoc);
1788 return chtml20->out;
1793 * It is a handler who processes the UL tag.
1795 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1796 * destination is specified.
1797 * @param node [i] The UL tag node is specified.
1798 * @return The conversion result is returned.
1801 s_chtml20_start_ul_tag(void *pdoc, Node *UNUSED(node))
1807 chtml20 = GET_CHTML20(pdoc);
1813 return chtml20->out;
1818 * It is a handler who processes the UL tag.
1820 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1821 * destination is specified.
1822 * @param node [i] The UL tag node is specified.
1823 * @return The conversion result is returned.
1826 s_chtml20_end_ul_tag(void *pdoc, Node *UNUSED(child))
1832 chtml20 = GET_CHTML20(pdoc);
1838 return chtml20->out;
1843 * It is a handler who processes the OL tag.
1845 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1846 * destination is specified.
1847 * @param node [i] The OL tag node is specified.
1848 * @return The conversion result is returned.
1851 s_chtml20_start_ol_tag(void *pdoc, Node *node)
1858 chtml20 = GET_CHTML20(pdoc);
1863 /*--------------------------------------------------------------------------*/
1864 /* Get Attributes */
1865 /*--------------------------------------------------------------------------*/
1866 for (attr = qs_get_attr(doc,node);
1868 attr = qs_get_next_attr(doc,attr)) {
1869 char *name = qs_get_attr_name(doc,attr);
1870 char *value = qs_get_attr_value(doc,attr);
1871 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
1876 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
1884 return chtml20->out;
1889 * It is a handler who processes the OL tag.
1891 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1892 * destination is specified.
1893 * @param node [i] The OL tag node is specified.
1894 * @return The conversion result is returned.
1897 s_chtml20_end_ol_tag(void *pdoc, Node *UNUSED(child))
1903 chtml20 = GET_CHTML20(pdoc);
1909 return chtml20->out;
1914 * It is a handler who processes the LI tag.
1916 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1917 * destination is specified.
1918 * @param node [i] The LI tag node is specified.
1919 * @return The conversion result is returned.
1922 s_chtml20_start_li_tag(void *pdoc, Node *node)
1929 chtml20 = GET_CHTML20(pdoc);
1934 /*--------------------------------------------------------------------------*/
1935 /* Get Attributes */
1936 /*--------------------------------------------------------------------------*/
1937 for (attr = qs_get_attr(doc,node);
1939 attr = qs_get_next_attr(doc,attr)) {
1940 char *name = qs_get_attr_name(doc,attr);
1941 char *value = qs_get_attr_value(doc,attr);
1942 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
1947 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
1954 return chtml20->out;
1959 * It is a handler who processes the LI tag.
1961 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1962 * destination is specified.
1963 * @param node [i] The LI tag node is specified.
1964 * @return The conversion result is returned.
1967 s_chtml20_end_li_tag(void *pdoc, Node *UNUSED(child))
1969 chtml20_t *chtml20 = GET_CHTML20(pdoc);
1970 return chtml20->out;
1975 * It is a handler who processes the HR tag.
1977 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1978 * destination is specified.
1979 * @param node [i] The HR tag node is specified.
1980 * @return The conversion result is returned.
1983 s_chtml20_start_hr_tag(void *pdoc, Node *node)
1990 chtml20 = GET_CHTML20(pdoc);
1996 for (attr = qs_get_attr(doc,node);
1998 attr = qs_get_next_attr(doc,attr)) {
1999 char *name = qs_get_attr_name(doc,attr);
2000 char *value = qs_get_attr_value(doc,attr);
2004 if (strcasecmp(name, "align") == 0) {
2005 /*--------------------------------------------------------------------*/
2007 /*--------------------------------------------------------------------*/
2008 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2018 if (strcasecmp(name, "size") == 0) {
2019 /*--------------------------------------------------------------------*/
2021 /*--------------------------------------------------------------------*/
2022 if (value && value[0] != '\0') {
2032 if (strcasecmp(name, "width") == 0) {
2033 /*--------------------------------------------------------------------*/
2035 /*--------------------------------------------------------------------*/
2036 if (value && value[0] != '\0') {
2046 if (strcasecmp(name, "noshade") == 0) {
2047 /*--------------------------------------------------------------------*/
2049 /*--------------------------------------------------------------------*/
2056 if (strcasecmp(name, "color") == 0) {
2057 /*--------------------------------------------------------------------*/
2059 /*--------------------------------------------------------------------*/
2069 return chtml20->out;
2074 * It is a handler who processes the HR tag.
2076 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2077 * destination is specified.
2078 * @param node [i] The HR tag node is specified.
2079 * @return The conversion result is returned.
2082 s_chtml20_end_hr_tag(void *pdoc, Node *UNUSED(child))
2084 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2085 return chtml20->out;
2090 * It is a handler who processes the IMG tag.
2092 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2093 * destination is specified.
2094 * @param node [i] The IMG tag node is specified.
2095 * @return The conversion result is returned.
2098 s_chtml20_start_img_tag(void *pdoc, Node *node)
2104 #ifndef IMG_NOT_CONVERT_FILENAME
2108 chtml20 = GET_CHTML20(pdoc);
2112 #ifndef IMG_NOT_CONVERT_FILENAME
2113 spec = chtml20->spec;
2117 /*-------------------------------------------------------------------------*/
2118 /* Get Attributes */
2119 /*-------------------------------------------------------------------------*/
2120 for (attr = qs_get_attr(doc,node);
2122 attr = qs_get_next_attr(doc,attr)) {
2123 char *name = qs_get_attr_name(doc,attr);
2124 char *value = qs_get_attr_value(doc,attr);
2128 if (strcasecmp(name, "src") == 0) {
2129 /*-------------------------------------------------------------------*/
2131 /*-------------------------------------------------------------------*/
2132 #ifdef IMG_NOT_CONVERT_FILENAME
2133 value = chxj_encoding_parameter(r, value);
2134 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
2135 value = chxj_add_cookie_no_update_parameter(r, value);
2140 value = chxj_img_conv(r, spec, value);
2141 value = chxj_encoding_parameter(r, value);
2142 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
2143 value = chxj_add_cookie_no_update_parameter(r, value);
2153 if (strcasecmp(name, "align" ) == 0) {
2154 /*--------------------------------------------------------------------*/
2156 /*--------------------------------------------------------------------*/
2158 if (STRCASEEQ('t','T',"top", value) ||
2159 STRCASEEQ('m','M',"middle",value) ||
2160 STRCASEEQ('b','B',"bottom",value) ||
2161 STRCASEEQ('l','L',"left", value) ||
2162 STRCASEEQ('r','R',"right", value)) {
2167 else if (STRCASEEQ('c','C',"center", value)) {
2174 else if (strcasecmp(name, "alt" ) == 0 && value && *value) {
2175 /*--------------------------------------------------------------------*/
2177 /*--------------------------------------------------------------------*/
2186 if (strcasecmp(name, "width" ) == 0 && value && *value) {
2187 /*--------------------------------------------------------------------*/
2189 /*--------------------------------------------------------------------*/
2198 if (strcasecmp(name, "height") == 0 && value && *value) {
2199 /*--------------------------------------------------------------------*/
2201 /*--------------------------------------------------------------------*/
2206 else if (strcasecmp(name, "hspace") == 0 && value && *value) {
2207 /*--------------------------------------------------------------------*/
2209 /*--------------------------------------------------------------------*/
2218 if (strcasecmp(name, "vspace") == 0 && value && *value) {
2219 /*--------------------------------------------------------------------*/
2221 /*--------------------------------------------------------------------*/
2233 return chtml20->out;
2238 * It is a handler who processes the IMG tag.
2240 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2241 * destination is specified.
2242 * @param node [i] The IMG tag node is specified.
2243 * @return The conversion result is returned.
2246 s_chtml20_end_img_tag(void *pdoc, Node *UNUSED(child))
2248 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2250 return chtml20->out;
2255 * It is a handler who processes the SELECT tag.
2257 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2258 * destination is specified.
2259 * @param node [i] The SELECT tag node is specified.
2260 * @return The conversion result is returned.
2263 s_chtml20_start_select_tag(void *pdoc, Node *child)
2270 chtml20 = GET_CHTML20(pdoc);
2276 char *multiple = NULL;
2279 for (attr = qs_get_attr(doc,child);
2281 attr = qs_get_next_attr(doc,attr)) {
2282 char *nm = qs_get_attr_name(doc,attr);
2283 char *val = qs_get_attr_value(doc,attr);
2287 if (strcasecmp(nm, "size") == 0) {
2288 /*--------------------------------------------------------------------*/
2289 /* CHTML 1.0 version 2.0 */
2290 /*--------------------------------------------------------------------*/
2291 size = apr_pstrdup(doc->buf.pool, val);
2297 if (strcasecmp(nm, "name") == 0) {
2298 /*--------------------------------------------------------------------*/
2299 /* CHTML 1.0 version 2.0 */
2300 /*--------------------------------------------------------------------*/
2301 name = apr_pstrdup(doc->buf.pool, val);
2307 if (strcasecmp(nm, "multiple") == 0) {
2308 /*--------------------------------------------------------------------*/
2309 /* CHTML 1.0 version 2.0 */
2310 /*--------------------------------------------------------------------*/
2311 multiple = apr_pstrdup(doc->buf.pool, val);
2319 if (size && *size) {
2324 if (name && *name) {
2333 return chtml20->out;
2338 * It is a handler who processes the SELECT tag.
2340 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2341 * destination is specified.
2342 * @param node [i] The SELECT tag node is specified.
2343 * @return The conversion result is returned.
2346 s_chtml20_end_select_tag(void *pdoc, Node *UNUSED(child))
2351 chtml20 = GET_CHTML20(pdoc);
2355 return chtml20->out;
2360 * It is a handler who processes the OPTION tag.
2362 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2363 * destination is specified.
2364 * @param node [i] The OPTION tag node is specified.
2365 * @return The conversion result is returned.
2368 s_chtml20_start_option_tag(void *pdoc, Node *child)
2375 chtml20 = GET_CHTML20(pdoc);
2379 char *selected = NULL;
2383 for (attr = qs_get_attr(doc,child);
2385 attr = qs_get_next_attr(doc,attr)) {
2386 char *nm = qs_get_attr_name(doc,attr);
2387 char *val = qs_get_attr_value(doc,attr);
2391 if (strcasecmp(nm, "selected") == 0) {
2392 /*--------------------------------------------------------------------*/
2393 /* CHTML 1.0 version 2.0 */
2394 /*--------------------------------------------------------------------*/
2395 selected = apr_pstrdup(doc->buf.pool, val);
2401 if (strcasecmp(nm, "value") == 0) {
2402 /*--------------------------------------------------------------------*/
2403 /* CHTML 1.0 version 2.0 */
2404 /*--------------------------------------------------------------------*/
2405 value = apr_pstrdup(doc->buf.pool, val);
2424 return chtml20->out;
2429 * It is a handler who processes the OPTION tag.
2431 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2432 * destination is specified.
2433 * @param node [i] The OPTION tag node is specified.
2434 * @return The conversion result is returned.
2437 s_chtml20_end_option_tag(void *pdoc, Node *UNUSED(child))
2439 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2443 return chtml20->out;
2448 * It is a handler who processes the DIV tag.
2450 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2451 * destination is specified.
2452 * @param node [i] The DIV tag node is specified.
2453 * @return The conversion result is returned.
2456 s_chtml20_start_div_tag(void *pdoc, Node *child)
2463 chtml20 = GET_CHTML20(pdoc);
2471 for (attr = qs_get_attr(doc,child);
2473 attr = qs_get_next_attr(doc,attr)) {
2474 char *nm = qs_get_attr_name(doc,attr);
2475 char *val = qs_get_attr_value(doc,attr);
2476 if (STRCASEEQ('a','A', "align", nm)) {
2477 /*----------------------------------------------------------------------*/
2478 /* CHTML 1.0 (W3C version 3.2) */
2479 /*----------------------------------------------------------------------*/
2480 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2481 align = apr_pstrdup(doc->buf.pool, val);
2491 return chtml20->out;
2496 * It is a handler who processes the DIV tag.
2498 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2499 * destination is specified.
2500 * @param node [i] The DIV tag node is specified.
2501 * @return The conversion result is returned.
2504 s_chtml20_end_div_tag(void *pdoc, Node *UNUSED(child))
2506 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2507 Doc *doc = chtml20->doc;
2510 return chtml20->out;
2515 * It is a handler who processes the H1 tag.
2517 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2518 * destination is specified.
2519 * @param node [i] The H1 tag node is specified.
2520 * @return The conversion result is returned.
2523 s_chtml20_start_h1_tag(void *pdoc, Node *node)
2530 chtml20 = GET_CHTML20(pdoc);
2535 for (attr = qs_get_attr(doc,node);
2537 attr = qs_get_next_attr(doc,attr)) {
2538 char *name = qs_get_attr_name(doc,attr);
2539 char *value = qs_get_attr_value(doc,attr);
2540 if (STRCASEEQ('a','A',"align", name)) {
2541 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2550 return chtml20->out;
2555 * It is a handler who processes the H1 tag.
2557 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2558 * destination is specified.
2559 * @param node [i] The H1 tag node is specified.
2560 * @return The conversion result is returned.
2563 s_chtml20_end_h1_tag(void *pdoc, Node *UNUSED(child))
2568 chtml20 = GET_CHTML20(pdoc);
2572 return chtml20->out;
2577 * It is a handler who processes the H2 tag.
2579 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2580 * destination is specified.
2581 * @param node [i] The H2 tag node is specified.
2582 * @return The conversion result is returned.
2585 s_chtml20_start_h2_tag(void *pdoc, Node *node)
2592 chtml20 = GET_CHTML20(pdoc);
2597 for (attr = qs_get_attr(doc,node);
2599 attr = qs_get_next_attr(doc,attr)) {
2600 char *name = qs_get_attr_name(doc,attr);
2601 char *value = qs_get_attr_value(doc,attr);
2602 if (STRCASEEQ('a','A',"align", name)) {
2603 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2612 return chtml20->out;
2617 * It is a handler who processes the H2 tag.
2619 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2620 * destination is specified.
2621 * @param node [i] The H2 tag node is specified.
2622 * @return The conversion result is returned.
2625 s_chtml20_end_h2_tag(void *pdoc, Node *UNUSED(child))
2627 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2628 Doc *doc = chtml20->doc;
2632 return chtml20->out;
2637 * It is a handler who processes the H3 tag.
2639 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2640 * destination is specified.
2641 * @param node [i] The H3 tag node is specified.
2642 * @return The conversion result is returned.
2645 s_chtml20_start_h3_tag(void *pdoc, Node *node)
2652 chtml20 = GET_CHTML20(pdoc);
2657 for (attr = qs_get_attr(doc,node);
2659 attr = qs_get_next_attr(doc,attr)) {
2660 char *name = qs_get_attr_name(doc,attr);
2661 char *value = qs_get_attr_value(doc,attr);
2662 if (STRCASEEQ('a','A',"align", name)) {
2663 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2672 return chtml20->out;
2677 * It is a handler who processes the H3 tag.
2679 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2680 * destination is specified.
2681 * @param node [i] The H3 tag node is specified.
2682 * @return The conversion result is returned.
2685 s_chtml20_end_h3_tag(void *pdoc, Node *UNUSED(child))
2687 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2688 Doc *doc = chtml20->doc;
2691 return chtml20->out;
2696 * It is a handler who processes the H4 tag.
2698 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2699 * destination is specified.
2700 * @param node [i] The H4 tag node is specified.
2701 * @return The conversion result is returned.
2704 s_chtml20_start_h4_tag(void *pdoc, Node *node)
2711 chtml20 = GET_CHTML20(pdoc);
2716 for (attr = qs_get_attr(doc,node);
2718 attr = qs_get_next_attr(doc,attr)) {
2719 char *name = qs_get_attr_name(doc,attr);
2720 char *value = qs_get_attr_value(doc,attr);
2721 if (STRCASEEQ('a','A',"align", name)) {
2722 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2731 return chtml20->out;
2736 * It is a handler who processes the H4 tag.
2738 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2739 * destination is specified.
2740 * @param node [i] The H4 tag node is specified.
2741 * @return The conversion result is returned.
2744 s_chtml20_end_h4_tag(void *pdoc, Node *UNUSED(child))
2746 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2747 Doc *doc = chtml20->doc;
2750 return chtml20->out;
2755 * It is a handler who processes the H5 tag.
2757 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2758 * destination is specified.
2759 * @param node [i] The H5 tag node is specified.
2760 * @return The conversion result is returned.
2763 s_chtml20_start_h5_tag(void *pdoc, Node *node)
2770 chtml20 = GET_CHTML20(pdoc);
2775 for (attr = qs_get_attr(doc,node);
2777 attr = qs_get_next_attr(doc,attr)) {
2778 char *name = qs_get_attr_name(doc,attr);
2779 char *value = qs_get_attr_value(doc,attr);
2780 if (STRCASEEQ('a','A',"align", name)) {
2781 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2790 return chtml20->out;
2795 * It is a handler who processes the H5 tag.
2797 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2798 * destination is specified.
2799 * @param node [i] The H5 tag node is specified.
2800 * @return The conversion result is returned.
2803 s_chtml20_end_h5_tag(void *pdoc, Node *UNUSED(child))
2805 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2806 Doc *doc = chtml20->doc;
2809 return chtml20->out;
2814 * It is a handler who processes the H6 tag.
2816 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2817 * destination is specified.
2818 * @param node [i] The H6 tag node is specified.
2819 * @return The conversion result is returned.
2822 s_chtml20_start_h6_tag(void *pdoc, Node *node)
2829 chtml20 = GET_CHTML20(pdoc);
2834 for (attr = qs_get_attr(doc,node);
2836 attr = qs_get_next_attr(doc,attr)) {
2837 char *name = qs_get_attr_name(doc,attr);
2838 char *value = qs_get_attr_value(doc,attr);
2839 if (STRCASEEQ('a','A',"align", name)) {
2840 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2849 return chtml20->out;
2854 * It is a handler who processes the H6 tag.
2856 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2857 * destination is specified.
2858 * @param node [i] The H6 tag node is specified.
2859 * @return The conversion result is returned.
2862 s_chtml20_end_h6_tag(void *pdoc, Node *UNUSED(child))
2864 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2865 Doc *doc = chtml20->doc;
2868 return chtml20->out;
2873 * It is a handler who processes the PRE tag.
2875 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2876 * destination is specified.
2877 * @param node [i] The PRE tag node is specified.
2878 * @return The conversion result is returned.
2881 s_chtml20_start_pre_tag(void *pdoc, Node *UNUSED(node))
2883 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2884 Doc *doc = chtml20->doc;
2886 chtml20->pre_flag++;
2888 return chtml20->out;
2893 * It is a handler who processes the PRE tag.
2895 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2896 * destination is specified.
2897 * @param node [i] The PRE tag node is specified.
2898 * @return The conversion result is returned.
2901 s_chtml20_end_pre_tag(void *pdoc, Node *UNUSED(child))
2903 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2904 Doc *doc = chtml20->doc;
2907 chtml20->pre_flag--;
2909 return chtml20->out;
2914 * It is a handler who processes the P tag.
2916 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2917 * destination is specified.
2918 * @param node [i] The P tag node is specified.
2919 * @return The conversion result is returned.
2922 s_chtml20_start_p_tag(void *pdoc, Node *node)
2930 chtml20 = GET_CHTML20(pdoc);
2935 for (attr = qs_get_attr(doc,node);
2937 attr = qs_get_next_attr(doc,attr)) {
2938 char *nm = qs_get_attr_name(doc,attr);
2939 char *val = qs_get_attr_value(doc,attr);
2940 if (STRCASEEQ('a','A',"align", nm)) {
2941 /*----------------------------------------------------------------------*/
2942 /* CHTML 1.0 (W3C version 3.2) */
2943 /*----------------------------------------------------------------------*/
2944 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2945 align = apr_pstrdup(doc->buf.pool, val);
2956 return chtml20->out;
2961 * It is a handler who processes the P tag.
2963 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2964 * destination is specified.
2965 * @param node [i] The P tag node is specified.
2966 * @return The conversion result is returned.
2969 s_chtml20_end_p_tag(void *pdoc, Node *UNUSED(child))
2975 chtml20 = GET_CHTML20(pdoc);
2980 return chtml20->out;
2985 s_chtml20_chxjif_tag(void *pdoc, Node *node)
2992 chtml20 = GET_CHTML20(pdoc);
2996 for (child = qs_get_child_node(doc, node);
2998 child = qs_get_next_node(doc, child)) {
3001 s_chtml20_chxjif_tag(pdoc, child);
3009 * It is a handler who processes the TEXTARE tag.
3011 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3012 * destination is specified.
3013 * @param node [i] The TEXTAREA tag node is specified.
3014 * @return The conversion result is returned.
3017 s_chtml20_start_textarea_tag(void *pdoc, Node *node)
3024 chtml20 = GET_CHTML20(pdoc);
3028 chtml20->textarea_flag++;
3030 for (attr = qs_get_attr(doc,node);
3032 attr = qs_get_next_attr(doc,attr)) {
3033 char *name = qs_get_attr_name(doc,attr);
3034 char *value = qs_get_attr_value(doc,attr);
3038 if (strcasecmp(name, "accesskey") == 0 && value && *value != 0) {
3039 W_L(" accesskey=\"");
3047 if (strcasecmp(name, "name") == 0 && value && *value != 0) {
3056 if (strcasecmp(name, "rows") == 0 && value && *value != 0) {
3065 if (strcasecmp(name, "cols") == 0 && value && *value != 0) {
3074 if (strcasecmp(name, "istyle") == 0 && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
3086 return chtml20->out;
3091 * It is a handler who processes the TEXTAREA tag.
3093 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3094 * destination is specified.
3095 * @param node [i] The TEXTAREA tag node is specified.
3096 * @return The conversion result is returned.
3099 s_chtml20_end_textarea_tag(void *pdoc, Node *UNUSED(child))
3101 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3102 Doc *doc = chtml20->doc;
3105 chtml20->textarea_flag--;
3107 return chtml20->out;
3112 s_chtml20_text_tag(void *pdoc, Node *child)
3124 chtml20 = GET_CHTML20(pdoc);
3128 textval = qs_get_node_value(doc,child);
3129 if (strlen(textval) == 0) {
3130 return chtml20->out;
3133 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
3134 memset(tmp, 0, qs_get_node_size(doc,child)+1);
3136 tdst = qs_alloc_zero_byte_string(doc->buf.pool);
3137 memset(one_byte, 0, sizeof(one_byte));
3140 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
3142 int rtn = s_chtml20_search_emoji(chtml20, &textval[ii], &out);
3144 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
3148 if (is_sjis_kanji(textval[ii])) {
3149 one_byte[0] = textval[ii+0];
3150 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3151 one_byte[0] = textval[ii+1];
3152 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3156 if (chtml20->pre_flag) {
3157 one_byte[0] = textval[ii+0];
3158 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3161 if (chtml20->textarea_flag) {
3162 one_byte[0] = textval[ii+0];
3163 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3166 if (textval[ii] != '\r' && textval[ii] != '\n') {
3167 one_byte[0] = textval[ii+0];
3168 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3172 return chtml20->out;
3177 * It is a handler who processes the BLOCKQUOTE tag.
3179 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3180 * destination is specified.
3181 * @param node [i] The BLOCKQUOTE tag node is specified.
3182 * @return The conversion result is returned.
3185 s_chtml20_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
3187 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3188 Doc *doc = chtml20->doc;
3189 W_L("<blockquote>");
3190 return chtml20->out;
3195 * It is a handler who processes the BLOCKQUOTE tag.
3197 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3198 * destination is specified.
3199 * @param node [i] The BLOCKQUOTE tag node is specified.
3200 * @return The conversion result is returned.
3203 s_chtml20_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
3205 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3206 Doc *doc = chtml20->doc;
3207 W_L("</blockquote>");
3208 return chtml20->out;
3213 * It is a handler who processes the DIR tag.
3215 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3216 * destination is specified.
3217 * @param node [i] The DIR tag node is specified.
3218 * @return The conversion result is returned.
3221 s_chtml20_start_dir_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 handler who processes the DIR tag.
3233 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3234 * destination is specified.
3235 * @param node [i] The DIR tag node is specified.
3236 * @return The conversion result is returned.
3239 s_chtml20_end_dir_tag(void *pdoc, Node *UNUSED(child))
3241 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3242 Doc *doc = chtml20->doc;
3245 return chtml20->out;
3250 * It is a handler who processes the DL tag.
3252 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3253 * destination is specified.
3254 * @param node [i] The DL tag node is specified.
3255 * @return The conversion result is returned.
3258 s_chtml20_start_dl_tag(void *pdoc, Node *UNUSED(child))
3260 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3261 Doc *doc = chtml20->doc;
3263 return chtml20->out;
3268 * It is a handler who processes the DL tag.
3270 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3271 * destination is specified.
3272 * @param node [i] The DL tag node is specified.
3273 * @return The conversion result is returned.
3276 s_chtml20_end_dl_tag(void *pdoc, Node *UNUSED(child))
3278 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3279 Doc *doc = chtml20->doc;
3281 return chtml20->out;
3286 * It is a handter who processes the DT tag.
3288 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3289 * destination is specified.
3290 * @param node [i] The DT tag node is specified.
3291 * @return The conversion result is returned.
3294 s_chtml20_start_dt_tag(void *pdoc, Node *UNUSED(child))
3296 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3297 Doc *doc = chtml20->doc;
3299 return chtml20->out;
3304 * It is a handter who processes the DT tag.
3306 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3307 * destination is specified.
3308 * @param node [i] The DT tag node is specified.
3309 * @return The conversion result is returned.
3312 s_chtml20_end_dt_tag(void *pdoc, Node *UNUSED(child))
3314 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3316 return chtml20->out;
3321 * It is a handder who processes the DD tag.
3323 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3324 * destination is specified.
3325 * @param node [i] The DD tag node is specified.
3326 * @return The conversion result is returned.
3329 s_chtml20_start_dd_tag(void *pdoc, Node *UNUSED(child))
3331 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3332 Doc *doc = chtml20->doc;
3334 return chtml20->out;
3339 * It is a handder who processes the DD tag.
3341 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3342 * destination is specified.
3343 * @param node [i] The DD tag node is specified.
3344 * @return The conversion result is returned.
3347 s_chtml20_end_dd_tag(void *pdoc, Node *UNUSED(child))
3349 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3351 return chtml20->out;
3356 * It is a hanmenuer who processes the MENU tag.
3358 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3359 * destination is specified.
3360 * @param node [i] The MENU tag node is specified.
3361 * @return The conversion result is returned.
3364 s_chtml20_start_menu_tag(void *pdoc, Node *UNUSED(child))
3366 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3367 Doc *doc = chtml20->doc;
3370 return chtml20->out;
3375 * It is a hanmenuer who processes the MENU tag.
3377 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3378 * destination is specified.
3379 * @param node [i] The MENU tag node is specified.
3380 * @return The conversion result is returned.
3383 s_chtml20_end_menu_tag(void *pdoc, Node *UNUSED(child))
3385 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3386 Doc *doc = chtml20->doc;
3389 return chtml20->out;
3394 * It is a hanplaintexter who processes the PLAINTEXT tag.
3396 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3397 * destination is specified.
3398 * @param node [i] The PLAINTEXT tag node is specified.
3399 * @return The conversion result is returned.
3402 s_chtml20_start_plaintext_tag(void *pdoc, Node *node)
3404 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3405 Doc *doc = chtml20->doc;
3408 s_chtml20_start_plaintext_tag_inner(pdoc,node);
3409 return chtml20->out;
3413 s_chtml20_start_plaintext_tag_inner(void *pdoc, Node *node)
3415 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3416 Doc *doc = chtml20->doc;
3419 for (child = qs_get_child_node(doc, node);
3421 child = qs_get_next_node(doc, child)) {
3423 s_chtml20_start_plaintext_tag_inner(pdoc, child);
3425 return chtml20->out;
3430 * It is a hanplaintexter who processes the PLAINTEXT tag.
3432 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3433 * destination is specified.
3434 * @param node [i] The PLAINTEXT tag node is specified.
3435 * @return The conversion result is returned.
3438 s_chtml20_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3440 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3441 return chtml20->out;
3445 * It is a hanblinker who processes the BLINK tag.
3447 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3448 * destination is specified.
3449 * @param node [i] The BLINK tag node is specified.
3450 * @return The conversion result is returned.
3453 s_chtml20_start_blink_tag(void *pdoc, Node *UNUSED(child))
3455 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3456 Doc *doc = chtml20->doc;
3458 return chtml20->out;
3463 * It is a hanblinker who processes the BLINK tag.
3465 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3466 * destination is specified.
3467 * @param node [i] The BLINK tag node is specified.
3468 * @return The conversion result is returned.
3471 s_chtml20_end_blink_tag(void *pdoc, Node *UNUSED(child))
3473 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3474 Doc *doc = chtml20->doc;
3476 return chtml20->out;
3481 * It is a hanmarqueeer who processes the MARQUEE tag.
3483 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3484 * destination is specified.
3485 * @param node [i] The MARQUEE tag node is specified.
3486 * @return The conversion result is returned.
3489 s_chtml20_start_marquee_tag(void *pdoc, Node *node)
3491 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3492 Doc *doc = chtml20->doc;
3495 /*--------------------------------------------------------------------------*/
3496 /* Get Attributes */
3497 /*--------------------------------------------------------------------------*/
3498 for (attr = qs_get_attr(doc,node);
3500 attr = qs_get_next_attr(doc,attr)) {
3501 char *name = qs_get_attr_name(doc,attr);
3502 char *value = qs_get_attr_value(doc,attr);
3503 if (STRCASEEQ('d','D',"direction", name)) {
3504 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3505 W_L(" direction=\"");
3510 else if (STRCASEEQ('b','B',"behavior",name)) {
3511 if (value && (STRCASEEQ('s','S',"scroll",value) || STRCASEEQ('s','S',"slide",value) || STRCASEEQ('a','A',"alternate",value))) {
3512 W_L(" behavior=\"");
3517 else if (STRCASEEQ('l','L',"loop",name)) {
3518 if (value && *value) {
3526 return chtml20->out;
3531 * It is a hanmarqueeer who processes the MARQUEE tag.
3533 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3534 * destination is specified.
3535 * @param node [i] The MARQUEE tag node is specified.
3536 * @return The conversion result is returned.
3539 s_chtml20_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3541 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3542 Doc *doc = chtml20->doc;
3544 return chtml20->out;
3549 * * It is handler who processes the New Line Code.
3552 s_chtml20_newline_mark(void *pdoc, Node *UNUSED(node))
3554 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3555 Doc *doc = chtml20->doc;
3557 return chtml20->out;