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.
18 #include "chxj_chtml40.h"
19 #include "chxj_hdml.h"
20 #include "chxj_str_util.h"
21 #include "chxj_dump.h"
22 #include "chxj_img_conv.h"
23 #include "chxj_qr_code.h"
24 #include "chxj_encoding.h"
25 #include "chxj_header_inf.h"
27 #define GET_CHTML40(X) ((chtml40_t *)(X))
30 #define W_L(X) do { chtml40->out = BUFFERED_WRITE_LITERAL(chtml40->out, &doc->buf, (X)); } while(0)
31 #define W_V(X) do { chtml40->out = (X) ? BUFFERED_WRITE_VALUE(chtml40->out, &doc->buf, (X)) \
32 : BUFFERED_WRITE_LITERAL(chtml40->out, &doc->buf, ""); } while(0)
34 #define W_NLCODE() do { char *nlcode = TO_NLCODE(chtml40->conf); W_V(nlcode); } while (0)
36 static char *s_chtml40_start_html_tag (void *pdoc, Node *node);
37 static char *s_chtml40_end_html_tag (void *pdoc, Node *node);
38 static char *s_chtml40_start_meta_tag (void *pdoc, Node *node);
39 static char *s_chtml40_end_meta_tag (void *pdoc, Node *node);
40 static char *s_chtml40_start_textarea_tag (void *pdoc, Node *node);
41 static char *s_chtml40_end_textarea_tag (void *pdoc, Node *node);
42 static char *s_chtml40_start_p_tag (void *pdoc, Node *node);
43 static char *s_chtml40_end_p_tag (void *pdoc, Node *node);
44 static char *s_chtml40_start_pre_tag (void *pdoc, Node *node);
45 static char *s_chtml40_end_pre_tag (void *pdoc, Node *node);
46 static char *s_chtml40_start_h1_tag (void *pdoc, Node *node);
47 static char *s_chtml40_end_h1_tag (void *pdoc, Node *node);
48 static char *s_chtml40_start_h2_tag (void *pdoc, Node *node);
49 static char *s_chtml40_end_h2_tag (void *pdoc, Node *node);
50 static char *s_chtml40_start_h3_tag (void *pdoc, Node *node);
51 static char *s_chtml40_end_h3_tag (void *pdoc, Node *node);
52 static char *s_chtml40_start_h4_tag (void *pdoc, Node *node);
53 static char *s_chtml40_end_h4_tag (void *pdoc, Node *node);
54 static char *s_chtml40_start_h5_tag (void *pdoc, Node *node);
55 static char *s_chtml40_end_h5_tag (void *pdoc, Node *node);
56 static char *s_chtml40_start_h6_tag (void *pdoc, Node *node);
57 static char *s_chtml40_end_h6_tag (void *pdoc, Node *node);
58 static char *s_chtml40_start_ul_tag (void *pdoc, Node *node);
59 static char *s_chtml40_end_ul_tag (void *pdoc, Node *node);
60 static char *s_chtml40_start_ol_tag (void *pdoc, Node *node);
61 static char *s_chtml40_end_ol_tag (void *pdoc, Node *node);
62 static char *s_chtml40_start_li_tag (void *pdoc, Node *node);
63 static char *s_chtml40_end_li_tag (void *pdoc, Node *node);
64 static char *s_chtml40_start_head_tag (void *pdoc, Node *node);
65 static char *s_chtml40_end_head_tag (void *pdoc, Node *node);
66 static char *s_chtml40_start_title_tag (void *pdoc, Node *node);
67 static char *s_chtml40_end_title_tag (void *pdoc, Node *node);
68 static char *s_chtml40_start_base_tag (void *pdoc, Node *node);
69 static char *s_chtml40_end_base_tag (void *pdoc, Node *node);
70 static char *s_chtml40_start_body_tag (void *pdoc, Node *node);
71 static char *s_chtml40_end_body_tag (void *pdoc, Node *node);
72 static char *s_chtml40_start_a_tag (void *pdoc, Node *node);
73 static char *s_chtml40_end_a_tag (void *pdoc, Node *node);
74 static char *s_chtml40_start_br_tag (void *pdoc, Node *node);
75 static char *s_chtml40_end_br_tag (void *pdoc, Node *node);
76 static char *s_chtml40_start_tr_tag (void *pdoc, Node *node);
77 static char *s_chtml40_end_tr_tag (void *pdoc, Node *node);
78 static char *s_chtml40_start_font_tag (void *pdoc, Node *node);
79 static char *s_chtml40_end_font_tag (void *pdoc, Node *node);
80 static char *s_chtml40_start_form_tag (void *pdoc, Node *node);
81 static char *s_chtml40_end_form_tag (void *pdoc, Node *node);
82 static char *s_chtml40_start_input_tag (void *pdoc, Node *node);
83 static char *s_chtml40_end_input_tag (void *pdoc, Node *node);
84 static char *s_chtml40_start_center_tag (void *pdoc, Node *node);
85 static char *s_chtml40_end_center_tag (void *pdoc, Node *node);
86 static char *s_chtml40_start_hr_tag (void *pdoc, Node *node);
87 static char *s_chtml40_end_hr_tag (void *pdoc, Node *node);
88 static char *s_chtml40_start_img_tag (void *pdoc, Node *node);
89 static char *s_chtml40_end_img_tag (void *pdoc, Node *node);
90 static char *s_chtml40_start_select_tag (void *pdoc, Node *node);
91 static char *s_chtml40_end_select_tag (void *pdoc, Node *node);
92 static char *s_chtml40_start_option_tag (void *pdoc, Node *node);
93 static char *s_chtml40_end_option_tag (void *pdoc, Node *node);
94 static char *s_chtml40_start_div_tag (void *pdoc, Node *node);
95 static char *s_chtml40_end_div_tag (void *pdoc, Node *node);
96 static char *s_chtml40_chxjif_tag (void *pdoc, Node *node);
97 static char *s_chtml40_text_tag (void *pdoc, Node *node);
98 static char *s_chtml40_start_blockquote_tag(void *pdoc, Node *node);
99 static char *s_chtml40_end_blockquote_tag (void *pdoc, Node *node);
100 static char *s_chtml40_start_dir_tag (void *pdoc, Node *node);
101 static char *s_chtml40_end_dir_tag (void *pdoc, Node *node);
102 static char *s_chtml40_start_dl_tag (void *pdoc, Node *node);
103 static char *s_chtml40_end_dl_tag (void *pdoc, Node *node);
104 static char *s_chtml40_start_dt_tag (void *pdoc, Node *node);
105 static char *s_chtml40_end_dt_tag (void *pdoc, Node *node);
106 static char *s_chtml40_start_dd_tag (void *pdoc, Node *node);
107 static char *s_chtml40_end_dd_tag (void *pdoc, Node *node);
108 static char *s_chtml40_start_marquee_tag (void *pdoc, Node *node);
109 static char *s_chtml40_end_marquee_tag (void *pdoc, Node *node);
110 static char *s_chtml40_start_blink_tag (void *pdoc, Node *node);
111 static char *s_chtml40_end_blink_tag (void *pdoc, Node *node);
112 static char *s_chtml40_start_menu_tag (void *pdoc, Node *node);
113 static char *s_chtml40_end_menu_tag (void *pdoc, Node *node);
114 static char *s_chtml40_start_plaintext_tag (void *pdoc, Node *node);
115 static char *s_chtml40_start_plaintext_tag_inner (void *pdoc, Node *node);
116 static char *s_chtml40_end_plaintext_tag (void *pdoc, Node *node);
117 static char *s_chtml40_newline_mark (void *pdoc, Node *node);
119 static void s_init_chtml40(chtml40_t *chtml, Doc *doc, request_rec *r, device_table *spec);
121 static int s_chtml40_search_emoji(chtml40_t *chtml, char *txt, char **rslt);
124 tag_handler chtml40_handler[] = {
127 s_chtml40_start_html_tag,
128 s_chtml40_end_html_tag,
132 s_chtml40_start_meta_tag,
133 s_chtml40_end_meta_tag,
137 s_chtml40_start_textarea_tag,
138 s_chtml40_end_textarea_tag,
142 s_chtml40_start_p_tag,
147 s_chtml40_start_pre_tag,
148 s_chtml40_end_pre_tag,
152 s_chtml40_start_ul_tag,
153 s_chtml40_end_ul_tag,
157 s_chtml40_start_li_tag,
158 s_chtml40_end_li_tag,
162 s_chtml40_start_ol_tag,
163 s_chtml40_end_ol_tag,
167 s_chtml40_start_h1_tag,
168 s_chtml40_end_h1_tag,
172 s_chtml40_start_h2_tag,
173 s_chtml40_end_h2_tag,
177 s_chtml40_start_h3_tag,
178 s_chtml40_end_h3_tag,
182 s_chtml40_start_h4_tag,
183 s_chtml40_end_h4_tag,
187 s_chtml40_start_h5_tag,
188 s_chtml40_end_h5_tag,
192 s_chtml40_start_h6_tag,
193 s_chtml40_end_h6_tag,
197 s_chtml40_start_head_tag,
198 s_chtml40_end_head_tag,
202 s_chtml40_start_title_tag,
203 s_chtml40_end_title_tag,
207 s_chtml40_start_base_tag,
208 s_chtml40_end_base_tag,
212 s_chtml40_start_body_tag,
213 s_chtml40_end_body_tag,
217 s_chtml40_start_a_tag,
222 s_chtml40_start_br_tag,
223 s_chtml40_end_br_tag,
232 s_chtml40_start_tr_tag,
233 s_chtml40_end_tr_tag,
247 s_chtml40_start_font_tag,
248 s_chtml40_end_font_tag,
252 s_chtml40_start_form_tag,
253 s_chtml40_end_form_tag,
257 s_chtml40_start_input_tag,
258 s_chtml40_end_input_tag,
262 s_chtml40_start_center_tag,
263 s_chtml40_end_center_tag,
267 s_chtml40_start_hr_tag,
268 s_chtml40_end_hr_tag,
272 s_chtml40_start_img_tag,
273 s_chtml40_end_img_tag,
277 s_chtml40_start_select_tag,
278 s_chtml40_end_select_tag,
282 s_chtml40_start_option_tag,
283 s_chtml40_end_option_tag,
287 s_chtml40_start_div_tag,
288 s_chtml40_end_div_tag,
292 s_chtml40_chxjif_tag,
337 s_chtml40_start_dt_tag,
338 s_chtml40_end_dt_tag,
352 s_chtml40_start_blockquote_tag,
353 s_chtml40_end_blockquote_tag,
357 s_chtml40_start_dir_tag,
358 s_chtml40_end_dir_tag,
362 s_chtml40_start_dl_tag,
363 s_chtml40_end_dl_tag,
367 s_chtml40_start_dd_tag,
368 s_chtml40_end_dd_tag,
372 s_chtml40_start_menu_tag,
373 s_chtml40_end_menu_tag,
377 s_chtml40_start_plaintext_tag,
378 s_chtml40_end_plaintext_tag,
382 s_chtml40_start_blink_tag,
383 s_chtml40_end_blink_tag,
387 s_chtml40_start_marquee_tag,
388 s_chtml40_end_marquee_tag,
392 s_chtml40_newline_mark,
399 * converts from CHTML5.0 to CHTML3.0.
401 * @param r [i] Requet_rec is appointed.
402 * @param spec [i] The result of the device specification processing which
403 * was done in advance is appointed.
404 * @param src [i] The character string before the converting is appointed.
405 * @return The character string after the converting is returned.
408 chxj_convert_chtml40(
414 chxjconvrule_entry *entryp,
423 DBG(r, "start chxj_convert_chtml40()");
425 /*--------------------------------------------------------------------------*/
427 /*--------------------------------------------------------------------------*/
429 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
431 DBG(r,"i found qrcode xml");
432 DBG(r, "end chxj_convert_chtml40()");
435 DBG(r,"not found qrcode xml");
437 /*--------------------------------------------------------------------------*/
438 /* The CHTML structure is initialized. */
439 /*--------------------------------------------------------------------------*/
440 s_init_chtml40(&chtml40, &doc, r, spec);
442 chtml40.entryp = entryp;
443 chtml40.cookie = cookie;
445 chxj_set_content_type(r, chxj_header_inf_set_content_type(r, "text/html; charset=Windows-31J"));
447 /*--------------------------------------------------------------------------*/
448 /* The character string of the input is analyzed. */
449 /*--------------------------------------------------------------------------*/
450 qs_init_malloc(&doc);
451 qs_init_root_node(&doc);
453 ss = apr_pcalloc(r->pool, srclen + 1);
454 memset(ss, 0, srclen + 1);
455 memcpy(ss, src, srclen);
458 chxj_dump_out("[src] CHTML -> CHTML4.0", ss, srclen);
460 chxj_buffered_write_init(r->pool, &doc.buf);
462 qs_parse_string(&doc,ss, strlen(ss));
464 /*--------------------------------------------------------------------------*/
465 /* It converts it from CHTML to CHTML. */
466 /*--------------------------------------------------------------------------*/
467 chxj_node_convert(spec,r,(void*)&chtml40, &doc, qs_get_root(&doc), 0);
468 chtml40.out = chxj_buffered_write_flush(chtml40.out, &doc.buf);
469 dst = apr_pstrdup(r->pool, chtml40.out);
470 chxj_buffered_write_terminate(&doc.buf);
472 qs_all_free(&doc,QX_LOGMARK);
475 dst = 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("[src] CHTML -> CHTML4.0", dst, *dstlen);
487 DBG(r, "end chxj_convert_chtml40()");
493 * The CHTML structure is initialized.
495 * @param chtml40 [i/o] The pointer to the HDML structure that wants to be
496 * initialized is specified.
497 * @param doc [i] The Doc structure that should be set to the initialized
498 * HDML structure is specified.
499 * @param r [i] To use POOL, the pointer to request_rec is specified.
500 * @param spec [i] The pointer to the device_table
503 s_init_chtml40(chtml40_t *chtml40, Doc *doc, request_rec *r, device_table *spec)
505 memset(doc, 0, sizeof(Doc));
506 memset(chtml40, 0, sizeof(chtml40_t));
510 chtml40->spec = spec;
511 chtml40->out = qs_alloc_zero_byte_string(r->pool);
512 chtml40->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
513 chtml40->doc->parse_mode = PARSE_MODE_CHTML;
518 * Corresponding EMOJI to a current character-code is retrieved.
519 * The substitution character string is stored in the rslt pointer if agreeing.
521 * @param chtml40 [i] The pointer to the CHTML structure is specified.
522 * @param txt [i] The character string to want to examine whether it is
523 * EMOJI is specified.
524 * @param rslt [o] The pointer to the pointer that stores the result is
526 * @return When corresponding EMOJI exists, it returns it excluding 0.
529 s_chtml40_search_emoji(chtml40_t *chtml40, char *txt, char **rslt)
536 spec = chtml40->spec;
542 DBG(r,"spec is NULL");
545 for (ee = chtml40->conf->emoji;
548 if (ee->imode == NULL) {
549 DBG(r, "emoji->imode is NULL");
553 if (ee->imode->string != NULL
554 && strlen(ee->imode->string) > 0
555 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
557 if (spec == NULL || spec->emoji_type == NULL) {
558 *rslt = apr_palloc(r->pool, 3);
559 (*rslt)[0] = ee->imode->hex1byte & 0xff;
560 (*rslt)[1] = ee->imode->hex2byte & 0xff;
562 return strlen(ee->imode->string);
574 * It is a handler who processes the HTML tag.
576 * @param pdoc [i/o] The pointer to the CHTML structure at the output
577 * destination is specified.
578 * @param node [i] The HTML tag node is specified.
579 * @return The conversion result is returned.
582 s_chtml40_start_html_tag(void *pdoc, Node *UNUSED(node))
584 chtml40_t *chtml40 = GET_CHTML40(pdoc);
585 Doc *doc = chtml40->doc;
587 /*--------------------------------------------------------------------------*/
589 /*--------------------------------------------------------------------------*/
597 * It is a handler who processes the HTML tag.
599 * @param pdoc [i/o] The pointer to the CHTML structure at the output
600 * destination is specified.
601 * @param node [i] The HTML tag node is specified.
602 * @return The conversion result is returned.
605 s_chtml40_end_html_tag(void *pdoc, Node *UNUSED(child))
607 chtml40_t *chtml40 = GET_CHTML40(pdoc);
608 Doc *doc = chtml40->doc;
616 * It is a handler who processes the META tag.
618 * @param pdoc [i/o] The pointer to the CHTML structure at the output
619 * destination is specified.
620 * @param node [i] The META tag node is specified.
621 * @return The conversion result is returned.
624 s_chtml40_start_meta_tag(void *pdoc, Node *node)
630 int content_type_flag;
633 chtml40 = GET_CHTML40(pdoc);
637 content_type_flag = 0;
641 /*--------------------------------------------------------------------------*/
643 /*--------------------------------------------------------------------------*/
644 for (attr = qs_get_attr(doc,node);
646 attr = qs_get_next_attr(doc,attr)) {
647 char *name = qs_get_attr_name(doc,attr);
648 char *value = qs_get_attr_value(doc,attr);
652 if (strcasecmp(name, "http-equiv") == 0 && value && *value) {
653 /*----------------------------------------------------------------------*/
655 /*----------------------------------------------------------------------*/
656 W_L(" http-equiv=\"");
659 if (STRCASEEQ('c','C',"content-type", value))
660 content_type_flag = 1;
662 if (STRCASEEQ('r','R',"refresh", value))
669 if (strcasecmp(name, "content") == 0 && value && *value) {
670 if (content_type_flag) {
674 W_V(chxj_header_inf_set_content_type(r, "text/html; charset=SHIFT_JIS"));
682 buf = apr_pstrdup(r->pool, value);
683 url = strchr(buf, ';');
685 sec = apr_pstrdup(r->pool, buf);
688 url = chxj_encoding_parameter(r, url);
689 url = chxj_add_cookie_parameter(r, url, chtml40->cookie);
719 * It is a handler who processes the META tag.
721 * @param pdoc [i/o] The pointer to the CHTML structure at the output
722 * destination is specified.
723 * @param node [i] The META tag node is specified.
724 * @return The conversion result is returned.
727 s_chtml40_end_meta_tag(void* pdoc, Node* UNUSED(child))
729 chtml40_t *chtml40 = GET_CHTML40(pdoc);
736 * It is a handler who processes the HEAD tag.
738 * @param pdoc [i/o] The pointer to the CHTML structure at the output
739 * destination is specified.
740 * @param node [i] The HEAD tag node is specified.
741 * @return The conversion result is returned.
744 s_chtml40_start_head_tag(void* pdoc, Node* UNUSED(node))
746 chtml40_t *chtml40 = GET_CHTML40(pdoc);
747 Doc *doc = chtml40->doc;
756 * It is a handler who processes the HEAD tag.
758 * @param pdoc [i/o] The pointer to the CHTML structure at the output
759 * destination is specified.
760 * @param node [i] The HEAD tag node is specified.
761 * @return The conversion result is returned.
764 s_chtml40_end_head_tag(void *pdoc, Node *UNUSED(node))
766 chtml40_t *chtml40 = GET_CHTML40(pdoc);
767 Doc *doc = chtml40->doc;
776 * It is a handler who processes the TITLE tag.
778 * @param pdoc [i/o] The pointer to the CHTML structure at the output
779 * destination is specified.
780 * @param node [i] The TITLE tag node is specified.
781 * @return The conversion result is returned.
784 s_chtml40_start_title_tag(void *pdoc, Node *UNUSED(node))
786 chtml40_t *chtml40 = GET_CHTML40(pdoc);
787 Doc *doc = chtml40->doc;
796 * It is a handler who processes the TITLE tag.
798 * @param pdoc [i/o] The pointer to the CHTML structure at the output
799 * destination is specified.
800 * @param node [i] The TITLE tag node is specified.
801 * @return The conversion result is returned.
804 s_chtml40_end_title_tag(void *pdoc, Node *UNUSED(child))
806 chtml40_t *chtml40 = GET_CHTML40(pdoc);
807 Doc *doc = chtml40->doc;
816 * It is a handler who processes the BASE tag.
818 * @param pdoc [i/o] The pointer to the CHTML structure at the output
819 * destination is specified.
820 * @param node [i] The BASE tag node is specified.
821 * @return The conversion result is returned.
824 s_chtml40_start_base_tag(void *pdoc, Node *node)
831 chtml40 = GET_CHTML40(pdoc);
836 /*--------------------------------------------------------------------------*/
838 /*--------------------------------------------------------------------------*/
839 for (attr = qs_get_attr(doc,node);
841 attr = qs_get_next_attr(doc,attr)) {
842 char *name = qs_get_attr_name(doc,attr);
843 char *value = qs_get_attr_value(doc,attr);
844 if (STRCASEEQ('h','H',"href", name)) {
857 * It is a handler who processes the BASE tag.
859 * @param pdoc [i/o] The pointer to the CHTML structure at the output
860 * destination is specified.
861 * @param node [i] The BASE tag node is specified.
862 * @return The conversion result is returned.
865 s_chtml40_end_base_tag(void *pdoc, Node *UNUSED(child))
867 chtml40_t *chtml40 = GET_CHTML40(pdoc);
874 * It is a handler who processes the BODY tag.
876 * @param pdoc [i/o] The pointer to the CHTML structure at the output
877 * destination is specified.
878 * @param node [i] The BODY tag node is specified.
879 * @return The conversion result is returned.
882 s_chtml40_start_body_tag(void *pdoc, Node *node)
889 chtml40 = GET_CHTML40(pdoc);
894 /*--------------------------------------------------------------------------*/
896 /*--------------------------------------------------------------------------*/
897 for (attr = qs_get_attr(doc,node);
899 attr = qs_get_next_attr(doc,attr)) {
900 char *name = qs_get_attr_name(doc,attr);
901 char *value = qs_get_attr_value(doc,attr);
902 if (STRCASEEQ('b','B', "bgcolor", name) && value && *value) {
903 /*----------------------------------------------------------------------*/
905 /*----------------------------------------------------------------------*/
910 else if (STRCASEEQ('t','T', "text", name) && value && *value) {
911 /*----------------------------------------------------------------------*/
913 /*----------------------------------------------------------------------*/
918 else if (STRCASEEQ('l','L',"link", name) && value && *value) {
919 /*----------------------------------------------------------------------*/
921 /*----------------------------------------------------------------------*/
926 else if (STRCASEEQ('a','A',"alink", name) && value && *value) {
927 /*----------------------------------------------------------------------*/
929 /*----------------------------------------------------------------------*/
934 else if (STRCASEEQ('v','V',"vlink", name) && value && *value) {
935 /*----------------------------------------------------------------------*/
937 /*----------------------------------------------------------------------*/
950 * It is a handler who processes the BODY tag.
952 * @param pdoc [i/o] The pointer to the CHTML structure at the output
953 * destination is specified.
954 * @param node [i] The BODY tag node is specified.
955 * @return The conversion result is returned.
958 s_chtml40_end_body_tag(void *pdoc, Node *UNUSED(child))
963 chtml40 = GET_CHTML40(pdoc);
973 * It is a handler who processes the A tag.
975 * @param pdoc [i/o] The pointer to the CHTML structure at the output
976 * destination is specified.
977 * @param node [i] The A tag node is specified.
978 * @return The conversion result is returned.
981 s_chtml40_start_a_tag(void *pdoc, Node *node)
988 chtml40 = GET_CHTML40(pdoc);
993 /*--------------------------------------------------------------------------*/
995 /*--------------------------------------------------------------------------*/
996 for (attr = qs_get_attr(doc,node);
998 attr = qs_get_next_attr(doc,attr)) {
999 char *name = qs_get_attr_name(doc,attr);
1000 char *value = qs_get_attr_value(doc,attr);
1001 if (STRCASEEQ('n','N',"name", name)) {
1002 /*----------------------------------------------------------------------*/
1004 /*----------------------------------------------------------------------*/
1009 else if (STRCASEEQ('h','H',"href", name)) {
1010 /*----------------------------------------------------------------------*/
1012 /*----------------------------------------------------------------------*/
1013 value = chxj_encoding_parameter(r, value);
1014 if (! chxj_starts_with(value, "mailto:") && ! chxj_starts_with(value, "tel:")) {
1015 value = chxj_add_cookie_parameter(r, value, chtml40->cookie);
1021 else if (STRCASEEQ('a','A',"accesskey", name)) {
1022 /*----------------------------------------------------------------------*/
1024 /*----------------------------------------------------------------------*/
1025 W_L(" accesskey=\"");
1029 else if (STRCASEEQ('c','C',"cti", name)) {
1030 /*----------------------------------------------------------------------*/
1032 /*----------------------------------------------------------------------*/
1037 else if (STRCASEEQ('i','I',"ijam", name)) {
1038 /*----------------------------------------------------------------------*/
1040 /*----------------------------------------------------------------------*/
1043 else if (STRCASEEQ('u','U',"utn", name)) {
1044 /*----------------------------------------------------------------------*/
1046 /* It is special only for CHTML. */
1047 /*----------------------------------------------------------------------*/
1050 else if (STRCASEEQ('t','T',"telbook", name)) {
1051 /*----------------------------------------------------------------------*/
1053 /*----------------------------------------------------------------------*/
1056 else if (STRCASEEQ('k','K',"kana", name)) {
1057 /*----------------------------------------------------------------------*/
1059 /*----------------------------------------------------------------------*/
1062 else if (STRCASEEQ('e','E',"email", name)) {
1063 /*----------------------------------------------------------------------*/
1065 /*----------------------------------------------------------------------*/
1068 else if (STRCASEEQ('i','I',"ista", name)) {
1069 /*----------------------------------------------------------------------*/
1071 /*----------------------------------------------------------------------*/
1074 else if (STRCASEEQ('i','I',"ilet", name)) {
1075 /*----------------------------------------------------------------------*/
1077 /*----------------------------------------------------------------------*/
1080 else if (STRCASEEQ('i','I',"iswf", name)) {
1081 /*----------------------------------------------------------------------*/
1083 /*----------------------------------------------------------------------*/
1086 else if (STRCASEEQ('i','I',"irst", name)) {
1087 /*----------------------------------------------------------------------*/
1089 /*----------------------------------------------------------------------*/
1094 return chtml40->out;
1099 * It is a handler who processes the A tag.
1101 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1102 * destination is specified.
1103 * @param node [i] The A tag node is specified.
1104 * @return The conversion result is returned.
1107 s_chtml40_end_a_tag(void *pdoc, Node *UNUSED(child))
1112 chtml40 = GET_CHTML40(pdoc);
1117 return chtml40->out;
1122 * It is a handler who processes the BR tag.
1124 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1125 * destination is specified.
1126 * @param node [i] The BR tag node is specified.
1127 * @return The conversion result is returned.
1130 s_chtml40_start_br_tag(void *pdoc, Node *node)
1137 chtml40 = GET_CHTML40(pdoc);
1141 /*--------------------------------------------------------------------------*/
1142 /* Get Attributes */
1143 /*--------------------------------------------------------------------------*/
1144 for (attr = qs_get_attr(doc,node);
1146 attr = qs_get_next_attr(doc,attr)) {
1147 char *name = qs_get_attr_name(doc,attr);
1148 char *value = qs_get_attr_value(doc,attr);
1149 if (STRCASEEQ('c','C',"clear",name)) {
1150 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1159 return chtml40->out;
1164 * It is a handler who processes the BR tag.
1166 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1167 * destination is specified.
1168 * @param node [i] The BR tag node is specified.
1169 * @return The conversion result is returned.
1172 s_chtml40_end_br_tag(void *pdoc, Node *UNUSED(child))
1174 chtml40_t *chtml40 = GET_CHTML40(pdoc);
1176 return chtml40->out;
1181 * It is a handler who processes the TR tag.
1183 * @param chtml40 [i/o] The pointer to the CHTML structure at the output
1184 * destination is specified.
1185 * @param node [i] The TR tag node is specified.
1186 * @return The conversion result is returned.
1189 s_chtml40_start_tr_tag(void *pdoc, Node *UNUSED(node))
1191 chtml40_t *chtml40 = GET_CHTML40(pdoc);
1193 return chtml40->out;
1198 * It is a handler who processes the TR tag.
1200 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1201 * destination is specified.
1202 * @param node [i] The TR tag node is specified.
1203 * @return The conversion result is returned.
1206 s_chtml40_end_tr_tag(void *pdoc, Node *UNUSED(child))
1212 chtml40 = GET_CHTML40(pdoc);
1218 return chtml40->out;
1223 * It is a handler who processes the FONT tag.
1225 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1226 * destination is specified.
1227 * @param node [i] The FONT tag node is specified.
1228 * @return The conversion result is returned.
1231 s_chtml40_start_font_tag(void *pdoc, Node *node)
1239 chtml40 = GET_CHTML40(pdoc);
1243 /*--------------------------------------------------------------------------*/
1244 /* Get Attributes */
1245 /*--------------------------------------------------------------------------*/
1246 for (attr = qs_get_attr(doc,node);
1247 attr && color == NULL;
1248 attr = qs_get_next_attr(doc,attr)) {
1249 char *name = qs_get_attr_name(doc,attr);
1250 char *value = qs_get_attr_value(doc,attr);
1251 if (STRCASEEQ('c','C',"color", name) && value && *value) {
1252 color = apr_pstrdup(doc->buf.pool, value);
1255 else if (STRCASEEQ('s','S',"size", name)) {
1256 /*----------------------------------------------------------------------*/
1258 /*----------------------------------------------------------------------*/
1263 W_L("<font color=\"");
1266 chtml40->font_flag++;
1268 return chtml40->out;
1273 * It is a handler who processes the FONT tag.
1275 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1276 * destination is specified.
1277 * @param node [i] The FONT tag node is specified.
1278 * @return The conversion result is returned.
1281 s_chtml40_end_font_tag(void *pdoc, Node *UNUSED(child))
1287 chtml40 = GET_CHTML40(pdoc);
1291 if (chtml40->font_flag) {
1293 chtml40->font_flag--;
1296 return chtml40->out;
1301 * It is a handler who processes the FORM tag.
1303 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1304 * destination is specified.
1305 * @param node [i] The FORM tag node is specified.
1306 * @return The conversion result is returned.
1309 s_chtml40_start_form_tag(void *pdoc, Node *node)
1315 char *new_hidden_tag = NULL;
1316 char *attr_method = NULL;
1317 char *attr_action = NULL;
1318 char *attr_utn = NULL;
1320 chtml40 = GET_CHTML40(pdoc);
1324 /*--------------------------------------------------------------------------*/
1325 /* Get Attributes */
1326 /*--------------------------------------------------------------------------*/
1327 for (attr = qs_get_attr(doc,node);
1329 attr = qs_get_next_attr(doc,attr)) {
1330 char *name = qs_get_attr_name(doc,attr);
1331 char *value = qs_get_attr_value(doc,attr);
1332 if (STRCASEEQ('a','A',"action", name)) {
1333 /*----------------------------------------------------------------------*/
1335 /*----------------------------------------------------------------------*/
1336 attr_action = chxj_encoding_parameter(r, value);
1337 attr_action = chxj_add_cookie_parameter(r, attr_action, chtml40->cookie);
1339 else if (STRCASEEQ('m','M',"method", name)) {
1340 /*----------------------------------------------------------------------*/
1342 /*----------------------------------------------------------------------*/
1343 attr_method = apr_pstrdup(doc->pool, value);
1345 else if (STRCASEEQ('u','U',"utn", name)) {
1346 /*----------------------------------------------------------------------*/
1348 /* It is special only for CHTML. */
1349 /*----------------------------------------------------------------------*/
1354 int post_flag = (attr_method && strcasecmp(attr_method, "post") == 0) ? 1 : 0;
1359 char *new_query_string = NULL;
1360 q = strchr(attr_action, '?');
1362 new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 0, post_flag, &new_query_string, CHXJ_TRUE, CHXJ_FALSE, chtml40->entryp);
1363 if (new_hidden_tag || new_query_string) {
1369 if (new_query_string) {
1371 W_V(new_query_string);
1384 if (new_hidden_tag) {
1385 W_V(new_hidden_tag);
1387 return chtml40->out;
1392 * It is a handler who processes the FORM tag.
1394 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1395 * destination is specified.
1396 * @param node [i] The FORM tag node is specified.
1397 * @return The conversion result is returned.
1400 s_chtml40_end_form_tag(void *pdoc, Node *UNUSED(child))
1405 chtml40 = GET_CHTML40(pdoc);
1410 return chtml40->out;
1415 * It is a handler who processes the INPUT tag.
1417 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1418 * destination is specified.
1419 * @param node [i] The INPUT tag node is specified.
1420 * @return The conversion result is returned.
1423 s_chtml40_start_input_tag(void *pdoc, Node *node)
1428 char *max_length = NULL;
1432 char *istyle = NULL;
1434 char *checked = NULL;
1435 char *accesskey = NULL;
1437 chtml40 = GET_CHTML40(pdoc);
1441 /*--------------------------------------------------------------------------*/
1442 /* Get Attributes */
1443 /*--------------------------------------------------------------------------*/
1444 type = qs_get_type_attr(doc, node, doc->buf.pool);
1445 name = qs_get_name_attr(doc, node, doc->buf.pool);
1446 value = qs_get_value_attr(doc,node, doc->buf.pool);
1447 istyle = qs_get_istyle_attr(doc,node,doc->buf.pool);
1448 max_length = qs_get_maxlength_attr(doc,node,doc->buf.pool);
1449 checked = qs_get_checked_attr(doc,node,doc->buf.pool);
1450 accesskey = qs_get_accesskey_attr(doc, node, doc->buf.pool);
1451 size = qs_get_size_attr(doc, node, doc->buf.pool);
1454 type = qs_trim_string(doc->buf.pool, type);
1455 if (type && (STRCASEEQ('t','T',"text", type) ||
1456 STRCASEEQ('p','P',"password",type) ||
1457 STRCASEEQ('c','C',"checkbox",type) ||
1458 STRCASEEQ('r','R',"radio", type) ||
1459 STRCASEEQ('h','H',"hidden", type) ||
1460 STRCASEEQ('s','S',"submit", type) ||
1461 STRCASEEQ('r','R',"reset", type))) {
1467 if (size && *size) {
1472 if (name && *name) {
1477 if (value && *value) {
1479 W_V(chxj_add_slash_to_doublequote(doc->pool, value));
1482 if (accesskey && *accesskey) {
1483 W_L(" accesskey=\"");
1488 /*------------------------------------------------------------------------*/
1490 /*------------------------------------------------------------------------*/
1491 if (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4') {
1498 /*--------------------------------------------------------------------------*/
1499 /* The figure is default for the password. */
1500 /*--------------------------------------------------------------------------*/
1501 if (max_length && *max_length) {
1502 if (chxj_chk_numeric(max_length) != 0) {
1503 max_length = apr_psprintf(r->pool, "0");
1505 if (istyle != NULL && *istyle == '1') {
1506 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length) * 2);
1510 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length));
1518 return chtml40->out;
1523 * It is a handler who processes the INPUT tag.
1525 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1526 * destination is specified.
1527 * @param node [i] The INPUT tag node is specified.
1528 * @return The conversion result is returned.
1531 s_chtml40_end_input_tag(void *pdoc, Node *UNUSED(child))
1533 chtml40_t *chtml40 = GET_CHTML40(pdoc);
1535 return chtml40->out;
1540 * It is a handler who processes the CENTER tag.
1542 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1543 * destination is specified.
1544 * @param node [i] The CENTER tag node is specified.
1545 * @return The conversion result is returned.
1548 s_chtml40_start_center_tag(void *pdoc, Node *UNUSED(node))
1553 chtml40 = GET_CHTML40(pdoc);
1558 return chtml40->out;
1563 * It is a handler who processes the CENTER tag.
1565 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1566 * destination is specified.
1567 * @param node [i] The CENTER tag node is specified.
1568 * @return The conversion result is returned.
1571 s_chtml40_end_center_tag(void *pdoc, Node *UNUSED(child))
1576 chtml40 = GET_CHTML40(pdoc);
1581 return chtml40->out;
1586 * It is a handler who processes the HR tag.
1588 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1589 * destination is specified.
1590 * @param node [i] The HR tag node is specified.
1591 * @return The conversion result is returned.
1594 s_chtml40_start_hr_tag(void *pdoc, Node *node)
1601 chtml40 = GET_CHTML40(pdoc);
1607 for (attr = qs_get_attr(doc,node);
1609 attr = qs_get_next_attr(doc,attr)) {
1610 char *name = qs_get_attr_name(doc,attr);
1611 char *value = qs_get_attr_value(doc,attr);
1612 if (STRCASEEQ('a','A',"align", name)) {
1613 /*----------------------------------------------------------------------*/
1615 /*----------------------------------------------------------------------*/
1616 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1622 else if (STRCASEEQ('s','S',"size", name)) {
1623 /*----------------------------------------------------------------------*/
1625 /*----------------------------------------------------------------------*/
1626 if (value && *value) {
1632 else if (STRCASEEQ('w','W',"width", name)) {
1633 /*----------------------------------------------------------------------*/
1635 /*----------------------------------------------------------------------*/
1636 if (value && *value) {
1642 else if (STRCASEEQ('n','N',"noshade", name)) {
1643 /*----------------------------------------------------------------------*/
1645 /*----------------------------------------------------------------------*/
1648 else if (STRCASEEQ('c','C',"color", name) && value && *value) {
1649 /*----------------------------------------------------------------------*/
1651 /*----------------------------------------------------------------------*/
1658 return chtml40->out;
1663 * It is a handler who processes the HR tag.
1665 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1666 * destination is specified.
1667 * @param node [i] The HR tag node is specified.
1668 * @return The conversion result is returned.
1671 s_chtml40_end_hr_tag(void *pdoc, Node *UNUSED(child))
1673 chtml40_t *chtml40 = GET_CHTML40(pdoc);
1675 return chtml40->out;
1680 * It is a handler who processes the IMG tag.
1682 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1683 * destination is specified.
1684 * @param node [i] The IMG tag node is specified.
1685 * @return The conversion result is returned.
1688 s_chtml40_start_img_tag(void *pdoc, Node *node)
1690 #ifndef IMG_NOT_CONVERT_FILENAME
1698 chtml40 = GET_CHTML40(pdoc);
1701 #ifndef IMG_NOT_CONVERT_FILENAME
1702 spec = chtml40->spec;
1706 /*--------------------------------------------------------------------------*/
1707 /* Get Attributes */
1708 /*--------------------------------------------------------------------------*/
1709 for (attr = qs_get_attr(doc,node);
1711 attr = qs_get_next_attr(doc,attr)) {
1712 char *name = qs_get_attr_name(doc,attr);
1713 char *value = qs_get_attr_value(doc,attr);
1714 if (STRCASEEQ('s','S',"src", name)) {
1715 /*----------------------------------------------------------------------*/
1717 /*----------------------------------------------------------------------*/
1718 #ifdef IMG_NOT_CONVERT_FILENAME
1719 value = chxj_encoding_parameter(r, value);
1720 value = chxj_add_cookie_parameter(r, value, chtml40->cookie);
1721 value = chxj_add_cookie_no_update_parameter(r, value);
1727 value = chxj_img_conv(r,spec,value);
1728 value = chxj_encoding_parameter(r, value);
1729 value = chxj_add_cookie_parameter(r, value, chtml40->cookie);
1730 value = chxj_add_cookie_no_update_parameter(r, value);
1736 else if (STRCASEEQ('a','A',"align", name)) {
1737 /*----------------------------------------------------------------------*/
1739 /*----------------------------------------------------------------------*/
1740 if (value && (STRCASEEQ('t','T',"top", value) ||
1741 STRCASEEQ('m','M',"middle", value) ||
1742 STRCASEEQ('b','B',"bottom", value) ||
1743 STRCASEEQ('l','L',"left", value) ||
1744 STRCASEEQ('c','C',"center", value) ||
1745 STRCASEEQ('r','R',"right", value))) {
1751 else if (STRCASEEQ('w','W',"width", name) && value && *value) {
1752 /*----------------------------------------------------------------------*/
1754 /*----------------------------------------------------------------------*/
1759 else if (STRCASEEQ('h','H', "height", name) && value && *value) {
1760 /*----------------------------------------------------------------------*/
1762 /*----------------------------------------------------------------------*/
1767 else if (STRCASEEQ('h','H',"hspace", name) && value && *value) {
1768 /*----------------------------------------------------------------------*/
1770 /*----------------------------------------------------------------------*/
1775 else if (STRCASEEQ('v','V',"vspace", name) && value && *value) {
1776 /*----------------------------------------------------------------------*/
1778 /*----------------------------------------------------------------------*/
1783 else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
1784 /*----------------------------------------------------------------------*/
1786 /*----------------------------------------------------------------------*/
1793 return chtml40->out;
1798 * It is a handler who processes the IMG tag.
1800 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1801 * destination is specified.
1802 * @param node [i] The IMG tag node is specified.
1803 * @return The conversion result is returned.
1806 s_chtml40_end_img_tag(void *pdoc, Node *UNUSED(child))
1808 chtml40_t *chtml40 = GET_CHTML40(pdoc);
1810 return chtml40->out;
1815 * It is a handler who processes the SELECT tag.
1817 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1818 * destination is specified.
1819 * @param node [i] The SELECT tag node is specified.
1820 * @return The conversion result is returned.
1823 s_chtml40_start_select_tag(void *pdoc, Node *child)
1825 chtml40_t *chtml40 = GET_CHTML40(pdoc);
1826 Doc *doc = chtml40->doc;
1829 char *multiple = NULL;
1833 for (attr = qs_get_attr(doc,child);
1835 attr = qs_get_next_attr(doc,attr)) {
1836 char *nm = qs_get_attr_name(doc,attr);
1837 char *val = qs_get_attr_value(doc,attr);
1838 if (STRCASEEQ('s','S',"size", nm)) {
1839 /*----------------------------------------------------------------------*/
1840 /* CHTML 1.0 version 2.0 */
1841 /*----------------------------------------------------------------------*/
1842 size = apr_pstrdup(doc->buf.pool, val);
1844 else if (STRCASEEQ('n','N',"name", nm)) {
1845 /*----------------------------------------------------------------------*/
1846 /* CHTML 1.0 version 2.0 */
1847 /*----------------------------------------------------------------------*/
1848 name = apr_pstrdup(doc->buf.pool, val);
1850 else if (STRCASEEQ('m','M',"multiple", nm)) {
1851 /*----------------------------------------------------------------------*/
1852 /* CHTML 1.0 version 2.0 */
1853 /*----------------------------------------------------------------------*/
1854 multiple = apr_pstrdup(doc->buf.pool, val);
1857 if (size && *size) {
1862 if (name && *name) {
1871 return chtml40->out;
1876 * It is a handler who processes the SELECT tag.
1878 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1879 * destination is specified.
1880 * @param node [i] The SELECT tag node is specified.
1881 * @return The conversion result is returned.
1884 s_chtml40_end_select_tag(void *pdoc, Node *UNUSED(child))
1886 chtml40_t *chtml40 = GET_CHTML40(pdoc);
1887 Doc *doc = chtml40->doc;
1890 return chtml40->out;
1895 * It is a handler who processes the OPTION tag.
1897 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1898 * destination is specified.
1899 * @param node [i] The OPTION tag node is specified.
1900 * @return The conversion result is returned.
1903 s_chtml40_start_option_tag(void *pdoc, Node *child)
1912 chtml40 = GET_CHTML40(pdoc);
1919 for (attr = qs_get_attr(doc,child);
1921 attr = qs_get_next_attr(doc,attr)) {
1922 char *nm = qs_get_attr_name(doc,attr);
1923 char *val = qs_get_attr_value(doc,attr);
1924 if (STRCASEEQ('s','S',"selected", nm)) {
1925 /*----------------------------------------------------------------------*/
1926 /* CHTML 1.0 version 2.0 */
1927 /*----------------------------------------------------------------------*/
1928 selected = apr_pstrdup(doc->buf.pool, val);
1930 else if (STRCASEEQ('v','V',"value", nm)) {
1931 /*----------------------------------------------------------------------*/
1932 /* CHTML 1.0 version 2.0 */
1933 /*----------------------------------------------------------------------*/
1934 value = apr_pstrdup(doc->buf.pool, val);
1946 return chtml40->out;
1951 * It is a handler who processes the OPTION tag.
1953 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1954 * destination is specified.
1955 * @param node [i] The OPTION tag node is specified.
1956 * @return The conversion result is returned.
1959 s_chtml40_end_option_tag(void *pdoc, Node *UNUSED(child))
1961 chtml40_t *chtml40 = GET_CHTML40(pdoc);
1965 return chtml40->out;
1970 * It is a handler who processes the DIV tag.
1972 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1973 * destination is specified.
1974 * @param node [i] The DIV tag node is specified.
1975 * @return The conversion result is returned.
1978 s_chtml40_start_div_tag(void *pdoc, Node *child)
1986 chtml40 = GET_CHTML40(pdoc);
1992 for (attr = qs_get_attr(doc,child);
1994 attr = qs_get_next_attr(doc,attr)) {
1995 char *nm = qs_get_attr_name(doc,attr);
1996 char *val = qs_get_attr_value(doc,attr);
1997 if (STRCASEEQ('a','A',"align", nm)) {
1998 /*----------------------------------------------------------------------*/
1999 /* CHTML 1.0 (W3C version 3.2) */
2000 /*----------------------------------------------------------------------*/
2001 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2002 align = apr_pstrdup(doc->buf.pool, val);
2012 return chtml40->out;
2017 * It is a handler who processes the DIV tag.
2019 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2020 * destination is specified.
2021 * @param node [i] The DIV tag node is specified.
2022 * @return The conversion result is returned.
2025 s_chtml40_end_div_tag(void *pdoc, Node *UNUSED(node))
2027 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2028 Doc *doc = chtml40->doc;
2032 return chtml40->out;
2037 * It is a handler who processes the UL tag.
2039 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2040 * destination is specified.
2041 * @param node [i] The UL tag node is specified.
2042 * @return The conversion result is returned.
2045 s_chtml40_start_ul_tag(void *pdoc, Node *node)
2047 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2048 Doc *doc = chtml40->doc;
2051 /*--------------------------------------------------------------------------*/
2052 /* Get Attributes */
2053 /*--------------------------------------------------------------------------*/
2054 for (attr = qs_get_attr(doc,node);
2056 attr = qs_get_next_attr(doc,attr)) {
2057 char *name = qs_get_attr_name(doc,attr);
2058 char *value = qs_get_attr_value(doc,attr);
2059 if (STRCASEEQ('t','T',"type",name)) {
2060 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
2069 return chtml40->out;
2074 * It is a handler who processes the UL tag.
2076 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2077 * destination is specified.
2078 * @param node [i] The UL tag node is specified.
2079 * @return The conversion result is returned.
2082 s_chtml40_end_ul_tag(void *pdoc, Node *UNUSED(child))
2084 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2085 Doc *doc = chtml40->doc;
2089 return chtml40->out;
2094 * It is a handler who processes the PRE tag.
2096 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2097 * destination is specified.
2098 * @param node [i] The PRE tag node is specified.
2099 * @return The conversion result is returned.
2102 s_chtml40_start_pre_tag(void *pdoc, Node *UNUSED(node))
2104 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2105 Doc *doc = chtml40->doc;
2107 chtml40->pre_flag++;
2110 return chtml40->out;
2115 * It is a handler who processes the PRE tag.
2117 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2118 * destination is specified.
2119 * @param node [i] The PRE tag node is specified.
2120 * @return The conversion result is returned.
2123 s_chtml40_end_pre_tag(void *pdoc, Node *UNUSED(child))
2125 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2126 Doc *doc = chtml40->doc;
2129 chtml40->pre_flag--;
2131 return chtml40->out;
2136 * It is a handler who processes the P tag.
2138 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2139 * destination is specified.
2140 * @param node [i] The P tag node is specified.
2141 * @return The conversion result is returned.
2144 s_chtml40_start_p_tag(void *pdoc, Node *node)
2152 chtml40 = GET_CHTML40(pdoc);
2157 for (attr = qs_get_attr(doc,node);
2159 attr = qs_get_next_attr(doc,attr)) {
2160 char *nm = qs_get_attr_name(doc,attr);
2161 char *val = qs_get_attr_value(doc,attr);
2162 if (STRCASEEQ('a','A',"align", nm)) {
2163 /*----------------------------------------------------------------------*/
2164 /* CHTML 1.0 (W3C version 3.2) */
2165 /*----------------------------------------------------------------------*/
2166 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2167 align = apr_pstrdup(doc->buf.pool, val);
2178 return chtml40->out;
2183 * It is a handler who processes the P tag.
2185 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2186 * destination is specified.
2187 * @param node [i] The P tag node is specified.
2188 * @return The conversion result is returned.
2191 s_chtml40_end_p_tag(void *pdoc, Node *UNUSED(child))
2196 chtml40 = GET_CHTML40(pdoc);
2201 return chtml40->out;
2206 * It is a handler who processes the OL tag.
2208 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2209 * destination is specified.
2210 * @param node [i] The OL tag node is specified.
2211 * @return The conversion result is returned.
2214 s_chtml40_start_ol_tag(void *pdoc, Node *node)
2221 chtml40 = GET_CHTML40(pdoc);
2226 /*--------------------------------------------------------------------------*/
2227 /* Get Attributes */
2228 /*--------------------------------------------------------------------------*/
2229 for (attr = qs_get_attr(doc,node);
2231 attr = qs_get_next_attr(doc,attr)) {
2232 char *name = qs_get_attr_name(doc,attr);
2233 char *value = qs_get_attr_value(doc,attr);
2234 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
2239 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
2247 return chtml40->out;
2252 * It is a handler who processes the OL tag.
2254 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2255 * destination is specified.
2256 * @param node [i] The OL tag node is specified.
2257 * @return The conversion result is returned.
2260 s_chtml40_end_ol_tag(void *pdoc, Node *UNUSED(node))
2262 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2263 Doc *doc = chtml40->doc;
2267 return chtml40->out;
2272 * It is a handler who processes the LI tag.
2274 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2275 * destination is specified.
2276 * @param node [i] The LI tag node is specified.
2277 * @return The conversion result is returned.
2280 s_chtml40_start_li_tag(void *pdoc, Node *node)
2282 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2283 Doc *doc = chtml40->doc;
2287 /*--------------------------------------------------------------------------*/
2288 /* Get Attributes */
2289 /*--------------------------------------------------------------------------*/
2290 for (attr = qs_get_attr(doc,node);
2292 attr = qs_get_next_attr(doc,attr)) {
2293 char *name = qs_get_attr_name(doc,attr);
2294 char *value = qs_get_attr_value(doc,attr);
2295 if (STRCASEEQ('t','T',"type",name)) {
2296 if (value && (*value == '1' || *value == 'a' || *value == 'A' || STRCASEEQ('d','D',"disc",value) || STRCASEEQ('s','S',"square",value) || STRCASEEQ('c','C',"circle",value))) {
2302 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
2309 return chtml40->out;
2314 * It is a handler who processes the LI tag.
2316 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2317 * destination is specified.
2318 * @param node [i] The LI tag node is specified.
2319 * @return The conversion result is returned.
2322 s_chtml40_end_li_tag(void *pdoc, Node *UNUSED(child))
2324 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2326 return chtml40->out;
2331 * It is a handler who processes the H1 tag.
2333 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2334 * destination is specified.
2335 * @param node [i] The H1 tag node is specified.
2336 * @return The conversion result is returned.
2339 s_chtml40_start_h1_tag(void *pdoc, Node *node)
2346 chtml40 = GET_CHTML40(pdoc);
2351 for (attr = qs_get_attr(doc,node);
2353 attr = qs_get_next_attr(doc,attr)) {
2354 char *name = qs_get_attr_name(doc,attr);
2355 char *value = qs_get_attr_value(doc,attr);
2356 if (STRCASEEQ('a','A',"align", name)) {
2357 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2367 return chtml40->out;
2372 * It is a handler who processes the H1 tag.
2374 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2375 * destination is specified.
2376 * @param node [i] The H1 tag node is specified.
2377 * @return The conversion result is returned.
2380 s_chtml40_end_h1_tag(void *pdoc, Node *UNUSED(child))
2385 chtml40 = GET_CHTML40(pdoc);
2390 return chtml40->out;
2395 * It is a handler who processes the H2 tag.
2397 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2398 * destination is specified.
2399 * @param node [i] The H2 tag node is specified.
2400 * @return The conversion result is returned.
2403 s_chtml40_start_h2_tag(void *pdoc, Node *node)
2410 chtml40 = GET_CHTML40(pdoc);
2415 for (attr = qs_get_attr(doc,node);
2417 attr = qs_get_next_attr(doc,attr)) {
2418 char *name = qs_get_attr_name(doc,attr);
2419 char *value = qs_get_attr_value(doc,attr);
2420 if (STRCASEEQ('a','A',"align", name)) {
2421 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2430 return chtml40->out;
2435 * It is a handler who processes the H2 tag.
2437 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2438 * destination is specified.
2439 * @param node [i] The H2 tag node is specified.
2440 * @return The conversion result is returned.
2443 s_chtml40_end_h2_tag(void *pdoc, Node *UNUSED(child))
2445 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2446 Doc *doc = chtml40->doc;
2450 return chtml40->out;
2455 * It is a handler who processes the H3 tag.
2457 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2458 * destination is specified.
2459 * @param node [i] The H3 tag node is specified.
2460 * @return The conversion result is returned.
2463 s_chtml40_start_h3_tag(void *pdoc, Node *node)
2470 chtml40 = GET_CHTML40(pdoc);
2475 for (attr = qs_get_attr(doc,node);
2477 attr = qs_get_next_attr(doc,attr)) {
2478 char *name = qs_get_attr_name(doc,attr);
2479 char *value = qs_get_attr_value(doc,attr);
2480 if (STRCASEEQ('a','A',"align", name)) {
2481 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2491 return chtml40->out;
2496 * It is a handler who processes the H3 tag.
2498 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2499 * destination is specified.
2500 * @param node [i] The H3 tag node is specified.
2501 * @return The conversion result is returned.
2504 s_chtml40_end_h3_tag(void *pdoc, Node *UNUSED(child))
2506 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2507 Doc *doc = chtml40->doc;
2511 return chtml40->out;
2516 * It is a handler who processes the H4 tag.
2518 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2519 * destination is specified.
2520 * @param node [i] The H4 tag node is specified.
2521 * @return The conversion result is returned.
2524 s_chtml40_start_h4_tag(void *pdoc, Node *node)
2531 chtml40 = GET_CHTML40(pdoc);
2536 for (attr = qs_get_attr(doc,node);
2538 attr = qs_get_next_attr(doc,attr)) {
2539 char *name = qs_get_attr_name(doc,attr);
2540 char *value = qs_get_attr_value(doc,attr);
2541 if (STRCASEEQ('a','A',"align", name)) {
2542 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2551 return chtml40->out;
2556 * It is a handler who processes the H4 tag.
2558 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2559 * destination is specified.
2560 * @param node [i] The H4 tag node is specified.
2561 * @return The conversion result is returned.
2564 s_chtml40_end_h4_tag(void *pdoc, Node *UNUSED(child))
2566 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2567 Doc *doc = chtml40->doc;
2571 return chtml40->out;
2576 * It is a handler who processes the H5 tag.
2578 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2579 * destination is specified.
2580 * @param node [i] The H5 tag node is specified.
2581 * @return The conversion result is returned.
2584 s_chtml40_start_h5_tag(void *pdoc, Node *node)
2591 chtml40 = GET_CHTML40(pdoc);
2596 for (attr = qs_get_attr(doc,node);
2598 attr = qs_get_next_attr(doc,attr)) {
2599 char *name = qs_get_attr_name(doc,attr);
2600 char *value = qs_get_attr_value(doc,attr);
2601 if (STRCASEEQ('a','A',"align", name)) {
2602 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2611 return chtml40->out;
2616 * It is a handler who processes the H5 tag.
2618 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2619 * destination is specified.
2620 * @param node [i] The H5 tag node is specified.
2621 * @return The conversion result is returned.
2624 s_chtml40_end_h5_tag(void *pdoc, Node *UNUSED(child))
2626 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2627 Doc *doc = chtml40->doc;
2631 return chtml40->out;
2636 * It is a handler who processes the H6 tag.
2638 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2639 * destination is specified.
2640 * @param node [i] The H6 tag node is specified.
2641 * @return The conversion result is returned.
2644 s_chtml40_start_h6_tag(void *pdoc, Node *node)
2651 chtml40 = GET_CHTML40(pdoc);
2656 for (attr = qs_get_attr(doc,node);
2658 attr = qs_get_next_attr(doc,attr)) {
2659 char *name = qs_get_attr_name(doc,attr);
2660 char *value = qs_get_attr_value(doc,attr);
2661 if (STRCASEEQ('a','A',"align", name)) {
2662 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2671 return chtml40->out;
2676 * It is a handler who processes the H6 tag.
2678 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2679 * destination is specified.
2680 * @param node [i] The H6 tag node is specified.
2681 * @return The conversion result is returned.
2684 s_chtml40_end_h6_tag(void *pdoc, Node *UNUSED(child))
2686 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2687 Doc *doc = chtml40->doc;
2691 return chtml40->out;
2696 * It is a handler who processes the TEXTARE tag.
2698 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2699 * destination is specified.
2700 * @param node [i] The TEXTAREA tag node is specified.
2701 * @return The conversion result is returned.
2704 s_chtml40_start_textarea_tag(void *pdoc, Node *node)
2711 chtml40 = GET_CHTML40(pdoc);
2715 chtml40->textarea_flag++;
2718 for (attr = qs_get_attr(doc,node);
2720 attr = qs_get_next_attr(doc,attr)) {
2721 char *name = qs_get_attr_name(doc,attr);
2722 char *value = qs_get_attr_value(doc,attr);
2723 if (STRCASEEQ('a','A',"accesskey",name) && value && *value != 0) {
2724 W_L(" accesskey=\"");
2728 else if (STRCASEEQ('i','I',"istyle", name) && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
2733 else if (STRCASEEQ('n','N',"name", name) && value && *value) {
2738 else if (STRCASEEQ('r','R',"rows", name) && value && *value) {
2743 else if (STRCASEEQ('c','C',"cols", name) && value && *value) {
2750 return chtml40->out;
2755 * It is a handler who processes the TEXTAREA tag.
2757 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2758 * destination is specified.
2759 * @param node [i] The TEXTAREA tag node is specified.
2760 * @return The conversion result is returned.
2763 s_chtml40_end_textarea_tag(void *pdoc, Node *UNUSED(child))
2765 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2766 Doc *doc = chtml40->doc;
2769 chtml40->textarea_flag--;
2771 return chtml40->out;
2776 s_chtml40_chxjif_tag(void *pdoc, Node *node)
2783 chtml40 = GET_CHTML40(pdoc);
2787 for (child = qs_get_child_node(doc, node);
2789 child = qs_get_next_node(doc, child)) {
2791 s_chtml40_chxjif_tag(chtml40, child);
2799 s_chtml40_text_tag(void *pdoc, Node *child)
2812 chtml40 = GET_CHTML40(pdoc);
2816 textval = qs_get_node_value(doc,child);
2817 if (strlen(textval) == 0) {
2818 return chtml40->out;
2821 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
2822 memset(tmp, 0, qs_get_node_size(doc,child)+1);
2824 tdst = qs_alloc_zero_byte_string(doc->buf.pool);
2825 memset(one_byte, 0, sizeof(one_byte));
2828 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
2830 int rtn = s_chtml40_search_emoji(chtml40, &textval[ii], &out);
2832 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
2837 if (is_sjis_kanji(textval[ii])) {
2838 one_byte[0] = textval[ii+0];
2839 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2840 one_byte[0] = textval[ii+1];
2841 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2844 else if (chtml40->pre_flag) {
2845 one_byte[0] = textval[ii+0];
2846 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2848 else if (chtml40->textarea_flag) {
2849 one_byte[0] = textval[ii+0];
2850 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2852 else if (textval[ii] != '\r' && textval[ii] != '\n') {
2853 one_byte[0] = textval[ii+0];
2854 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2858 return chtml40->out;
2863 * It is a handler who processes the BLOCKQUOTE tag.
2865 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2866 * destination is specified.
2867 * @param node [i] The BLOCKQUOTE tag node is specified.
2868 * @return The conversion result is returned.
2871 s_chtml40_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
2873 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2874 Doc *doc = chtml40->doc;
2875 W_L("<blockquote>");
2876 return chtml40->out;
2881 * It is a handler who processes the BLOCKQUOTE tag.
2883 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2884 * destination is specified.
2885 * @param node [i] The BLOCKQUOTE tag node is specified.
2886 * @return The conversion result is returned.
2889 s_chtml40_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
2891 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2892 Doc *doc = chtml40->doc;
2893 W_L("</blockquote>");
2894 return chtml40->out;
2899 * It is a handler who processes the DIR tag.
2901 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2902 * destination is specified.
2903 * @param node [i] The DIR tag node is specified.
2904 * @return The conversion result is returned.
2907 s_chtml40_start_dir_tag(void *pdoc, Node *node)
2909 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2910 Doc *doc = chtml40->doc;
2913 for (attr = qs_get_attr(doc,node);
2915 attr = qs_get_next_attr(doc,attr)) {
2916 char *name = qs_get_attr_name(doc,attr);
2917 char *value = qs_get_attr_value(doc,attr);
2918 if (STRCASEEQ('t','T',"type",name)) {
2919 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
2927 return chtml40->out;
2932 * It is a handler who processes the DIR tag.
2934 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2935 * destination is specified.
2936 * @param node [i] The DIR tag node is specified.
2937 * @return The conversion result is returned.
2940 s_chtml40_end_dir_tag(void *pdoc, Node *UNUSED(child))
2942 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2943 Doc *doc = chtml40->doc;
2945 return chtml40->out;
2950 * It is a handler who processes the DL tag.
2952 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2953 * destination is specified.
2954 * @param node [i] The DL tag node is specified.
2955 * @return The conversion result is returned.
2958 s_chtml40_start_dl_tag(void *pdoc, Node *UNUSED(child))
2960 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2961 Doc *doc = chtml40->doc;
2963 return chtml40->out;
2968 * It is a handler who processes the DL tag.
2970 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2971 * destination is specified.
2972 * @param node [i] The DL tag node is specified.
2973 * @return The conversion result is returned.
2976 s_chtml40_end_dl_tag(void *pdoc, Node *UNUSED(child))
2978 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2979 Doc *doc = chtml40->doc;
2981 return chtml40->out;
2986 * It is a handler who processes the DT tag.
2988 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2989 * destination is specified.
2990 * @param node [i] The DT tag node is specified.
2991 * @return The conversion result is returned.
2994 s_chtml40_start_dt_tag(void *pdoc, Node *UNUSED(child))
2996 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2997 Doc *doc = chtml40->doc;
2999 return chtml40->out;
3004 * It is a handler who processes the DT tag.
3006 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3007 * destination is specified.
3008 * @param node [i] The DT tag node is specified.
3009 * @return The conversion result is returned.
3012 s_chtml40_end_dt_tag(void *pdoc, Node *UNUSED(child))
3014 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3016 return chtml40->out;
3021 * It is a handler who processes the DD tag.
3023 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3024 * destination is specified.
3025 * @param node [i] The DD tag node is specified.
3026 * @return The conversion result is returned.
3029 s_chtml40_start_dd_tag(void *pdoc, Node *UNUSED(child))
3031 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3032 Doc *doc = chtml40->doc;
3036 return chtml40->out;
3041 * It is a handler who processes the DD tag.
3043 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3044 * destination is specified.
3045 * @param node [i] The DD tag node is specified.
3046 * @return The conversion result is returned.
3049 s_chtml40_end_dd_tag(void *pdoc, Node *UNUSED(child))
3051 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3053 return chtml40->out;
3058 * It is a handler who processes the MARQUEE tag.
3060 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3061 * destination is specified.
3062 * @param node [i] The MARQUEE tag node is specified.
3063 * @return The conversion result is returned.
3066 s_chtml40_start_marquee_tag(void *pdoc, Node *node)
3068 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3069 Doc *doc = chtml40->doc;
3072 /*--------------------------------------------------------------------------*/
3073 /* Get Attributes */
3074 /*--------------------------------------------------------------------------*/
3075 for (attr = qs_get_attr(doc,node);
3077 attr = qs_get_next_attr(doc,attr)) {
3078 char *name = qs_get_attr_name(doc,attr);
3079 char *value = qs_get_attr_value(doc,attr);
3080 if (STRCASEEQ('d','D',"direction", name)) {
3081 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3082 W_L(" direction=\"");
3087 else if (STRCASEEQ('b','B',"behavior",name)) {
3088 if (value && (STRCASEEQ('s','S',"scroll",value) || STRCASEEQ('s','S',"slide",value) || STRCASEEQ('a','A',"alternate",value))) {
3089 W_L(" behavior=\"");
3094 else if (STRCASEEQ('l','L',"loop",name)) {
3095 if (value && *value) {
3103 return chtml40->out;
3108 * It is a handler who processes the MARQUEE tag.
3110 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3111 * destination is specified.
3112 * @param node [i] The MARQUEE tag node is specified.
3113 * @return The conversion result is returned.
3116 s_chtml40_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3118 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3119 Doc *doc = chtml40->doc;
3121 return chtml40->out;
3126 * It is a handler who processes the BLINK tag.
3128 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3129 * destination is specified.
3130 * @param node [i] The BLINK tag node is specified.
3131 * @return The conversion result is returned.
3134 s_chtml40_start_blink_tag(void *pdoc, Node *UNUSED(child))
3136 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3137 Doc *doc = chtml40->doc;
3139 return chtml40->out;
3144 * It is a handler who processes the BLINK tag.
3146 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3147 * destination is specified.
3148 * @param node [i] The BLINK tag node is specified.
3149 * @return The conversion result is returned.
3152 s_chtml40_end_blink_tag(void *pdoc, Node *UNUSED(child))
3154 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3155 Doc *doc = chtml40->doc;
3157 return chtml40->out;
3162 * It is a handler who processes the MENU tag.
3164 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3165 * destination is specified.
3166 * @param node [i] The MENU tag node is specified.
3167 * @return The conversion result is returned.
3170 s_chtml40_start_menu_tag(void *pdoc, Node *node)
3172 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3173 Doc *doc = chtml40->doc;
3176 /*--------------------------------------------------------------------------*/
3177 /* Get Attributes */
3178 /*--------------------------------------------------------------------------*/
3179 for (attr = qs_get_attr(doc,node);
3181 attr = qs_get_next_attr(doc,attr)) {
3182 char *name = qs_get_attr_name(doc,attr);
3183 char *value = qs_get_attr_value(doc,attr);
3184 if (STRCASEEQ('t','T',"type",name)) {
3185 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
3193 return chtml40->out;
3198 * It is a handler who processes the MENU tag.
3200 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3201 * destination is specified.
3202 * @param node [i] The MENU tag node is specified.
3203 * @return The conversion result is returned.
3206 s_chtml40_end_menu_tag(void *pdoc, Node *UNUSED(child))
3208 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3209 Doc *doc = chtml40->doc;
3211 return chtml40->out;
3216 * It is a handler who processes the PLAINTEXT tag.
3218 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3219 * destination is specified.
3220 * @param node [i] The PLAINTEXT tag node is specified.
3221 * @return The conversion result is returned.
3224 s_chtml40_start_plaintext_tag(void *pdoc, Node *node)
3226 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3227 Doc *doc = chtml40->doc;
3229 s_chtml40_start_plaintext_tag_inner(pdoc,node);
3230 return chtml40->out;
3234 s_chtml40_start_plaintext_tag_inner(void *pdoc, Node *node)
3236 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3237 Doc *doc = chtml40->doc;
3239 for (child = qs_get_child_node(doc, node);
3241 child = qs_get_next_node(doc, child)) {
3243 s_chtml40_start_plaintext_tag_inner(pdoc, child);
3245 return chtml40->out;
3250 * It is a handler who processes the PLAINTEXT tag.
3252 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3253 * destination is specified.
3254 * @param node [i] The PLAINTEXT tag node is specified.
3255 * @return The conversion result is returned.
3258 s_chtml40_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3260 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3261 return chtml40->out;
3266 * * It is handler who processes the New Line Code.
3269 s_chtml40_newline_mark(void *pdoc, Node *UNUSED(node))
3271 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3272 Doc *doc = chtml40->doc;
3274 return chtml40->out;