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_chtml30.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_CHTML30(X) ((chtml30_t *)(X))
30 #define W_L(X) do { chtml30->out = BUFFERED_WRITE_LITERAL(chtml30->out, &doc->buf, (X)); } while(0)
31 #define W_V(X) do { chtml30->out = (X) ? BUFFERED_WRITE_VALUE(chtml30->out, &doc->buf, (X)) \
32 : BUFFERED_WRITE_LITERAL(chtml30->out, &doc->buf, ""); } while(0)
34 #define W_NLCODE() do { char *nlcode = TO_NLCODE(chtml30->conf); W_V(nlcode); } while (0)
36 static char *s_chtml30_start_html_tag (void *pdoc, Node *node);
37 static char *s_chtml30_end_html_tag (void *pdoc, Node *node);
38 static char *s_chtml30_start_meta_tag (void *pdoc, Node *node);
39 static char *s_chtml30_end_meta_tag (void *pdoc, Node *node);
40 static char *s_chtml30_start_textarea_tag (void *pdoc, Node *node);
41 static char *s_chtml30_end_textarea_tag (void *pdoc, Node *node);
42 static char *s_chtml30_start_p_tag (void *pdoc, Node *node);
43 static char *s_chtml30_end_p_tag (void *pdoc, Node *node);
44 static char *s_chtml30_start_pre_tag (void *pdoc, Node *node);
45 static char *s_chtml30_end_pre_tag (void *pdoc, Node *node);
46 static char *s_chtml30_start_h1_tag (void *pdoc, Node *node);
47 static char *s_chtml30_end_h1_tag (void *pdoc, Node *node);
48 static char *s_chtml30_start_h2_tag (void *pdoc, Node *node);
49 static char *s_chtml30_end_h2_tag (void *pdoc, Node *node);
50 static char *s_chtml30_start_h3_tag (void *pdoc, Node *node);
51 static char *s_chtml30_end_h3_tag (void *pdoc, Node *node);
52 static char *s_chtml30_start_h4_tag (void *pdoc, Node *node);
53 static char *s_chtml30_end_h4_tag (void *pdoc, Node *node);
54 static char *s_chtml30_start_h5_tag (void *pdoc, Node *node);
55 static char *s_chtml30_end_h5_tag (void *pdoc, Node *node);
56 static char *s_chtml30_start_h6_tag (void *pdoc, Node *node);
57 static char *s_chtml30_end_h6_tag (void *pdoc, Node *node);
58 static char *s_chtml30_start_ul_tag (void *pdoc, Node *node);
59 static char *s_chtml30_end_ul_tag (void *pdoc, Node *node);
60 static char *s_chtml30_start_ol_tag (void *pdoc, Node *node);
61 static char *s_chtml30_end_ol_tag (void *pdoc, Node *node);
62 static char *s_chtml30_start_li_tag (void *pdoc, Node *node);
63 static char *s_chtml30_end_li_tag (void *pdoc, Node *node);
64 static char *s_chtml30_start_head_tag (void *pdoc, Node *node);
65 static char *s_chtml30_end_head_tag (void *pdoc, Node *node);
66 static char *s_chtml30_start_title_tag (void *pdoc, Node *node);
67 static char *s_chtml30_end_title_tag (void *pdoc, Node *node);
68 static char *s_chtml30_start_base_tag (void *pdoc, Node *node);
69 static char *s_chtml30_end_base_tag (void *pdoc, Node *node);
70 static char *s_chtml30_start_body_tag (void *pdoc, Node *node);
71 static char *s_chtml30_end_body_tag (void *pdoc, Node *node);
72 static char *s_chtml30_start_a_tag (void *pdoc, Node *node);
73 static char *s_chtml30_end_a_tag (void *pdoc, Node *node);
74 static char *s_chtml30_start_br_tag (void *pdoc, Node *node);
75 static char *s_chtml30_end_br_tag (void *pdoc, Node *node);
76 static char *s_chtml30_start_tr_tag (void *pdoc, Node *node);
77 static char *s_chtml30_end_tr_tag (void *pdoc, Node *node);
78 static char *s_chtml30_start_font_tag (void *pdoc, Node *node);
79 static char *s_chtml30_end_font_tag (void *pdoc, Node *node);
80 static char *s_chtml30_start_form_tag (void *pdoc, Node *node);
81 static char *s_chtml30_end_form_tag (void *pdoc, Node *node);
82 static char *s_chtml30_start_input_tag (void *pdoc, Node *node);
83 static char *s_chtml30_end_input_tag (void *pdoc, Node *node);
84 static char *s_chtml30_start_center_tag (void *pdoc, Node *node);
85 static char *s_chtml30_end_center_tag (void *pdoc, Node *node);
86 static char *s_chtml30_start_hr_tag (void *pdoc, Node *node);
87 static char *s_chtml30_end_hr_tag (void *pdoc, Node *node);
88 static char *s_chtml30_start_img_tag (void *pdoc, Node *node);
89 static char *s_chtml30_end_img_tag (void *pdoc, Node *node);
90 static char *s_chtml30_start_select_tag (void *pdoc, Node *node);
91 static char *s_chtml30_end_select_tag (void *pdoc, Node *node);
92 static char *s_chtml30_start_option_tag (void *pdoc, Node *node);
93 static char *s_chtml30_end_option_tag (void *pdoc, Node *node);
94 static char *s_chtml30_start_div_tag (void *pdoc, Node *node);
95 static char *s_chtml30_end_div_tag (void *pdoc, Node *node);
96 static char *s_chtml30_chxjif_tag (void *pdoc, Node *node);
97 static char *s_chtml30_text_tag (void *pdoc, Node *node);
98 static char *s_chtml30_start_blockquote_tag(void *pdoc, Node *node);
99 static char *s_chtml30_end_blockquote_tag (void *pdoc, Node *node);
100 static char *s_chtml30_start_dir_tag (void *pdoc, Node *node);
101 static char *s_chtml30_end_dir_tag (void *pdoc, Node *node);
102 static char *s_chtml30_start_dl_tag (void *pdoc, Node *node);
103 static char *s_chtml30_end_dl_tag (void *pdoc, Node *node);
104 static char *s_chtml30_start_dt_tag (void *pdoc, Node *node);
105 static char *s_chtml30_end_dt_tag (void *pdoc, Node *node);
106 static char *s_chtml30_start_dd_tag (void *pdoc, Node *node);
107 static char *s_chtml30_end_dd_tag (void *pdoc, Node *node);
108 static char *s_chtml30_start_marquee_tag (void *pdoc, Node *node);
109 static char *s_chtml30_end_marquee_tag (void *pdoc, Node *node);
110 static char *s_chtml30_start_blink_tag (void *pdoc, Node *node);
111 static char *s_chtml30_end_blink_tag (void *pdoc, Node *node);
112 static char *s_chtml30_start_menu_tag (void *pdoc, Node *node);
113 static char *s_chtml30_end_menu_tag (void *pdoc, Node *node);
114 static char *s_chtml30_start_plaintext_tag (void *pdoc, Node *node);
115 static char *s_chtml30_start_plaintext_tag_inner (void *pdoc, Node *node);
116 static char *s_chtml30_end_plaintext_tag (void *pdoc, Node *node);
117 static char *s_chtml30_newline_mark (void *pdoc, Node *node);
119 static void s_init_chtml30(chtml30_t *chtml, Doc *doc, request_rec *r, device_table *spec);
121 static int s_chtml30_search_emoji(chtml30_t *chtml, char *txt, char **rslt);
124 tag_handler chtml30_handler[] = {
127 s_chtml30_start_html_tag,
128 s_chtml30_end_html_tag,
132 s_chtml30_start_meta_tag,
133 s_chtml30_end_meta_tag,
137 s_chtml30_start_textarea_tag,
138 s_chtml30_end_textarea_tag,
142 s_chtml30_start_p_tag,
147 s_chtml30_start_pre_tag,
148 s_chtml30_end_pre_tag,
152 s_chtml30_start_ul_tag,
153 s_chtml30_end_ul_tag,
157 s_chtml30_start_li_tag,
158 s_chtml30_end_li_tag,
162 s_chtml30_start_ol_tag,
163 s_chtml30_end_ol_tag,
167 s_chtml30_start_h1_tag,
168 s_chtml30_end_h1_tag,
172 s_chtml30_start_h2_tag,
173 s_chtml30_end_h2_tag,
177 s_chtml30_start_h3_tag,
178 s_chtml30_end_h3_tag,
182 s_chtml30_start_h4_tag,
183 s_chtml30_end_h4_tag,
187 s_chtml30_start_h5_tag,
188 s_chtml30_end_h5_tag,
192 s_chtml30_start_h6_tag,
193 s_chtml30_end_h6_tag,
197 s_chtml30_start_head_tag,
198 s_chtml30_end_head_tag,
202 s_chtml30_start_title_tag,
203 s_chtml30_end_title_tag,
207 s_chtml30_start_base_tag,
208 s_chtml30_end_base_tag,
212 s_chtml30_start_body_tag,
213 s_chtml30_end_body_tag,
217 s_chtml30_start_a_tag,
222 s_chtml30_start_br_tag,
223 s_chtml30_end_br_tag,
232 s_chtml30_start_tr_tag,
233 s_chtml30_end_tr_tag,
247 s_chtml30_start_font_tag,
248 s_chtml30_end_font_tag,
252 s_chtml30_start_form_tag,
253 s_chtml30_end_form_tag,
257 s_chtml30_start_input_tag,
258 s_chtml30_end_input_tag,
262 s_chtml30_start_center_tag,
263 s_chtml30_end_center_tag,
267 s_chtml30_start_hr_tag,
268 s_chtml30_end_hr_tag,
272 s_chtml30_start_img_tag,
273 s_chtml30_end_img_tag,
277 s_chtml30_start_select_tag,
278 s_chtml30_end_select_tag,
282 s_chtml30_start_option_tag,
283 s_chtml30_end_option_tag,
287 s_chtml30_start_div_tag,
288 s_chtml30_end_div_tag,
292 s_chtml30_chxjif_tag,
337 s_chtml30_start_dt_tag,
338 s_chtml30_end_dt_tag,
352 s_chtml30_start_blockquote_tag,
353 s_chtml30_end_blockquote_tag,
357 s_chtml30_start_dir_tag,
358 s_chtml30_end_dir_tag,
362 s_chtml30_start_dl_tag,
363 s_chtml30_end_dl_tag,
367 s_chtml30_start_dd_tag,
368 s_chtml30_end_dd_tag,
372 s_chtml30_start_menu_tag,
373 s_chtml30_end_menu_tag,
377 s_chtml30_start_plaintext_tag,
378 s_chtml30_end_plaintext_tag,
382 s_chtml30_start_blink_tag,
383 s_chtml30_end_blink_tag,
387 s_chtml30_start_marquee_tag,
388 s_chtml30_end_marquee_tag,
392 s_chtml30_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_chtml30(
414 chxjconvrule_entry *entryp,
423 DBG(r, "start chxj_convert_chtml30()");
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_chtml30()");
435 DBG(r,"not found qrcode xml");
437 /*--------------------------------------------------------------------------*/
438 /* The CHTML structure is initialized. */
439 /*--------------------------------------------------------------------------*/
440 s_init_chtml30(&chtml30, &doc, r, spec);
442 chtml30.entryp = entryp;
443 chtml30.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 -> CHTML3.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*)&chtml30, &doc, qs_get_root(&doc), 0);
468 chtml30.out = chxj_buffered_write_flush(chtml30.out, &doc.buf);
469 dst = apr_pstrdup(r->pool, chtml30.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 -> CHTML3.0", dst, *dstlen);
487 DBG(r, "end chxj_convert_chtml30()");
493 * The CHTML structure is initialized.
495 * @param chtml30 [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_chtml30(chtml30_t *chtml30, Doc *doc, request_rec *r, device_table *spec)
505 memset(doc, 0, sizeof(Doc));
506 memset(chtml30, 0, sizeof(chtml30_t));
510 chtml30->spec = spec;
511 chtml30->out = qs_alloc_zero_byte_string(r->pool);
512 chtml30->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
513 chtml30->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 chtml30 [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_chtml30_search_emoji(chtml30_t *chtml30, char *txt, char **rslt)
536 spec = chtml30->spec;
542 DBG(r,"spec is NULL");
545 for (ee = chtml30->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 chxj_chtml30_emoji_only_converter(request_rec *r, device_table *spec, const char *src, apr_size_t len)
585 chtml30 = &__chtml30;
588 DBG(r, "REQ[%X] start chxj_chtml30_emoji_eonly_converter()", (apr_size_t)(unsigned int)r);
589 memset(doc, 0, sizeof(Doc));
590 memset(chtml30, 0, sizeof(chtml30_t));
594 chtml30->spec = spec;
595 chtml30->out = qs_alloc_zero_byte_string(r->pool);
596 chtml30->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
597 chtml30->doc->parse_mode = PARSE_MODE_CHTML;
599 apr_pool_create(&pool, r->pool);
601 chxj_buffered_write_init(pool, &doc->buf);
603 for (ii=0; ii<len; ii++) {
607 rtn = s_chtml30_search_emoji(chtml30, (char *)&src[ii], &out);
614 if (is_sjis_kanji(src[ii])) {
615 two_byte[0] = src[ii+0];
616 two_byte[1] = src[ii+1];
622 one_byte[0] = src[ii+0];
627 chtml30->out = chxj_buffered_write_flush(chtml30->out, &doc->buf);
629 DBG(r, "REQ[%X] end chxj_chtml30_emoji_eonly_converter()", (apr_size_t)(unsigned int)r);
635 * It is a handler who processes the HTML tag.
637 * @param pdoc [i/o] The pointer to the CHTML structure at the output
638 * destination is specified.
639 * @param node [i] The HTML tag node is specified.
640 * @return The conversion result is returned.
643 s_chtml30_start_html_tag(void *pdoc, Node *UNUSED(node))
645 chtml30_t *chtml30 = GET_CHTML30(pdoc);
646 Doc *doc = chtml30->doc;
648 /*--------------------------------------------------------------------------*/
650 /*--------------------------------------------------------------------------*/
658 * It is a handler who processes the HTML tag.
660 * @param pdoc [i/o] The pointer to the CHTML structure at the output
661 * destination is specified.
662 * @param node [i] The HTML tag node is specified.
663 * @return The conversion result is returned.
666 s_chtml30_end_html_tag(void *pdoc, Node *UNUSED(child))
668 chtml30_t *chtml30 = GET_CHTML30(pdoc);
669 Doc *doc = chtml30->doc;
678 * It is a handler who processes the META tag.
680 * @param pdoc [i/o] The pointer to the CHTML structure at the output
681 * destination is specified.
682 * @param node [i] The META tag node is specified.
683 * @return The conversion result is returned.
686 s_chtml30_start_meta_tag(void *pdoc, Node *node)
692 int content_type_flag;
695 chtml30 = GET_CHTML30(pdoc);
699 content_type_flag = 0;
703 /*--------------------------------------------------------------------------*/
705 /*--------------------------------------------------------------------------*/
706 for (attr = qs_get_attr(doc,node);
708 attr = qs_get_next_attr(doc,attr)) {
709 char *name = qs_get_attr_name(doc,attr);
710 char *value = qs_get_attr_value(doc,attr);
714 if (strcasecmp(name, "http-equiv") == 0 && value && *value) {
715 /*----------------------------------------------------------------------*/
717 /*----------------------------------------------------------------------*/
718 W_L(" http-equiv=\"");
721 if (STRCASEEQ('c','C',"content-type", value))
722 content_type_flag = 1;
724 if (STRCASEEQ('r','R',"refresh", value))
731 if (strcasecmp(name, "content") == 0 && value && *value) {
732 if (content_type_flag) {
736 W_V(chxj_header_inf_set_content_type(r, "text/html; charset=SHIFT_JIS"));
744 buf = apr_pstrdup(r->pool, value);
745 url = strchr(buf, ';');
747 sec = apr_pstrdup(r->pool, buf);
750 url = chxj_encoding_parameter(r, url);
751 url = chxj_add_cookie_parameter(r, url, chtml30->cookie);
781 * It is a handler who processes the META tag.
783 * @param pdoc [i/o] The pointer to the CHTML structure at the output
784 * destination is specified.
785 * @param node [i] The META tag node is specified.
786 * @return The conversion result is returned.
789 s_chtml30_end_meta_tag(void* pdoc, Node* UNUSED(child))
791 chtml30_t *chtml30 = GET_CHTML30(pdoc);
798 * It is a handler who processes the HEAD tag.
800 * @param pdoc [i/o] The pointer to the CHTML structure at the output
801 * destination is specified.
802 * @param node [i] The HEAD tag node is specified.
803 * @return The conversion result is returned.
806 s_chtml30_start_head_tag(void* pdoc, Node* UNUSED(node))
808 chtml30_t *chtml30 = GET_CHTML30(pdoc);
809 Doc *doc = chtml30->doc;
818 * It is a handler who processes the HEAD tag.
820 * @param pdoc [i/o] The pointer to the CHTML structure at the output
821 * destination is specified.
822 * @param node [i] The HEAD tag node is specified.
823 * @return The conversion result is returned.
826 s_chtml30_end_head_tag(void *pdoc, Node *UNUSED(node))
828 chtml30_t *chtml30 = GET_CHTML30(pdoc);
829 Doc *doc = chtml30->doc;
838 * It is a handler who processes the TITLE tag.
840 * @param pdoc [i/o] The pointer to the CHTML structure at the output
841 * destination is specified.
842 * @param node [i] The TITLE tag node is specified.
843 * @return The conversion result is returned.
846 s_chtml30_start_title_tag(void *pdoc, Node *UNUSED(node))
848 chtml30_t *chtml30 = GET_CHTML30(pdoc);
849 Doc *doc = chtml30->doc;
858 * It is a handler who processes the TITLE tag.
860 * @param pdoc [i/o] The pointer to the CHTML structure at the output
861 * destination is specified.
862 * @param node [i] The TITLE tag node is specified.
863 * @return The conversion result is returned.
866 s_chtml30_end_title_tag(void *pdoc, Node *UNUSED(child))
868 chtml30_t *chtml30 = GET_CHTML30(pdoc);
869 Doc *doc = chtml30->doc;
878 * It is a handler who processes the BASE tag.
880 * @param pdoc [i/o] The pointer to the CHTML structure at the output
881 * destination is specified.
882 * @param node [i] The BASE tag node is specified.
883 * @return The conversion result is returned.
886 s_chtml30_start_base_tag(void *pdoc, Node *node)
893 chtml30 = GET_CHTML30(pdoc);
898 /*--------------------------------------------------------------------------*/
900 /*--------------------------------------------------------------------------*/
901 for (attr = qs_get_attr(doc,node);
903 attr = qs_get_next_attr(doc,attr)) {
904 char *name = qs_get_attr_name(doc,attr);
905 char *value = qs_get_attr_value(doc,attr);
906 if (STRCASEEQ('h','H',"href", name)) {
918 * It is a handler who processes the BASE tag.
920 * @param pdoc [i/o] The pointer to the CHTML structure at the output
921 * destination is specified.
922 * @param node [i] The BASE tag node is specified.
923 * @return The conversion result is returned.
926 s_chtml30_end_base_tag(void *pdoc, Node *UNUSED(child))
928 chtml30_t *chtml30 = GET_CHTML30(pdoc);
935 * It is a handler who processes the BODY tag.
937 * @param pdoc [i/o] The pointer to the CHTML structure at the output
938 * destination is specified.
939 * @param node [i] The BODY tag node is specified.
940 * @return The conversion result is returned.
943 s_chtml30_start_body_tag(void *pdoc, Node *node)
950 chtml30 = GET_CHTML30(pdoc);
955 /*--------------------------------------------------------------------------*/
957 /*--------------------------------------------------------------------------*/
958 for (attr = qs_get_attr(doc,node);
960 attr = qs_get_next_attr(doc,attr)) {
961 char *name = qs_get_attr_name(doc,attr);
962 char *value = qs_get_attr_value(doc,attr);
963 if (STRCASEEQ('b','B', "bgcolor", name) && value && *value) {
964 /*----------------------------------------------------------------------*/
966 /*----------------------------------------------------------------------*/
971 else if (STRCASEEQ('t','T', "text", name) && value && *value) {
972 /*----------------------------------------------------------------------*/
974 /*----------------------------------------------------------------------*/
979 else if (STRCASEEQ('l','L',"link", name) && value && *value) {
980 /*----------------------------------------------------------------------*/
982 /*----------------------------------------------------------------------*/
987 else if (STRCASEEQ('a','A',"alink", name)) {
988 /*----------------------------------------------------------------------*/
990 /*----------------------------------------------------------------------*/
993 else if (STRCASEEQ('v','V',"vlink", name)) {
994 /*----------------------------------------------------------------------*/
996 /*----------------------------------------------------------------------*/
1001 return chtml30->out;
1006 * It is a handler who processes the BODY tag.
1008 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1009 * destination is specified.
1010 * @param node [i] The BODY tag node is specified.
1011 * @return The conversion result is returned.
1014 s_chtml30_end_body_tag(void *pdoc, Node *UNUSED(child))
1019 chtml30 = GET_CHTML30(pdoc);
1024 return chtml30->out;
1029 * It is a handler who processes the A tag.
1031 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1032 * destination is specified.
1033 * @param node [i] The A tag node is specified.
1034 * @return The conversion result is returned.
1037 s_chtml30_start_a_tag(void *pdoc, Node *node)
1044 chtml30 = GET_CHTML30(pdoc);
1049 /*--------------------------------------------------------------------------*/
1050 /* Get Attributes */
1051 /*--------------------------------------------------------------------------*/
1052 for (attr = qs_get_attr(doc,node);
1054 attr = qs_get_next_attr(doc,attr)) {
1055 char *name = qs_get_attr_name(doc,attr);
1056 char *value = qs_get_attr_value(doc,attr);
1057 if (STRCASEEQ('n','N',"name", name)) {
1058 /*----------------------------------------------------------------------*/
1060 /*----------------------------------------------------------------------*/
1065 else if (STRCASEEQ('h','H',"href", name)) {
1066 /*----------------------------------------------------------------------*/
1068 /*----------------------------------------------------------------------*/
1069 value = chxj_encoding_parameter(r, value);
1070 if (! chxj_starts_with(value, "mailto:") && ! chxj_starts_with(value, "tel:")) {
1071 value = chxj_add_cookie_parameter(r, value, chtml30->cookie);
1077 else if (STRCASEEQ('a','A',"accesskey", name)) {
1078 /*----------------------------------------------------------------------*/
1080 /*----------------------------------------------------------------------*/
1081 W_L(" accesskey=\"");
1085 else if (STRCASEEQ('c','C',"cti", name)) {
1086 /*----------------------------------------------------------------------*/
1088 /*----------------------------------------------------------------------*/
1093 else if (STRCASEEQ('i','I',"ijam", name)) {
1094 /*----------------------------------------------------------------------*/
1096 /*----------------------------------------------------------------------*/
1099 else if (STRCASEEQ('u','U',"utn", name)) {
1100 /*----------------------------------------------------------------------*/
1102 /* It is special only for CHTML. */
1103 /*----------------------------------------------------------------------*/
1106 else if (STRCASEEQ('t','T',"telbook", name)) {
1107 /*----------------------------------------------------------------------*/
1109 /*----------------------------------------------------------------------*/
1112 else if (STRCASEEQ('k','K',"kana", name)) {
1113 /*----------------------------------------------------------------------*/
1115 /*----------------------------------------------------------------------*/
1118 else if (STRCASEEQ('e','E',"email", name)) {
1119 /*----------------------------------------------------------------------*/
1121 /*----------------------------------------------------------------------*/
1124 else if (STRCASEEQ('i','I',"ista", name)) {
1125 /*----------------------------------------------------------------------*/
1127 /*----------------------------------------------------------------------*/
1130 else if (STRCASEEQ('i','I',"ilet", name)) {
1131 /*----------------------------------------------------------------------*/
1133 /*----------------------------------------------------------------------*/
1136 else if (STRCASEEQ('i','I',"iswf", name)) {
1137 /*----------------------------------------------------------------------*/
1139 /*----------------------------------------------------------------------*/
1142 else if (STRCASEEQ('i','I',"irst", name)) {
1143 /*----------------------------------------------------------------------*/
1145 /*----------------------------------------------------------------------*/
1150 return chtml30->out;
1155 * It is a handler who processes the A tag.
1157 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1158 * destination is specified.
1159 * @param node [i] The A tag node is specified.
1160 * @return The conversion result is returned.
1163 s_chtml30_end_a_tag(void *pdoc, Node *UNUSED(child))
1168 chtml30 = GET_CHTML30(pdoc);
1173 return chtml30->out;
1178 * It is a handler who processes the BR tag.
1180 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1181 * destination is specified.
1182 * @param node [i] The BR tag node is specified.
1183 * @return The conversion result is returned.
1186 s_chtml30_start_br_tag(void *pdoc, Node *node)
1193 chtml30 = GET_CHTML30(pdoc);
1197 /*--------------------------------------------------------------------------*/
1198 /* Get Attributes */
1199 /*--------------------------------------------------------------------------*/
1200 for (attr = qs_get_attr(doc,node);
1202 attr = qs_get_next_attr(doc,attr)) {
1203 char *name = qs_get_attr_name(doc,attr);
1204 char *value = qs_get_attr_value(doc,attr);
1205 if (STRCASEEQ('c','C',"clear",name)) {
1206 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1214 return chtml30->out;
1219 * It is a handler who processes the BR tag.
1221 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1222 * destination is specified.
1223 * @param node [i] The BR tag node is specified.
1224 * @return The conversion result is returned.
1227 s_chtml30_end_br_tag(void *pdoc, Node *UNUSED(child))
1229 chtml30_t *chtml30 = GET_CHTML30(pdoc);
1231 return chtml30->out;
1236 * It is a handler who processes the TR tag.
1238 * @param chtml30 [i/o] The pointer to the CHTML structure at the output
1239 * destination is specified.
1240 * @param node [i] The TR tag node is specified.
1241 * @return The conversion result is returned.
1244 s_chtml30_start_tr_tag(void *pdoc, Node *UNUSED(node))
1246 chtml30_t *chtml30 = GET_CHTML30(pdoc);
1248 return chtml30->out;
1253 * It is a handler who processes the TR tag.
1255 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1256 * destination is specified.
1257 * @param node [i] The TR tag node is specified.
1258 * @return The conversion result is returned.
1261 s_chtml30_end_tr_tag(void *pdoc, Node *UNUSED(child))
1267 chtml30 = GET_CHTML30(pdoc);
1273 return chtml30->out;
1278 * It is a handler who processes the FONT tag.
1280 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1281 * destination is specified.
1282 * @param node [i] The FONT tag node is specified.
1283 * @return The conversion result is returned.
1286 s_chtml30_start_font_tag(void *pdoc, Node *node)
1294 chtml30 = GET_CHTML30(pdoc);
1298 /*--------------------------------------------------------------------------*/
1299 /* Get Attributes */
1300 /*--------------------------------------------------------------------------*/
1301 for (attr = qs_get_attr(doc,node);
1302 attr && color == NULL;
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',"color", name) && value && *value) {
1307 color = apr_pstrdup(doc->buf.pool, value);
1310 else if (STRCASEEQ('s','S',"size", name)) {
1311 /*----------------------------------------------------------------------*/
1313 /*----------------------------------------------------------------------*/
1318 W_L("<font color=\"");
1321 chtml30->font_flag++;
1323 return chtml30->out;
1328 * It is a handler who processes the FONT tag.
1330 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1331 * destination is specified.
1332 * @param node [i] The FONT tag node is specified.
1333 * @return The conversion result is returned.
1336 s_chtml30_end_font_tag(void *pdoc, Node *UNUSED(child))
1342 chtml30 = GET_CHTML30(pdoc);
1346 if (chtml30->font_flag) {
1348 chtml30->font_flag--;
1351 return chtml30->out;
1356 * It is a handler who processes the FORM tag.
1358 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1359 * destination is specified.
1360 * @param node [i] The FORM tag node is specified.
1361 * @return The conversion result is returned.
1364 s_chtml30_start_form_tag(void *pdoc, Node *node)
1370 char *new_hidden_tag = NULL;
1371 char *attr_method = NULL;
1372 char *attr_action = NULL;
1373 char *attr_utn = NULL;
1375 chtml30 = GET_CHTML30(pdoc);
1379 /*--------------------------------------------------------------------------*/
1380 /* Get Attributes */
1381 /*--------------------------------------------------------------------------*/
1382 for (attr = qs_get_attr(doc,node);
1384 attr = qs_get_next_attr(doc,attr)) {
1385 char *name = qs_get_attr_name(doc,attr);
1386 char *value = qs_get_attr_value(doc,attr);
1387 if (STRCASEEQ('a','A',"action", name)) {
1388 /*----------------------------------------------------------------------*/
1390 /*----------------------------------------------------------------------*/
1391 attr_action = chxj_encoding_parameter(r, value);
1392 attr_action = chxj_add_cookie_parameter(r, attr_action, chtml30->cookie);
1394 else if (STRCASEEQ('m','M',"method", name)) {
1395 /*----------------------------------------------------------------------*/
1397 /*----------------------------------------------------------------------*/
1398 attr_method = apr_pstrdup(doc->pool, value);
1400 else if (STRCASEEQ('u','U',"utn", name)) {
1401 /*----------------------------------------------------------------------*/
1403 /* It is special only for CHTML. */
1404 /*----------------------------------------------------------------------*/
1409 int post_flag = (attr_method && strcasecmp(attr_method, "post") == 0) ? 1 : 0;
1414 char *new_query_string = NULL;
1415 q = strchr(attr_action, '?');
1417 new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 0, post_flag, &new_query_string, CHXJ_TRUE, CHXJ_FALSE, chtml30->entryp);
1418 if (new_hidden_tag || new_query_string) {
1424 if (new_query_string) {
1426 W_V(new_query_string);
1439 if (new_hidden_tag) {
1440 W_V(new_hidden_tag);
1442 return chtml30->out;
1447 * It is a handler who processes the FORM tag.
1449 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1450 * destination is specified.
1451 * @param node [i] The FORM tag node is specified.
1452 * @return The conversion result is returned.
1455 s_chtml30_end_form_tag(void *pdoc, Node *UNUSED(child))
1460 chtml30 = GET_CHTML30(pdoc);
1465 return chtml30->out;
1470 * It is a handler who processes the INPUT tag.
1472 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1473 * destination is specified.
1474 * @param node [i] The INPUT tag node is specified.
1475 * @return The conversion result is returned.
1478 s_chtml30_start_input_tag(void *pdoc, Node *node)
1483 char *max_length = NULL;
1487 char *istyle = NULL;
1489 char *checked = NULL;
1490 char *accesskey = NULL;
1492 chtml30 = GET_CHTML30(pdoc);
1496 /*--------------------------------------------------------------------------*/
1497 /* Get Attributes */
1498 /*--------------------------------------------------------------------------*/
1499 type = qs_get_type_attr(doc, node, doc->buf.pool);
1500 name = qs_get_name_attr(doc, node, doc->buf.pool);
1501 value = qs_get_value_attr(doc,node,doc->buf.pool);
1502 istyle = qs_get_istyle_attr(doc,node,doc->buf.pool);
1503 max_length = qs_get_maxlength_attr(doc,node,doc->buf.pool);
1504 checked = qs_get_checked_attr(doc,node,doc->buf.pool);
1505 accesskey = qs_get_accesskey_attr(doc, node, doc->buf.pool);
1506 size = qs_get_size_attr(doc, node, doc->buf.pool);
1509 type = qs_trim_string(doc->buf.pool, type);
1510 if (type && (STRCASEEQ('t','T',"text", type) ||
1511 STRCASEEQ('p','P',"password",type) ||
1512 STRCASEEQ('c','C',"checkbox",type) ||
1513 STRCASEEQ('r','R',"radio", type) ||
1514 STRCASEEQ('h','H',"hidden", type) ||
1515 STRCASEEQ('s','S',"submit", type) ||
1516 STRCASEEQ('r','R',"reset", type))) {
1522 if (size && *size) {
1527 if (name && *name) {
1532 if (value && *value) {
1534 W_V(chxj_add_slash_to_doublequote(doc->pool, value));
1537 if (accesskey && *accesskey) {
1538 W_L(" accesskey=\"");
1543 /*------------------------------------------------------------------------*/
1545 /*------------------------------------------------------------------------*/
1546 if (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4') {
1553 /*--------------------------------------------------------------------------*/
1554 /* The figure is default for the password. */
1555 /*--------------------------------------------------------------------------*/
1556 if (max_length && *max_length) {
1557 if (chxj_chk_numeric(max_length) != 0) {
1558 max_length = apr_psprintf(r->pool, "0");
1560 if (istyle != NULL && *istyle == '1') {
1561 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length) * 2);
1565 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length));
1573 return chtml30->out;
1578 * It is a handler who processes the INPUT tag.
1580 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1581 * destination is specified.
1582 * @param node [i] The INPUT tag node is specified.
1583 * @return The conversion result is returned.
1586 s_chtml30_end_input_tag(void *pdoc, Node *UNUSED(child))
1588 chtml30_t *chtml30 = GET_CHTML30(pdoc);
1590 return chtml30->out;
1595 * It is a handler who processes the CENTER tag.
1597 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1598 * destination is specified.
1599 * @param node [i] The CENTER tag node is specified.
1600 * @return The conversion result is returned.
1603 s_chtml30_start_center_tag(void *pdoc, Node *UNUSED(node))
1608 chtml30 = GET_CHTML30(pdoc);
1613 return chtml30->out;
1618 * It is a handler who processes the CENTER tag.
1620 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1621 * destination is specified.
1622 * @param node [i] The CENTER tag node is specified.
1623 * @return The conversion result is returned.
1626 s_chtml30_end_center_tag(void *pdoc, Node *UNUSED(child))
1631 chtml30 = GET_CHTML30(pdoc);
1636 return chtml30->out;
1641 * It is a handler who processes the HR tag.
1643 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1644 * destination is specified.
1645 * @param node [i] The HR tag node is specified.
1646 * @return The conversion result is returned.
1649 s_chtml30_start_hr_tag(void *pdoc, Node *node)
1656 chtml30 = GET_CHTML30(pdoc);
1662 for (attr = qs_get_attr(doc,node);
1664 attr = qs_get_next_attr(doc,attr)) {
1665 char *name = qs_get_attr_name(doc,attr);
1666 char *value = qs_get_attr_value(doc,attr);
1667 if (STRCASEEQ('a','A',"align", name)) {
1668 /*----------------------------------------------------------------------*/
1670 /*----------------------------------------------------------------------*/
1671 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1677 else if (STRCASEEQ('s','S',"size", name)) {
1678 /*----------------------------------------------------------------------*/
1680 /*----------------------------------------------------------------------*/
1681 if (value && *value) {
1687 else if (STRCASEEQ('w','W',"width", name)) {
1688 /*----------------------------------------------------------------------*/
1690 /*----------------------------------------------------------------------*/
1691 if (value && *value) {
1697 else if (STRCASEEQ('n','N',"noshade", name)) {
1698 /*----------------------------------------------------------------------*/
1700 /*----------------------------------------------------------------------*/
1703 else if (STRCASEEQ('c','C',"color", name)) {
1704 /*----------------------------------------------------------------------*/
1706 /*----------------------------------------------------------------------*/
1712 return chtml30->out;
1717 * It is a handler who processes the HR tag.
1719 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1720 * destination is specified.
1721 * @param node [i] The HR tag node is specified.
1722 * @return The conversion result is returned.
1725 s_chtml30_end_hr_tag(void *pdoc, Node *UNUSED(child))
1727 chtml30_t *chtml30 = GET_CHTML30(pdoc);
1729 return chtml30->out;
1734 * It is a handler who processes the IMG tag.
1736 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1737 * destination is specified.
1738 * @param node [i] The IMG tag node is specified.
1739 * @return The conversion result is returned.
1742 s_chtml30_start_img_tag(void *pdoc, Node *node)
1744 #ifndef IMG_NOT_CONVERT_FILENAME
1752 chtml30 = GET_CHTML30(pdoc);
1755 #ifndef IMG_NOT_CONVERT_FILENAME
1756 spec = chtml30->spec;
1760 /*--------------------------------------------------------------------------*/
1761 /* Get Attributes */
1762 /*--------------------------------------------------------------------------*/
1763 for (attr = qs_get_attr(doc,node);
1765 attr = qs_get_next_attr(doc,attr)) {
1766 char *name = qs_get_attr_name(doc,attr);
1767 char *value = qs_get_attr_value(doc,attr);
1768 if (STRCASEEQ('s','S',"src", name)) {
1769 /*----------------------------------------------------------------------*/
1771 /*----------------------------------------------------------------------*/
1772 #ifdef IMG_NOT_CONVERT_FILENAME
1773 value = chxj_encoding_parameter(r, value);
1774 value = chxj_add_cookie_parameter(r, value, chtml30->cookie);
1775 value = chxj_add_cookie_no_update_parameter(r, value);
1780 value = chxj_img_conv(r,spec,value);
1781 value = chxj_encoding_parameter(r, value);
1782 value = chxj_add_cookie_parameter(r, value, chtml30->cookie);
1783 value = chxj_add_cookie_no_update_parameter(r, value);
1789 else if (STRCASEEQ('a','A',"align", name)) {
1790 /*----------------------------------------------------------------------*/
1792 /*----------------------------------------------------------------------*/
1794 if (STRCASEEQ('t','T',"top", value) ||
1795 STRCASEEQ('m','M',"middle",value) ||
1796 STRCASEEQ('b','B',"bottom",value) ||
1797 STRCASEEQ('l','L',"left", value) ||
1798 STRCASEEQ('r','R',"right", value)) {
1803 else if (STRCASEEQ('c','C',"center", value)) {
1810 else if (STRCASEEQ('w','W',"width", name) && value && *value) {
1811 /*----------------------------------------------------------------------*/
1813 /*----------------------------------------------------------------------*/
1818 else if (STRCASEEQ('h','H', "height", name) && value && *value) {
1819 /*----------------------------------------------------------------------*/
1821 /*----------------------------------------------------------------------*/
1826 else if (STRCASEEQ('h','H',"hspace", name) && value && *value) {
1827 /*----------------------------------------------------------------------*/
1829 /*----------------------------------------------------------------------*/
1834 else if (STRCASEEQ('v','V',"vspace", name) && value && *value) {
1835 /*----------------------------------------------------------------------*/
1837 /*----------------------------------------------------------------------*/
1842 else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
1843 /*----------------------------------------------------------------------*/
1845 /*----------------------------------------------------------------------*/
1850 else if (STRCASEEQ('a','A',"align", name) && value && *value) {
1851 /*----------------------------------------------------------------------*/
1853 /*----------------------------------------------------------------------*/
1859 return chtml30->out;
1864 * It is a handler who processes the IMG tag.
1866 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1867 * destination is specified.
1868 * @param node [i] The IMG tag node is specified.
1869 * @return The conversion result is returned.
1872 s_chtml30_end_img_tag(void *pdoc, Node *UNUSED(child))
1874 chtml30_t *chtml30 = GET_CHTML30(pdoc);
1876 return chtml30->out;
1881 * It is a handler who processes the SELECT tag.
1883 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1884 * destination is specified.
1885 * @param node [i] The SELECT tag node is specified.
1886 * @return The conversion result is returned.
1889 s_chtml30_start_select_tag(void *pdoc, Node *child)
1891 chtml30_t *chtml30 = GET_CHTML30(pdoc);
1892 Doc *doc = chtml30->doc;
1895 char *multiple = NULL;
1899 for (attr = qs_get_attr(doc,child);
1901 attr = qs_get_next_attr(doc,attr)) {
1902 char *nm = qs_get_attr_name(doc,attr);
1903 char *val = qs_get_attr_value(doc,attr);
1904 if (STRCASEEQ('s','S',"size", nm)) {
1905 /*----------------------------------------------------------------------*/
1906 /* CHTML 1.0 version 2.0 */
1907 /*----------------------------------------------------------------------*/
1908 size = apr_pstrdup(doc->buf.pool, val);
1910 else if (STRCASEEQ('n','N',"name", nm)) {
1911 /*----------------------------------------------------------------------*/
1912 /* CHTML 1.0 version 2.0 */
1913 /*----------------------------------------------------------------------*/
1914 name = apr_pstrdup(doc->buf.pool, val);
1916 else if (STRCASEEQ('m','M',"multiple", nm)) {
1917 /*----------------------------------------------------------------------*/
1918 /* CHTML 1.0 version 2.0 */
1919 /*----------------------------------------------------------------------*/
1920 multiple = apr_pstrdup(doc->buf.pool, val);
1923 if (size && *size) {
1928 if (name && *name) {
1937 return chtml30->out;
1942 * It is a handler who processes the SELECT tag.
1944 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1945 * destination is specified.
1946 * @param node [i] The SELECT tag node is specified.
1947 * @return The conversion result is returned.
1950 s_chtml30_end_select_tag(void *pdoc, Node *UNUSED(child))
1952 chtml30_t *chtml30 = GET_CHTML30(pdoc);
1953 Doc *doc = chtml30->doc;
1956 return chtml30->out;
1961 * It is a handler who processes the OPTION tag.
1963 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1964 * destination is specified.
1965 * @param node [i] The OPTION tag node is specified.
1966 * @return The conversion result is returned.
1969 s_chtml30_start_option_tag(void *pdoc, Node *child)
1978 chtml30 = GET_CHTML30(pdoc);
1985 for (attr = qs_get_attr(doc,child);
1987 attr = qs_get_next_attr(doc,attr)) {
1988 char *nm = qs_get_attr_name(doc,attr);
1989 char *val = qs_get_attr_value(doc,attr);
1990 if (STRCASEEQ('s','S',"selected", nm)) {
1991 /*----------------------------------------------------------------------*/
1992 /* CHTML 1.0 version 2.0 */
1993 /*----------------------------------------------------------------------*/
1994 selected = apr_pstrdup(doc->buf.pool, val);
1996 else if (STRCASEEQ('v','V',"value", nm)) {
1997 /*----------------------------------------------------------------------*/
1998 /* CHTML 1.0 version 2.0 */
1999 /*----------------------------------------------------------------------*/
2000 value = apr_pstrdup(doc->buf.pool, val);
2012 return chtml30->out;
2017 * It is a handler who processes the OPTION tag.
2019 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2020 * destination is specified.
2021 * @param node [i] The OPTION tag node is specified.
2022 * @return The conversion result is returned.
2025 s_chtml30_end_option_tag(void *pdoc, Node *UNUSED(child))
2027 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2031 return chtml30->out;
2036 * It is a handler who processes the DIV tag.
2038 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2039 * destination is specified.
2040 * @param node [i] The DIV tag node is specified.
2041 * @return The conversion result is returned.
2044 s_chtml30_start_div_tag(void *pdoc, Node *child)
2052 chtml30 = GET_CHTML30(pdoc);
2058 for (attr = qs_get_attr(doc,child);
2060 attr = qs_get_next_attr(doc,attr)) {
2061 char *nm = qs_get_attr_name(doc,attr);
2062 char *val = qs_get_attr_value(doc,attr);
2063 if (STRCASEEQ('a','A',"align", nm)) {
2064 /*----------------------------------------------------------------------*/
2065 /* CHTML 1.0 (W3C version 3.2) */
2066 /*----------------------------------------------------------------------*/
2067 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2068 align = apr_pstrdup(doc->buf.pool, val);
2078 return chtml30->out;
2083 * It is a handler who processes the DIV tag.
2085 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2086 * destination is specified.
2087 * @param node [i] The DIV tag node is specified.
2088 * @return The conversion result is returned.
2091 s_chtml30_end_div_tag(void *pdoc, Node *UNUSED(node))
2093 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2094 Doc *doc = chtml30->doc;
2098 return chtml30->out;
2103 * It is a handler who processes the UL tag.
2105 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2106 * destination is specified.
2107 * @param node [i] The UL tag node is specified.
2108 * @return The conversion result is returned.
2111 s_chtml30_start_ul_tag(void *pdoc, Node *UNUSED(node))
2113 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2114 Doc *doc = chtml30->doc;
2118 return chtml30->out;
2123 * It is a handler who processes the UL tag.
2125 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2126 * destination is specified.
2127 * @param node [i] The UL tag node is specified.
2128 * @return The conversion result is returned.
2131 s_chtml30_end_ul_tag(void *pdoc, Node *UNUSED(child))
2133 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2134 Doc *doc = chtml30->doc;
2138 return chtml30->out;
2143 * It is a handler who processes the PRE tag.
2145 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2146 * destination is specified.
2147 * @param node [i] The PRE tag node is specified.
2148 * @return The conversion result is returned.
2151 s_chtml30_start_pre_tag(void *pdoc, Node *UNUSED(node))
2153 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2154 Doc *doc = chtml30->doc;
2156 chtml30->pre_flag++;
2159 return chtml30->out;
2164 * It is a handler who processes the PRE tag.
2166 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2167 * destination is specified.
2168 * @param node [i] The PRE tag node is specified.
2169 * @return The conversion result is returned.
2172 s_chtml30_end_pre_tag(void *pdoc, Node *UNUSED(child))
2174 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2175 Doc *doc = chtml30->doc;
2178 chtml30->pre_flag--;
2180 return chtml30->out;
2185 * It is a handler who processes the P tag.
2187 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2188 * destination is specified.
2189 * @param node [i] The P tag node is specified.
2190 * @return The conversion result is returned.
2193 s_chtml30_start_p_tag(void *pdoc, Node *node)
2201 chtml30 = GET_CHTML30(pdoc);
2206 for (attr = qs_get_attr(doc,node);
2208 attr = qs_get_next_attr(doc,attr)) {
2209 char *nm = qs_get_attr_name(doc,attr);
2210 char *val = qs_get_attr_value(doc,attr);
2211 if (STRCASEEQ('a','A',"align", nm)) {
2212 /*----------------------------------------------------------------------*/
2213 /* CHTML 1.0 (W3C version 3.2) */
2214 /*----------------------------------------------------------------------*/
2215 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2216 align = apr_pstrdup(doc->buf.pool, val);
2227 return chtml30->out;
2232 * It is a handler who processes the P tag.
2234 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2235 * destination is specified.
2236 * @param node [i] The P tag node is specified.
2237 * @return The conversion result is returned.
2240 s_chtml30_end_p_tag(void *pdoc, Node *UNUSED(child))
2245 chtml30 = GET_CHTML30(pdoc);
2250 return chtml30->out;
2255 * It is a handler who processes the OL tag.
2257 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2258 * destination is specified.
2259 * @param node [i] The OL tag node is specified.
2260 * @return The conversion result is returned.
2263 s_chtml30_start_ol_tag(void *pdoc, Node *node)
2270 chtml30 = GET_CHTML30(pdoc);
2275 /*--------------------------------------------------------------------------*/
2276 /* Get Attributes */
2277 /*--------------------------------------------------------------------------*/
2278 for (attr = qs_get_attr(doc,node);
2280 attr = qs_get_next_attr(doc,attr)) {
2281 char *name = qs_get_attr_name(doc,attr);
2282 char *value = qs_get_attr_value(doc,attr);
2283 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
2288 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
2296 return chtml30->out;
2301 * It is a handler who processes the OL tag.
2303 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2304 * destination is specified.
2305 * @param node [i] The OL tag node is specified.
2306 * @return The conversion result is returned.
2309 s_chtml30_end_ol_tag(void *pdoc, Node *UNUSED(node))
2311 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2312 Doc *doc = chtml30->doc;
2316 return chtml30->out;
2321 * It is a handler who processes the LI tag.
2323 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2324 * destination is specified.
2325 * @param node [i] The LI tag node is specified.
2326 * @return The conversion result is returned.
2329 s_chtml30_start_li_tag(void *pdoc, Node *node)
2331 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2332 Doc *doc = chtml30->doc;
2336 /*--------------------------------------------------------------------------*/
2337 /* Get Attributes */
2338 /*--------------------------------------------------------------------------*/
2339 for (attr = qs_get_attr(doc,node);
2341 attr = qs_get_next_attr(doc,attr)) {
2342 char *name = qs_get_attr_name(doc,attr);
2343 char *value = qs_get_attr_value(doc,attr);
2344 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
2349 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
2356 return chtml30->out;
2361 * It is a handler who processes the LI tag.
2363 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2364 * destination is specified.
2365 * @param node [i] The LI tag node is specified.
2366 * @return The conversion result is returned.
2369 s_chtml30_end_li_tag(void *pdoc, Node *UNUSED(child))
2371 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2373 return chtml30->out;
2378 * It is a handler who processes the H1 tag.
2380 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2381 * destination is specified.
2382 * @param node [i] The H1 tag node is specified.
2383 * @return The conversion result is returned.
2386 s_chtml30_start_h1_tag(void *pdoc, Node *node)
2393 chtml30 = GET_CHTML30(pdoc);
2398 for (attr = qs_get_attr(doc,node);
2400 attr = qs_get_next_attr(doc,attr)) {
2401 char *name = qs_get_attr_name(doc,attr);
2402 char *value = qs_get_attr_value(doc,attr);
2403 if (STRCASEEQ('a','A',"align", name)) {
2404 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2414 return chtml30->out;
2419 * It is a handler who processes the H1 tag.
2421 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2422 * destination is specified.
2423 * @param node [i] The H1 tag node is specified.
2424 * @return The conversion result is returned.
2427 s_chtml30_end_h1_tag(void *pdoc, Node *UNUSED(child))
2432 chtml30 = GET_CHTML30(pdoc);
2437 return chtml30->out;
2442 * It is a handler who processes the H2 tag.
2444 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2445 * destination is specified.
2446 * @param node [i] The H2 tag node is specified.
2447 * @return The conversion result is returned.
2450 s_chtml30_start_h2_tag(void *pdoc, Node *node)
2457 chtml30 = GET_CHTML30(pdoc);
2462 for (attr = qs_get_attr(doc,node);
2464 attr = qs_get_next_attr(doc,attr)) {
2465 char *name = qs_get_attr_name(doc,attr);
2466 char *value = qs_get_attr_value(doc,attr);
2467 if (STRCASEEQ('a','A',"align", name)) {
2468 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2477 return chtml30->out;
2482 * It is a handler who processes the H2 tag.
2484 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2485 * destination is specified.
2486 * @param node [i] The H2 tag node is specified.
2487 * @return The conversion result is returned.
2490 s_chtml30_end_h2_tag(void *pdoc, Node *UNUSED(child))
2492 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2493 Doc *doc = chtml30->doc;
2497 return chtml30->out;
2502 * It is a handler who processes the H3 tag.
2504 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2505 * destination is specified.
2506 * @param node [i] The H3 tag node is specified.
2507 * @return The conversion result is returned.
2510 s_chtml30_start_h3_tag(void *pdoc, Node *node)
2517 chtml30 = GET_CHTML30(pdoc);
2522 for (attr = qs_get_attr(doc,node);
2524 attr = qs_get_next_attr(doc,attr)) {
2525 char *name = qs_get_attr_name(doc,attr);
2526 char *value = qs_get_attr_value(doc,attr);
2527 if (STRCASEEQ('a','A',"align", name)) {
2528 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2538 return chtml30->out;
2543 * It is a handler who processes the H3 tag.
2545 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2546 * destination is specified.
2547 * @param node [i] The H3 tag node is specified.
2548 * @return The conversion result is returned.
2551 s_chtml30_end_h3_tag(void *pdoc, Node *UNUSED(child))
2553 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2554 Doc *doc = chtml30->doc;
2558 return chtml30->out;
2563 * It is a handler who processes the H4 tag.
2565 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2566 * destination is specified.
2567 * @param node [i] The H4 tag node is specified.
2568 * @return The conversion result is returned.
2571 s_chtml30_start_h4_tag(void *pdoc, Node *node)
2578 chtml30 = GET_CHTML30(pdoc);
2583 for (attr = qs_get_attr(doc,node);
2585 attr = qs_get_next_attr(doc,attr)) {
2586 char *name = qs_get_attr_name(doc,attr);
2587 char *value = qs_get_attr_value(doc,attr);
2588 if (STRCASEEQ('a','A',"align", name)) {
2589 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2598 return chtml30->out;
2603 * It is a handler who processes the H4 tag.
2605 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2606 * destination is specified.
2607 * @param node [i] The H4 tag node is specified.
2608 * @return The conversion result is returned.
2611 s_chtml30_end_h4_tag(void *pdoc, Node *UNUSED(child))
2613 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2614 Doc *doc = chtml30->doc;
2618 return chtml30->out;
2623 * It is a handler who processes the H5 tag.
2625 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2626 * destination is specified.
2627 * @param node [i] The H5 tag node is specified.
2628 * @return The conversion result is returned.
2631 s_chtml30_start_h5_tag(void *pdoc, Node *node)
2638 chtml30 = GET_CHTML30(pdoc);
2643 for (attr = qs_get_attr(doc,node);
2645 attr = qs_get_next_attr(doc,attr)) {
2646 char *name = qs_get_attr_name(doc,attr);
2647 char *value = qs_get_attr_value(doc,attr);
2648 if (STRCASEEQ('a','A',"align", name)) {
2649 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2658 return chtml30->out;
2663 * It is a handler who processes the H5 tag.
2665 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2666 * destination is specified.
2667 * @param node [i] The H5 tag node is specified.
2668 * @return The conversion result is returned.
2671 s_chtml30_end_h5_tag(void *pdoc, Node *UNUSED(child))
2673 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2674 Doc *doc = chtml30->doc;
2678 return chtml30->out;
2683 * It is a handler who processes the H6 tag.
2685 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2686 * destination is specified.
2687 * @param node [i] The H6 tag node is specified.
2688 * @return The conversion result is returned.
2691 s_chtml30_start_h6_tag(void *pdoc, Node *node)
2698 chtml30 = GET_CHTML30(pdoc);
2703 for (attr = qs_get_attr(doc,node);
2705 attr = qs_get_next_attr(doc,attr)) {
2706 char *name = qs_get_attr_name(doc,attr);
2707 char *value = qs_get_attr_value(doc,attr);
2708 if (STRCASEEQ('a','A',"align", name)) {
2709 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2718 return chtml30->out;
2723 * It is a handler who processes the H6 tag.
2725 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2726 * destination is specified.
2727 * @param node [i] The H6 tag node is specified.
2728 * @return The conversion result is returned.
2731 s_chtml30_end_h6_tag(void *pdoc, Node *UNUSED(child))
2733 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2734 Doc *doc = chtml30->doc;
2738 return chtml30->out;
2743 * It is a handler who processes the TEXTARE tag.
2745 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2746 * destination is specified.
2747 * @param node [i] The TEXTAREA tag node is specified.
2748 * @return The conversion result is returned.
2751 s_chtml30_start_textarea_tag(void *pdoc, Node *node)
2758 chtml30 = GET_CHTML30(pdoc);
2762 chtml30->textarea_flag++;
2765 for (attr = qs_get_attr(doc,node);
2767 attr = qs_get_next_attr(doc,attr)) {
2768 char *name = qs_get_attr_name(doc,attr);
2769 char *value = qs_get_attr_value(doc,attr);
2770 if (STRCASEEQ('a','A',"accesskey",name) && value && *value != 0) {
2771 W_L(" accesskey=\"");
2775 else if (STRCASEEQ('i','I',"istyle", name) && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
2780 else if (STRCASEEQ('n','N',"name", name) && value && *value) {
2785 else if (STRCASEEQ('r','R',"rows", name) && value && *value) {
2790 else if (STRCASEEQ('c','C',"cols", name) && value && *value) {
2797 return chtml30->out;
2802 * It is a handler who processes the TEXTAREA tag.
2804 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2805 * destination is specified.
2806 * @param node [i] The TEXTAREA tag node is specified.
2807 * @return The conversion result is returned.
2810 s_chtml30_end_textarea_tag(void *pdoc, Node *UNUSED(child))
2812 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2813 Doc *doc = chtml30->doc;
2816 chtml30->textarea_flag--;
2818 return chtml30->out;
2823 s_chtml30_chxjif_tag(void *pdoc, Node *node)
2830 chtml30 = GET_CHTML30(pdoc);
2834 for (child = qs_get_child_node(doc, node);
2836 child = qs_get_next_node(doc, child)) {
2838 s_chtml30_chxjif_tag(chtml30, child);
2846 s_chtml30_text_tag(void *pdoc, Node *child)
2859 chtml30 = GET_CHTML30(pdoc);
2863 textval = qs_get_node_value(doc,child);
2864 if (strlen(textval) == 0) {
2865 return chtml30->out;
2868 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
2869 memset(tmp, 0, qs_get_node_size(doc,child)+1);
2871 tdst = qs_alloc_zero_byte_string(doc->buf.pool);
2872 memset(one_byte, 0, sizeof(one_byte));
2875 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
2877 int rtn = s_chtml30_search_emoji(chtml30, &textval[ii], &out);
2879 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
2884 if (is_sjis_kanji(textval[ii])) {
2885 one_byte[0] = textval[ii+0];
2886 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2887 one_byte[0] = textval[ii+1];
2888 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2891 else if (chtml30->pre_flag) {
2892 one_byte[0] = textval[ii+0];
2893 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2895 else if (chtml30->textarea_flag) {
2896 one_byte[0] = textval[ii+0];
2897 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2899 else if (textval[ii] != '\r' && textval[ii] != '\n') {
2900 one_byte[0] = textval[ii+0];
2901 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2905 return chtml30->out;
2910 * It is a handler who processes the BLOCKQUOTE tag.
2912 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2913 * destination is specified.
2914 * @param node [i] The BLOCKQUOTE tag node is specified.
2915 * @return The conversion result is returned.
2918 s_chtml30_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
2920 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2921 Doc *doc = chtml30->doc;
2922 W_L("<blockquote>");
2923 return chtml30->out;
2928 * It is a handler who processes the BLOCKQUOTE tag.
2930 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2931 * destination is specified.
2932 * @param node [i] The BLOCKQUOTE tag node is specified.
2933 * @return The conversion result is returned.
2936 s_chtml30_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
2938 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2939 Doc *doc = chtml30->doc;
2940 W_L("</blockquote>");
2941 return chtml30->out;
2946 * It is a handler who processes the DIR tag.
2948 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2949 * destination is specified.
2950 * @param node [i] The DIR tag node is specified.
2951 * @return The conversion result is returned.
2954 s_chtml30_start_dir_tag(void *pdoc, Node *UNUSED(child))
2956 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2957 Doc *doc = chtml30->doc;
2959 return chtml30->out;
2964 * It is a handler who processes the DIR tag.
2966 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2967 * destination is specified.
2968 * @param node [i] The DIR tag node is specified.
2969 * @return The conversion result is returned.
2972 s_chtml30_end_dir_tag(void *pdoc, Node *UNUSED(child))
2974 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2975 Doc *doc = chtml30->doc;
2977 return chtml30->out;
2982 * It is a handler who processes the DL tag.
2984 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2985 * destination is specified.
2986 * @param node [i] The DL tag node is specified.
2987 * @return The conversion result is returned.
2990 s_chtml30_start_dl_tag(void *pdoc, Node *UNUSED(child))
2992 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2993 Doc *doc = chtml30->doc;
2995 return chtml30->out;
3000 * It is a handler who processes the DL tag.
3002 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3003 * destination is specified.
3004 * @param node [i] The DL tag node is specified.
3005 * @return The conversion result is returned.
3008 s_chtml30_end_dl_tag(void *pdoc, Node *UNUSED(child))
3010 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3011 Doc *doc = chtml30->doc;
3013 return chtml30->out;
3018 * It is a handler who processes the DT tag.
3020 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3021 * destination is specified.
3022 * @param node [i] The DT tag node is specified.
3023 * @return The conversion result is returned.
3026 s_chtml30_start_dt_tag(void *pdoc, Node *UNUSED(child))
3028 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3029 Doc *doc = chtml30->doc;
3031 return chtml30->out;
3036 * It is a handler who processes the DT tag.
3038 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3039 * destination is specified.
3040 * @param node [i] The DT tag node is specified.
3041 * @return The conversion result is returned.
3044 s_chtml30_end_dt_tag(void *pdoc, Node *UNUSED(child))
3046 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3048 return chtml30->out;
3053 * It is a handler who processes the DD tag.
3055 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3056 * destination is specified.
3057 * @param node [i] The DD tag node is specified.
3058 * @return The conversion result is returned.
3061 s_chtml30_start_dd_tag(void *pdoc, Node *UNUSED(child))
3063 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3064 Doc *doc = chtml30->doc;
3068 return chtml30->out;
3073 * It is a handler who processes the DD tag.
3075 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3076 * destination is specified.
3077 * @param node [i] The DD tag node is specified.
3078 * @return The conversion result is returned.
3081 s_chtml30_end_dd_tag(void *pdoc, Node *UNUSED(child))
3083 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3085 return chtml30->out;
3090 * It is a handler who processes the MARQUEE tag.
3092 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3093 * destination is specified.
3094 * @param node [i] The MARQUEE tag node is specified.
3095 * @return The conversion result is returned.
3098 s_chtml30_start_marquee_tag(void *pdoc, Node *node)
3100 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3101 Doc *doc = chtml30->doc;
3104 /*--------------------------------------------------------------------------*/
3105 /* Get Attributes */
3106 /*--------------------------------------------------------------------------*/
3107 for (attr = qs_get_attr(doc,node);
3109 attr = qs_get_next_attr(doc,attr)) {
3110 char *name = qs_get_attr_name(doc,attr);
3111 char *value = qs_get_attr_value(doc,attr);
3112 if (STRCASEEQ('d','D',"direction", name)) {
3113 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3114 W_L(" direction=\"");
3119 else if (STRCASEEQ('b','B',"behavior",name)) {
3120 if (value && (STRCASEEQ('s','S',"scroll",value) || STRCASEEQ('s','S',"slide",value) || STRCASEEQ('a','A',"alternate",value))) {
3121 W_L(" behavior=\"");
3126 else if (STRCASEEQ('l','L',"loop",name)) {
3127 if (value && *value) {
3135 return chtml30->out;
3140 * It is a handler who processes the MARQUEE tag.
3142 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3143 * destination is specified.
3144 * @param node [i] The MARQUEE tag node is specified.
3145 * @return The conversion result is returned.
3148 s_chtml30_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3150 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3151 Doc *doc = chtml30->doc;
3153 return chtml30->out;
3158 * It is a handler who processes the BLINK tag.
3160 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3161 * destination is specified.
3162 * @param node [i] The BLINK tag node is specified.
3163 * @return The conversion result is returned.
3166 s_chtml30_start_blink_tag(void *pdoc, Node *UNUSED(child))
3168 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3169 Doc *doc = chtml30->doc;
3171 return chtml30->out;
3176 * It is a handler who processes the BLINK tag.
3178 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3179 * destination is specified.
3180 * @param node [i] The BLINK tag node is specified.
3181 * @return The conversion result is returned.
3184 s_chtml30_end_blink_tag(void *pdoc, Node *UNUSED(child))
3186 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3187 Doc *doc = chtml30->doc;
3189 return chtml30->out;
3194 * It is a handler who processes the MENU tag.
3196 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3197 * destination is specified.
3198 * @param node [i] The MENU tag node is specified.
3199 * @return The conversion result is returned.
3202 s_chtml30_start_menu_tag(void *pdoc, Node *UNUSED(child))
3204 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3205 Doc *doc = chtml30->doc;
3207 return chtml30->out;
3212 * It is a handler who processes the MENU tag.
3214 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3215 * destination is specified.
3216 * @param node [i] The MENU tag node is specified.
3217 * @return The conversion result is returned.
3220 s_chtml30_end_menu_tag(void *pdoc, Node *UNUSED(child))
3222 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3223 Doc *doc = chtml30->doc;
3225 return chtml30->out;
3230 * It is a handler who processes the PLAINTEXT tag.
3232 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3233 * destination is specified.
3234 * @param node [i] The PLAINTEXT tag node is specified.
3235 * @return The conversion result is returned.
3238 s_chtml30_start_plaintext_tag(void *pdoc, Node *node)
3240 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3241 Doc *doc = chtml30->doc;
3243 s_chtml30_start_plaintext_tag_inner(pdoc,node);
3244 return chtml30->out;
3248 s_chtml30_start_plaintext_tag_inner(void *pdoc, Node *node)
3250 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3251 Doc *doc = chtml30->doc;
3253 for (child = qs_get_child_node(doc, node);
3255 child = qs_get_next_node(doc, child)) {
3257 s_chtml30_start_plaintext_tag_inner(pdoc, child);
3259 return chtml30->out;
3264 * It is a handler who processes the PLAINTEXT tag.
3266 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3267 * destination is specified.
3268 * @param node [i] The PLAINTEXT tag node is specified.
3269 * @return The conversion result is returned.
3272 s_chtml30_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3274 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3275 return chtml30->out;
3280 * * It is handler who processes the New Line Code.
3283 s_chtml30_newline_mark(void *pdoc, Node *UNUSED(node))
3285 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3286 Doc *doc = chtml30->doc;
3288 return chtml30->out;