2 * Copyright (C) 2005-2008 Atsushi Konno All rights reserved.
3 * Copyright (C) 2005 QSDN,Inc. All rights reserved.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 #include "chxj_chtml50.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_CHTML50(X) ((chtml50_t *)(X))
30 #define W_L(X) do { chtml50->out = BUFFERED_WRITE_LITERAL(chtml50->out, &doc->buf, (X)); } while(0)
31 #define W_V(X) do { chtml50->out = (X) ? BUFFERED_WRITE_VALUE(chtml50->out, &doc->buf, (X)) \
32 : BUFFERED_WRITE_LITERAL(chtml50->out, &doc->buf, ""); } while(0)
34 #define W_NLCODE() do { char *nlcode = TO_NLCODE(chtml50->conf); W_V(nlcode); } while (0)
36 static char *s_chtml50_start_html_tag (void *pdoc, Node *node);
37 static char *s_chtml50_end_html_tag (void *pdoc, Node *node);
38 static char *s_chtml50_start_meta_tag (void *pdoc, Node *node);
39 static char *s_chtml50_end_meta_tag (void *pdoc, Node *node);
40 static char *s_chtml50_start_textarea_tag (void *pdoc, Node *node);
41 static char *s_chtml50_end_textarea_tag (void *pdoc, Node *node);
42 static char *s_chtml50_start_p_tag (void *pdoc, Node *node);
43 static char *s_chtml50_end_p_tag (void *pdoc, Node *node);
44 static char *s_chtml50_start_pre_tag (void *pdoc, Node *node);
45 static char *s_chtml50_end_pre_tag (void *pdoc, Node *node);
46 static char *s_chtml50_start_h1_tag (void *pdoc, Node *node);
47 static char *s_chtml50_end_h1_tag (void *pdoc, Node *node);
48 static char *s_chtml50_start_h2_tag (void *pdoc, Node *node);
49 static char *s_chtml50_end_h2_tag (void *pdoc, Node *node);
50 static char *s_chtml50_start_h3_tag (void *pdoc, Node *node);
51 static char *s_chtml50_end_h3_tag (void *pdoc, Node *node);
52 static char *s_chtml50_start_h4_tag (void *pdoc, Node *node);
53 static char *s_chtml50_end_h4_tag (void *pdoc, Node *node);
54 static char *s_chtml50_start_h5_tag (void *pdoc, Node *node);
55 static char *s_chtml50_end_h5_tag (void *pdoc, Node *node);
56 static char *s_chtml50_start_h6_tag (void *pdoc, Node *node);
57 static char *s_chtml50_end_h6_tag (void *pdoc, Node *node);
58 static char *s_chtml50_start_ul_tag (void *pdoc, Node *node);
59 static char *s_chtml50_end_ul_tag (void *pdoc, Node *node);
60 static char *s_chtml50_start_ol_tag (void *pdoc, Node *node);
61 static char *s_chtml50_end_ol_tag (void *pdoc, Node *node);
62 static char *s_chtml50_start_li_tag (void *pdoc, Node *node);
63 static char *s_chtml50_end_li_tag (void *pdoc, Node *node);
64 static char *s_chtml50_start_head_tag (void *pdoc, Node *node);
65 static char *s_chtml50_end_head_tag (void *pdoc, Node *node);
66 static char *s_chtml50_start_title_tag (void *pdoc, Node *node);
67 static char *s_chtml50_end_title_tag (void *pdoc, Node *node);
68 static char *s_chtml50_start_base_tag (void *pdoc, Node *node);
69 static char *s_chtml50_end_base_tag (void *pdoc, Node *node);
70 static char *s_chtml50_start_body_tag (void *pdoc, Node *node);
71 static char *s_chtml50_end_body_tag (void *pdoc, Node *node);
72 static char *s_chtml50_start_a_tag (void *pdoc, Node *node);
73 static char *s_chtml50_end_a_tag (void *pdoc, Node *node);
74 static char *s_chtml50_start_br_tag (void *pdoc, Node *node);
75 static char *s_chtml50_end_br_tag (void *pdoc, Node *node);
76 static char *s_chtml50_start_tr_tag (void *pdoc, Node *node);
77 static char *s_chtml50_end_tr_tag (void *pdoc, Node *node);
78 static char *s_chtml50_start_font_tag (void *pdoc, Node *node);
79 static char *s_chtml50_end_font_tag (void *pdoc, Node *node);
80 static char *s_chtml50_start_form_tag (void *pdoc, Node *node);
81 static char *s_chtml50_end_form_tag (void *pdoc, Node *node);
82 static char *s_chtml50_start_input_tag (void *pdoc, Node *node);
83 static char *s_chtml50_end_input_tag (void *pdoc, Node *node);
84 static char *s_chtml50_start_center_tag (void *pdoc, Node *node);
85 static char *s_chtml50_end_center_tag (void *pdoc, Node *node);
86 static char *s_chtml50_start_hr_tag (void *pdoc, Node *node);
87 static char *s_chtml50_end_hr_tag (void *pdoc, Node *node);
88 static char *s_chtml50_start_img_tag (void *pdoc, Node *node);
89 static char *s_chtml50_end_img_tag (void *pdoc, Node *node);
90 static char *s_chtml50_start_select_tag (void *pdoc, Node *node);
91 static char *s_chtml50_end_select_tag (void *pdoc, Node *node);
92 static char *s_chtml50_start_option_tag (void *pdoc, Node *node);
93 static char *s_chtml50_end_option_tag (void *pdoc, Node *node);
94 static char *s_chtml50_start_div_tag (void *pdoc, Node *node);
95 static char *s_chtml50_end_div_tag (void *pdoc, Node *node);
96 static char *s_chtml50_chxjif_tag (void *pdoc, Node *node);
97 static char *s_chtml50_text_tag (void *pdoc, Node *node);
98 static char *s_chtml50_start_blockquote_tag(void *pdoc, Node *node);
99 static char *s_chtml50_end_blockquote_tag (void *pdoc, Node *node);
100 static char *s_chtml50_start_dir_tag (void *pdoc, Node *node);
101 static char *s_chtml50_end_dir_tag (void *pdoc, Node *node);
102 static char *s_chtml50_start_dl_tag (void *pdoc, Node *node);
103 static char *s_chtml50_end_dl_tag (void *pdoc, Node *node);
104 static char *s_chtml50_start_dt_tag (void *pdoc, Node *node);
105 static char *s_chtml50_end_dt_tag (void *pdoc, Node *node);
106 static char *s_chtml50_start_dd_tag (void *pdoc, Node *node);
107 static char *s_chtml50_end_dd_tag (void *pdoc, Node *node);
108 static char *s_chtml50_start_marquee_tag (void *pdoc, Node *node);
109 static char *s_chtml50_end_marquee_tag (void *pdoc, Node *node);
110 static char *s_chtml50_start_blink_tag (void *pdoc, Node *node);
111 static char *s_chtml50_end_blink_tag (void *pdoc, Node *node);
112 static char *s_chtml50_start_menu_tag (void *pdoc, Node *node);
113 static char *s_chtml50_end_menu_tag (void *pdoc, Node *node);
114 static char *s_chtml50_start_plaintext_tag (void *pdoc, Node *node);
115 static char *s_chtml50_start_plaintext_tag_inner (void *pdoc, Node *node);
116 static char *s_chtml50_end_plaintext_tag (void *pdoc, Node *node);
117 static char *s_chtml50_newline_mark (void *pdoc, Node *node);
119 static void s_init_chtml50(chtml50_t *chtml, Doc *doc, request_rec *r, device_table *spec);
121 static int s_chtml50_search_emoji(chtml50_t *chtml, char *txt, char **rslt);
124 tag_handler chtml50_handler[] = {
127 s_chtml50_start_html_tag,
128 s_chtml50_end_html_tag,
132 s_chtml50_start_meta_tag,
133 s_chtml50_end_meta_tag,
137 s_chtml50_start_textarea_tag,
138 s_chtml50_end_textarea_tag,
142 s_chtml50_start_p_tag,
147 s_chtml50_start_pre_tag,
148 s_chtml50_end_pre_tag,
152 s_chtml50_start_ul_tag,
153 s_chtml50_end_ul_tag,
157 s_chtml50_start_li_tag,
158 s_chtml50_end_li_tag,
162 s_chtml50_start_ol_tag,
163 s_chtml50_end_ol_tag,
167 s_chtml50_start_h1_tag,
168 s_chtml50_end_h1_tag,
172 s_chtml50_start_h2_tag,
173 s_chtml50_end_h2_tag,
177 s_chtml50_start_h3_tag,
178 s_chtml50_end_h3_tag,
182 s_chtml50_start_h4_tag,
183 s_chtml50_end_h4_tag,
187 s_chtml50_start_h5_tag,
188 s_chtml50_end_h5_tag,
192 s_chtml50_start_h6_tag,
193 s_chtml50_end_h6_tag,
197 s_chtml50_start_head_tag,
198 s_chtml50_end_head_tag,
202 s_chtml50_start_title_tag,
203 s_chtml50_end_title_tag,
207 s_chtml50_start_base_tag,
208 s_chtml50_end_base_tag,
212 s_chtml50_start_body_tag,
213 s_chtml50_end_body_tag,
217 s_chtml50_start_a_tag,
222 s_chtml50_start_br_tag,
223 s_chtml50_end_br_tag,
232 s_chtml50_start_tr_tag,
233 s_chtml50_end_tr_tag,
247 s_chtml50_start_font_tag,
248 s_chtml50_end_font_tag,
252 s_chtml50_start_form_tag,
253 s_chtml50_end_form_tag,
257 s_chtml50_start_input_tag,
258 s_chtml50_end_input_tag,
262 s_chtml50_start_center_tag,
263 s_chtml50_end_center_tag,
267 s_chtml50_start_hr_tag,
268 s_chtml50_end_hr_tag,
272 s_chtml50_start_img_tag,
273 s_chtml50_end_img_tag,
277 s_chtml50_start_select_tag,
278 s_chtml50_end_select_tag,
282 s_chtml50_start_option_tag,
283 s_chtml50_end_option_tag,
287 s_chtml50_start_div_tag,
288 s_chtml50_end_div_tag,
292 s_chtml50_chxjif_tag,
337 s_chtml50_start_dt_tag,
338 s_chtml50_end_dt_tag,
352 s_chtml50_start_blockquote_tag,
353 s_chtml50_end_blockquote_tag,
357 s_chtml50_start_dir_tag,
358 s_chtml50_end_dir_tag,
362 s_chtml50_start_dl_tag,
363 s_chtml50_end_dl_tag,
367 s_chtml50_start_dd_tag,
368 s_chtml50_end_dd_tag,
372 s_chtml50_start_menu_tag,
373 s_chtml50_end_menu_tag,
377 s_chtml50_start_plaintext_tag,
378 s_chtml50_end_plaintext_tag,
382 s_chtml50_start_blink_tag,
383 s_chtml50_end_blink_tag,
387 s_chtml50_start_marquee_tag,
388 s_chtml50_end_marquee_tag,
392 s_chtml50_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_chtml50(
414 chxjconvrule_entry *entryp,
423 DBG(r, "start chxj_convert_chtml50()");
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_chtml50()");
435 DBG(r,"not found qrcode xml");
437 /*--------------------------------------------------------------------------*/
438 /* The CHTML structure is initialized. */
439 /*--------------------------------------------------------------------------*/
440 s_init_chtml50(&chtml50, &doc, r, spec);
442 chtml50.entryp = entryp;
443 chtml50.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*)&chtml50, &doc, qs_get_root(&doc), 0);
468 chtml50.out = chxj_buffered_write_flush(chtml50.out, &doc.buf);
469 dst = apr_pstrdup(r->pool, chtml50.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_chtml50()");
493 * The CHTML structure is initialized.
495 * @param chtml50 [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_chtml50(chtml50_t *chtml50, Doc *doc, request_rec *r, device_table *spec)
505 memset(doc, 0, sizeof(Doc));
506 memset(chtml50, 0, sizeof(chtml50_t));
510 chtml50->spec = spec;
511 chtml50->out = qs_alloc_zero_byte_string(r->pool);
512 chtml50->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
513 chtml50->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 chtml50 [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_chtml50_search_emoji(chtml50_t *chtml50, char *txt, char **rslt)
536 spec = chtml50->spec;
542 DBG(r,"spec is NULL");
545 for (ee = chtml50->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_chtml50_start_html_tag(void *pdoc, Node *UNUSED(node))
584 chtml50_t *chtml50 = GET_CHTML50(pdoc);
585 Doc *doc = chtml50->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_chtml50_end_html_tag(void *pdoc, Node *UNUSED(child))
607 chtml50_t *chtml50 = GET_CHTML50(pdoc);
608 Doc *doc = chtml50->doc;
617 * It is a handler who processes the META tag.
619 * @param pdoc [i/o] The pointer to the CHTML structure at the output
620 * destination is specified.
621 * @param node [i] The META tag node is specified.
622 * @return The conversion result is returned.
625 s_chtml50_start_meta_tag(void *pdoc, Node *node)
631 int content_type_flag;
634 chtml50 = GET_CHTML50(pdoc);
638 content_type_flag = 0;
642 /*--------------------------------------------------------------------------*/
644 /*--------------------------------------------------------------------------*/
645 for (attr = qs_get_attr(doc,node);
647 attr = qs_get_next_attr(doc,attr)) {
648 char *name = qs_get_attr_name(doc,attr);
649 char *value = qs_get_attr_value(doc,attr);
653 if (strcasecmp(name, "http-equiv") == 0 && value && *value) {
654 /*----------------------------------------------------------------------*/
656 /*----------------------------------------------------------------------*/
657 W_L(" http-equiv=\"");
660 if (STRCASEEQ('c','C',"content-type", value))
661 content_type_flag = 1;
663 if (STRCASEEQ('r','R',"refresh", value))
670 if (strcasecmp(name, "content") == 0 && value && *value) {
671 if (content_type_flag) {
675 W_V(chxj_header_inf_set_content_type(r, "text/html; charset=SHIFT_JIS"));
683 buf = apr_pstrdup(r->pool, value);
684 url = strchr(buf, ';');
686 sec = apr_pstrdup(r->pool, buf);
689 url = chxj_encoding_parameter(r, url);
690 url = chxj_add_cookie_parameter(r, url, chtml50->cookie);
721 * It is a handler who processes the META tag.
723 * @param pdoc [i/o] The pointer to the CHTML structure at the output
724 * destination is specified.
725 * @param node [i] The META tag node is specified.
726 * @return The conversion result is returned.
729 s_chtml50_end_meta_tag(void* pdoc, Node* UNUSED(child))
731 chtml50_t *chtml50 = GET_CHTML50(pdoc);
738 * It is a handler who processes the HEAD tag.
740 * @param pdoc [i/o] The pointer to the CHTML structure at the output
741 * destination is specified.
742 * @param node [i] The HEAD tag node is specified.
743 * @return The conversion result is returned.
746 s_chtml50_start_head_tag(void* pdoc, Node* UNUSED(node))
748 chtml50_t *chtml50 = GET_CHTML50(pdoc);
749 Doc *doc = chtml50->doc;
758 * It is a handler who processes the HEAD tag.
760 * @param pdoc [i/o] The pointer to the CHTML structure at the output
761 * destination is specified.
762 * @param node [i] The HEAD tag node is specified.
763 * @return The conversion result is returned.
766 s_chtml50_end_head_tag(void *pdoc, Node *UNUSED(node))
768 chtml50_t *chtml50 = GET_CHTML50(pdoc);
769 Doc *doc = chtml50->doc;
778 * It is a handler who processes the TITLE tag.
780 * @param pdoc [i/o] The pointer to the CHTML structure at the output
781 * destination is specified.
782 * @param node [i] The TITLE tag node is specified.
783 * @return The conversion result is returned.
786 s_chtml50_start_title_tag(void *pdoc, Node *UNUSED(node))
788 chtml50_t *chtml50 = GET_CHTML50(pdoc);
789 Doc *doc = chtml50->doc;
798 * It is a handler who processes the TITLE tag.
800 * @param pdoc [i/o] The pointer to the CHTML structure at the output
801 * destination is specified.
802 * @param node [i] The TITLE tag node is specified.
803 * @return The conversion result is returned.
806 s_chtml50_end_title_tag(void *pdoc, Node *UNUSED(child))
808 chtml50_t *chtml50 = GET_CHTML50(pdoc);
809 Doc *doc = chtml50->doc;
818 * It is a handler who processes the BASE tag.
820 * @param pdoc [i/o] The pointer to the CHTML structure at the output
821 * destination is specified.
822 * @param node [i] The BASE tag node is specified.
823 * @return The conversion result is returned.
826 s_chtml50_start_base_tag(void *pdoc, Node *node)
833 chtml50 = GET_CHTML50(pdoc);
838 /*--------------------------------------------------------------------------*/
840 /*--------------------------------------------------------------------------*/
841 for (attr = qs_get_attr(doc,node);
843 attr = qs_get_next_attr(doc,attr)) {
844 char *name = qs_get_attr_name(doc,attr);
845 char *value = qs_get_attr_value(doc,attr);
846 if (STRCASEEQ('h','H',"href", name)) {
859 * It is a handler who processes the BASE tag.
861 * @param pdoc [i/o] The pointer to the CHTML structure at the output
862 * destination is specified.
863 * @param node [i] The BASE tag node is specified.
864 * @return The conversion result is returned.
867 s_chtml50_end_base_tag(void *pdoc, Node *UNUSED(child))
869 chtml50_t *chtml50 = GET_CHTML50(pdoc);
876 * It is a handler who processes the BODY tag.
878 * @param pdoc [i/o] The pointer to the CHTML structure at the output
879 * destination is specified.
880 * @param node [i] The BODY tag node is specified.
881 * @return The conversion result is returned.
884 s_chtml50_start_body_tag(void *pdoc, Node *node)
891 chtml50 = GET_CHTML50(pdoc);
896 /*--------------------------------------------------------------------------*/
898 /*--------------------------------------------------------------------------*/
899 for (attr = qs_get_attr(doc,node);
901 attr = qs_get_next_attr(doc,attr)) {
902 char *name = qs_get_attr_name(doc,attr);
903 char *value = qs_get_attr_value(doc,attr);
904 if (STRCASEEQ('b','B', "bgcolor", name) && value && *value) {
905 /*----------------------------------------------------------------------*/
907 /*----------------------------------------------------------------------*/
912 else if (STRCASEEQ('t','T', "text", name) && value && *value) {
913 /*----------------------------------------------------------------------*/
915 /*----------------------------------------------------------------------*/
920 else if (STRCASEEQ('l','L',"link", name) && value && *value) {
921 /*----------------------------------------------------------------------*/
923 /*----------------------------------------------------------------------*/
928 else if (STRCASEEQ('a','A',"alink", name) && value && *value) {
929 /*----------------------------------------------------------------------*/
931 /*----------------------------------------------------------------------*/
936 else if (STRCASEEQ('v','V',"vlink", name) && value && *value) {
937 /*----------------------------------------------------------------------*/
939 /*----------------------------------------------------------------------*/
952 * It is a handler who processes the BODY tag.
954 * @param pdoc [i/o] The pointer to the CHTML structure at the output
955 * destination is specified.
956 * @param node [i] The BODY tag node is specified.
957 * @return The conversion result is returned.
960 s_chtml50_end_body_tag(void *pdoc, Node *UNUSED(child))
965 chtml50 = GET_CHTML50(pdoc);
975 * It is a handler who processes the A tag.
977 * @param pdoc [i/o] The pointer to the CHTML structure at the output
978 * destination is specified.
979 * @param node [i] The A tag node is specified.
980 * @return The conversion result is returned.
983 s_chtml50_start_a_tag(void *pdoc, Node *node)
990 chtml50 = GET_CHTML50(pdoc);
995 /*--------------------------------------------------------------------------*/
997 /*--------------------------------------------------------------------------*/
998 for (attr = qs_get_attr(doc,node);
1000 attr = qs_get_next_attr(doc,attr)) {
1001 char *name = qs_get_attr_name(doc,attr);
1002 char *value = qs_get_attr_value(doc,attr);
1003 if (STRCASEEQ('n','N',"name", name)) {
1004 /*----------------------------------------------------------------------*/
1006 /*----------------------------------------------------------------------*/
1011 else if (STRCASEEQ('h','H',"href", name)) {
1012 /*----------------------------------------------------------------------*/
1014 /*----------------------------------------------------------------------*/
1015 value = chxj_encoding_parameter(r, value);
1016 if (! chxj_starts_with(value, "mailto:") && ! chxj_starts_with(value, "telto:")) {
1017 value = chxj_add_cookie_parameter(r, value, chtml50->cookie);
1023 else if (STRCASEEQ('a','A',"accesskey", name)) {
1024 /*----------------------------------------------------------------------*/
1026 /*----------------------------------------------------------------------*/
1027 W_L(" accesskey=\"");
1031 else if (STRCASEEQ('c','C',"cti", name)) {
1032 /*----------------------------------------------------------------------*/
1034 /*----------------------------------------------------------------------*/
1039 else if (STRCASEEQ('i','I',"ijam", name)) {
1040 /*----------------------------------------------------------------------*/
1042 /*----------------------------------------------------------------------*/
1045 else if (STRCASEEQ('u','U',"utn", name)) {
1046 /*----------------------------------------------------------------------*/
1048 /* It is special only for CHTML. */
1049 /*----------------------------------------------------------------------*/
1052 else if (STRCASEEQ('t','T',"telbook", name)) {
1053 /*----------------------------------------------------------------------*/
1055 /*----------------------------------------------------------------------*/
1058 else if (STRCASEEQ('k','K',"kana", name)) {
1059 /*----------------------------------------------------------------------*/
1061 /*----------------------------------------------------------------------*/
1064 else if (STRCASEEQ('e','E',"email", name)) {
1065 /*----------------------------------------------------------------------*/
1067 /*----------------------------------------------------------------------*/
1070 else if (STRCASEEQ('i','I',"ista", name)) {
1071 /*----------------------------------------------------------------------*/
1073 /*----------------------------------------------------------------------*/
1076 else if (STRCASEEQ('i','I',"ilet", name)) {
1077 /*----------------------------------------------------------------------*/
1079 /*----------------------------------------------------------------------*/
1082 else if (STRCASEEQ('i','I',"iswf", name)) {
1083 /*----------------------------------------------------------------------*/
1085 /*----------------------------------------------------------------------*/
1088 else if (STRCASEEQ('i','I',"irst", name)) {
1089 /*----------------------------------------------------------------------*/
1091 /*----------------------------------------------------------------------*/
1096 return chtml50->out;
1101 * It is a handler who processes the A tag.
1103 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1104 * destination is specified.
1105 * @param node [i] The A tag node is specified.
1106 * @return The conversion result is returned.
1109 s_chtml50_end_a_tag(void *pdoc, Node *UNUSED(child))
1114 chtml50 = GET_CHTML50(pdoc);
1119 return chtml50->out;
1124 * It is a handler who processes the BR tag.
1126 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1127 * destination is specified.
1128 * @param node [i] The BR tag node is specified.
1129 * @return The conversion result is returned.
1132 s_chtml50_start_br_tag(void *pdoc, Node *node)
1139 chtml50 = GET_CHTML50(pdoc);
1143 /*--------------------------------------------------------------------------*/
1144 /* Get Attributes */
1145 /*--------------------------------------------------------------------------*/
1146 for (attr = qs_get_attr(doc,node);
1148 attr = qs_get_next_attr(doc,attr)) {
1149 char *name = qs_get_attr_name(doc,attr);
1150 char *value = qs_get_attr_value(doc,attr);
1151 if (STRCASEEQ('c','C',"clear",name)) {
1152 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1160 return chtml50->out;
1165 * It is a handler who processes the BR tag.
1167 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1168 * destination is specified.
1169 * @param node [i] The BR tag node is specified.
1170 * @return The conversion result is returned.
1173 s_chtml50_end_br_tag(void *pdoc, Node *UNUSED(child))
1175 chtml50_t *chtml50 = GET_CHTML50(pdoc);
1177 return chtml50->out;
1182 * It is a handler who processes the TR tag.
1184 * @param chtml50 [i/o] The pointer to the CHTML structure at the output
1185 * destination is specified.
1186 * @param node [i] The TR tag node is specified.
1187 * @return The conversion result is returned.
1190 s_chtml50_start_tr_tag(void *pdoc, Node *UNUSED(node))
1192 chtml50_t *chtml50 = GET_CHTML50(pdoc);
1194 return chtml50->out;
1199 * It is a handler who processes the TR tag.
1201 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1202 * destination is specified.
1203 * @param node [i] The TR tag node is specified.
1204 * @return The conversion result is returned.
1207 s_chtml50_end_tr_tag(void *pdoc, Node *UNUSED(child))
1213 chtml50 = GET_CHTML50(pdoc);
1219 return chtml50->out;
1224 * It is a handler who processes the FONT tag.
1226 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1227 * destination is specified.
1228 * @param node [i] The FONT tag node is specified.
1229 * @return The conversion result is returned.
1232 s_chtml50_start_font_tag(void *pdoc, Node *node)
1241 chtml50 = GET_CHTML50(pdoc);
1245 /*--------------------------------------------------------------------------*/
1246 /* Get Attributes */
1247 /*--------------------------------------------------------------------------*/
1248 for (attr = qs_get_attr(doc,node);
1249 attr && (color == NULL || size == NULL);
1250 attr = qs_get_next_attr(doc,attr)) {
1251 char *name = qs_get_attr_name(doc,attr);
1252 char *value = qs_get_attr_value(doc,attr);
1253 if (STRCASEEQ('c','C',"color", name) && value && *value) {
1254 color = apr_pstrdup(doc->buf.pool, value);
1256 else if (STRCASEEQ('s','S',"size", name) && value && *value) {
1257 /*----------------------------------------------------------------------*/
1259 /*----------------------------------------------------------------------*/
1260 size = apr_pstrdup(doc->buf.pool, value);
1269 if (*(size + 1) == 0) {
1278 char ch = *(size + 1);
1279 if (ch == '1' || ch == '2' || ch == '3') {
1280 if (*(size + 2) == 0) {
1292 if (color && size) break;
1294 if (color || size) {
1307 chtml50->font_flag++;
1309 return chtml50->out;
1314 * It is a handler who processes the FONT tag.
1316 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1317 * destination is specified.
1318 * @param node [i] The FONT tag node is specified.
1319 * @return The conversion result is returned.
1322 s_chtml50_end_font_tag(void *pdoc, Node *UNUSED(child))
1328 chtml50 = GET_CHTML50(pdoc);
1332 if (chtml50->font_flag) {
1334 chtml50->font_flag--;
1337 return chtml50->out;
1342 * It is a handler who processes the FORM tag.
1344 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1345 * destination is specified.
1346 * @param node [i] The FORM tag node is specified.
1347 * @return The conversion result is returned.
1350 s_chtml50_start_form_tag(void *pdoc, Node *node)
1356 char *new_hidden_tag = NULL;
1357 char *attr_method = NULL;
1358 char *attr_action = NULL;
1359 char *attr_utn = NULL;
1361 chtml50 = GET_CHTML50(pdoc);
1365 /*--------------------------------------------------------------------------*/
1366 /* Get Attributes */
1367 /*--------------------------------------------------------------------------*/
1368 for (attr = qs_get_attr(doc,node);
1370 attr = qs_get_next_attr(doc,attr)) {
1371 char *name = qs_get_attr_name(doc,attr);
1372 char *value = qs_get_attr_value(doc,attr);
1373 if (STRCASEEQ('a','A',"action", name)) {
1374 /*----------------------------------------------------------------------*/
1376 /*----------------------------------------------------------------------*/
1377 attr_action = chxj_encoding_parameter(r, value);
1378 attr_action = chxj_add_cookie_parameter(r, attr_action, chtml50->cookie);
1380 else if (STRCASEEQ('m','M',"method", name)) {
1381 /*----------------------------------------------------------------------*/
1383 /*----------------------------------------------------------------------*/
1384 attr_method = apr_pstrdup(doc->pool, value);
1386 else if (STRCASEEQ('u','U',"utn", name)) {
1387 /*----------------------------------------------------------------------*/
1389 /* It is special only for CHTML. */
1390 /*----------------------------------------------------------------------*/
1395 int post_flag = (attr_method && strcasecmp(attr_method, "post") == 0) ? 1 : 0;
1400 char *new_query_string = NULL;
1401 q = strchr(attr_action, '?');
1403 new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 0, post_flag, &new_query_string, CHXJ_TRUE, CHXJ_FALSE);
1404 if (new_hidden_tag || new_query_string) {
1410 if (new_query_string) {
1412 W_V(new_query_string);
1425 if (new_hidden_tag) {
1426 W_V(new_hidden_tag);
1428 return chtml50->out;
1433 * It is a handler who processes the FORM tag.
1435 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1436 * destination is specified.
1437 * @param node [i] The FORM tag node is specified.
1438 * @return The conversion result is returned.
1441 s_chtml50_end_form_tag(void *pdoc, Node *UNUSED(child))
1446 chtml50 = GET_CHTML50(pdoc);
1451 return chtml50->out;
1456 * It is a handler who processes the INPUT tag.
1458 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1459 * destination is specified.
1460 * @param node [i] The INPUT tag node is specified.
1461 * @return The conversion result is returned.
1464 s_chtml50_start_input_tag(void *pdoc, Node *node)
1469 char *max_length = NULL;
1473 char *istyle = NULL;
1475 char *checked = NULL;
1476 char *accesskey = NULL;
1478 chtml50 = GET_CHTML50(pdoc);
1482 /*--------------------------------------------------------------------------*/
1483 /* Get Attributes */
1484 /*--------------------------------------------------------------------------*/
1485 type = qs_get_type_attr(doc, node, doc->buf.pool);
1486 name = qs_get_name_attr(doc, node, doc->buf.pool);
1487 value = qs_get_value_attr(doc,node, doc->buf.pool);
1488 istyle = qs_get_istyle_attr(doc,node,doc->buf.pool);
1489 max_length = qs_get_maxlength_attr(doc,node,doc->buf.pool);
1490 checked = qs_get_checked_attr(doc,node,doc->buf.pool);
1491 accesskey = qs_get_accesskey_attr(doc, node, doc->buf.pool);
1492 size = qs_get_size_attr(doc, node, doc->buf.pool);
1495 type = qs_trim_string(doc->buf.pool, type);
1496 if (type && (STRCASEEQ('t','T',"text", type) ||
1497 STRCASEEQ('p','P',"password",type) ||
1498 STRCASEEQ('c','C',"checkbox",type) ||
1499 STRCASEEQ('r','R',"radio", type) ||
1500 STRCASEEQ('h','H',"hidden", type) ||
1501 STRCASEEQ('s','S',"submit", type) ||
1502 STRCASEEQ('r','R',"reset", type))) {
1508 if (size && *size) {
1513 if (name && *name) {
1518 if (value && *value) {
1520 W_V(chxj_add_slash_to_doublequote(doc->pool, value));
1523 if (accesskey && *accesskey) {
1524 W_L(" accesskey=\"");
1529 /*------------------------------------------------------------------------*/
1531 /*------------------------------------------------------------------------*/
1532 if (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4') {
1539 /*--------------------------------------------------------------------------*/
1540 /* The figure is default for the password. */
1541 /*--------------------------------------------------------------------------*/
1542 if (max_length && *max_length) {
1543 if (chxj_chk_numeric(max_length) != 0) {
1544 max_length = apr_psprintf(r->pool, "0");
1546 if (istyle != NULL && *istyle == '1') {
1547 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length) * 2);
1551 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length));
1560 return chtml50->out;
1565 * It is a handler who processes the INPUT tag.
1567 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1568 * destination is specified.
1569 * @param node [i] The INPUT tag node is specified.
1570 * @return The conversion result is returned.
1573 s_chtml50_end_input_tag(void *pdoc, Node *UNUSED(child))
1575 chtml50_t *chtml50 = GET_CHTML50(pdoc);
1577 return chtml50->out;
1582 * It is a handler who processes the CENTER tag.
1584 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1585 * destination is specified.
1586 * @param node [i] The CENTER tag node is specified.
1587 * @return The conversion result is returned.
1590 s_chtml50_start_center_tag(void *pdoc, Node *UNUSED(node))
1595 chtml50 = GET_CHTML50(pdoc);
1600 return chtml50->out;
1605 * It is a handler who processes the CENTER tag.
1607 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1608 * destination is specified.
1609 * @param node [i] The CENTER tag node is specified.
1610 * @return The conversion result is returned.
1613 s_chtml50_end_center_tag(void *pdoc, Node *UNUSED(child))
1618 chtml50 = GET_CHTML50(pdoc);
1623 return chtml50->out;
1628 * It is a handler who processes the HR tag.
1630 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1631 * destination is specified.
1632 * @param node [i] The HR tag node is specified.
1633 * @return The conversion result is returned.
1636 s_chtml50_start_hr_tag(void *pdoc, Node *node)
1643 chtml50 = GET_CHTML50(pdoc);
1649 for (attr = qs_get_attr(doc,node);
1651 attr = qs_get_next_attr(doc,attr)) {
1652 char *name = qs_get_attr_name(doc,attr);
1653 char *value = qs_get_attr_value(doc,attr);
1654 if (STRCASEEQ('a','A',"align", name)) {
1655 /*----------------------------------------------------------------------*/
1657 /*----------------------------------------------------------------------*/
1658 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1664 else if (STRCASEEQ('s','S',"size", name)) {
1665 /*----------------------------------------------------------------------*/
1667 /*----------------------------------------------------------------------*/
1668 if (value && *value) {
1674 else if (STRCASEEQ('w','W',"width", name)) {
1675 /*----------------------------------------------------------------------*/
1677 /*----------------------------------------------------------------------*/
1678 if (value && *value) {
1684 else if (STRCASEEQ('n','N',"noshade", name)) {
1685 /*----------------------------------------------------------------------*/
1687 /*----------------------------------------------------------------------*/
1690 else if (STRCASEEQ('c','C',"color", name) && value && *value) {
1691 /*----------------------------------------------------------------------*/
1693 /*----------------------------------------------------------------------*/
1701 return chtml50->out;
1706 * It is a handler who processes the HR tag.
1708 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1709 * destination is specified.
1710 * @param node [i] The HR tag node is specified.
1711 * @return The conversion result is returned.
1714 s_chtml50_end_hr_tag(void *pdoc, Node *UNUSED(child))
1716 chtml50_t *chtml50 = GET_CHTML50(pdoc);
1718 return chtml50->out;
1723 * It is a handler who processes the IMG tag.
1725 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1726 * destination is specified.
1727 * @param node [i] The IMG tag node is specified.
1728 * @return The conversion result is returned.
1731 s_chtml50_start_img_tag(void *pdoc, Node *node)
1733 #ifndef IMG_NOT_CONVERT_FILENAME
1741 chtml50 = GET_CHTML50(pdoc);
1744 #ifndef IMG_NOT_CONVERT_FILENAME
1745 spec = chtml50->spec;
1749 /*--------------------------------------------------------------------------*/
1750 /* Get Attributes */
1751 /*--------------------------------------------------------------------------*/
1752 for (attr = qs_get_attr(doc,node);
1754 attr = qs_get_next_attr(doc,attr)) {
1755 char *name = qs_get_attr_name(doc,attr);
1756 char *value = qs_get_attr_value(doc,attr);
1757 if (STRCASEEQ('s','S',"src", name)) {
1758 /*----------------------------------------------------------------------*/
1760 /*----------------------------------------------------------------------*/
1761 #ifdef IMG_NOT_CONVERT_FILENAME
1762 value = chxj_encoding_parameter(r, value);
1763 value = chxj_add_cookie_parameter(r, value, chtml50->cookie);
1764 value = chxj_add_cookie_no_update_parameter(r, value);
1769 value = chxj_img_conv(r,spec,value);
1770 value = chxj_encoding_parameter(r, value);
1771 value = chxj_add_cookie_parameter(r, value, chtml50->cookie);
1772 value = chxj_add_cookie_no_update_parameter(r, value);
1778 else if (STRCASEEQ('a','A',"align", name)) {
1779 /*----------------------------------------------------------------------*/
1781 /*----------------------------------------------------------------------*/
1783 if (STRCASEEQ('t','T',"top", value) ||
1784 STRCASEEQ('m','M',"middle",value) ||
1785 STRCASEEQ('b','B',"bottom",value) ||
1786 STRCASEEQ('l','L',"left", value) ||
1787 STRCASEEQ('c','C',"center", value) ||
1788 STRCASEEQ('r','R',"right", value)) {
1795 else if (STRCASEEQ('w','W',"width", name) && value && *value) {
1796 /*----------------------------------------------------------------------*/
1798 /*----------------------------------------------------------------------*/
1803 else if (STRCASEEQ('h','H', "height", name) && value && *value) {
1804 /*----------------------------------------------------------------------*/
1806 /*----------------------------------------------------------------------*/
1811 else if (STRCASEEQ('h','H',"hspace", name) && value && *value) {
1812 /*----------------------------------------------------------------------*/
1814 /*----------------------------------------------------------------------*/
1819 else if (STRCASEEQ('v','V',"vspace", name) && value && *value) {
1820 /*----------------------------------------------------------------------*/
1822 /*----------------------------------------------------------------------*/
1827 else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
1828 /*----------------------------------------------------------------------*/
1830 /*----------------------------------------------------------------------*/
1838 return chtml50->out;
1843 * It is a handler who processes the IMG tag.
1845 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1846 * destination is specified.
1847 * @param node [i] The IMG tag node is specified.
1848 * @return The conversion result is returned.
1851 s_chtml50_end_img_tag(void *pdoc, Node *UNUSED(child))
1853 chtml50_t *chtml50 = GET_CHTML50(pdoc);
1855 return chtml50->out;
1860 * It is a handler who processes the SELECT tag.
1862 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1863 * destination is specified.
1864 * @param node [i] The SELECT tag node is specified.
1865 * @return The conversion result is returned.
1868 s_chtml50_start_select_tag(void *pdoc, Node *child)
1870 chtml50_t *chtml50 = GET_CHTML50(pdoc);
1871 Doc *doc = chtml50->doc;
1874 char *multiple = NULL;
1878 for (attr = qs_get_attr(doc,child);
1880 attr = qs_get_next_attr(doc,attr)) {
1881 char *nm = qs_get_attr_name(doc,attr);
1882 char *val = qs_get_attr_value(doc,attr);
1883 if (STRCASEEQ('s','S',"size", nm)) {
1884 /*----------------------------------------------------------------------*/
1885 /* CHTML 1.0 version 2.0 */
1886 /*----------------------------------------------------------------------*/
1887 size = apr_pstrdup(doc->buf.pool, val);
1889 else if (STRCASEEQ('n','N',"name", nm)) {
1890 /*----------------------------------------------------------------------*/
1891 /* CHTML 1.0 version 2.0 */
1892 /*----------------------------------------------------------------------*/
1893 name = apr_pstrdup(doc->buf.pool, val);
1895 else if (STRCASEEQ('m','M',"multiple", nm)) {
1896 /*----------------------------------------------------------------------*/
1897 /* CHTML 1.0 version 2.0 */
1898 /*----------------------------------------------------------------------*/
1899 multiple = apr_pstrdup(doc->buf.pool, val);
1902 if (size && *size) {
1907 if (name && *name) {
1917 return chtml50->out;
1922 * It is a handler who processes the SELECT tag.
1924 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1925 * destination is specified.
1926 * @param node [i] The SELECT tag node is specified.
1927 * @return The conversion result is returned.
1930 s_chtml50_end_select_tag(void *pdoc, Node *UNUSED(child))
1932 chtml50_t *chtml50 = GET_CHTML50(pdoc);
1933 Doc *doc = chtml50->doc;
1937 return chtml50->out;
1942 * It is a handler who processes the OPTION tag.
1944 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1945 * destination is specified.
1946 * @param node [i] The OPTION tag node is specified.
1947 * @return The conversion result is returned.
1950 s_chtml50_start_option_tag(void *pdoc, Node *child)
1959 chtml50 = GET_CHTML50(pdoc);
1966 for (attr = qs_get_attr(doc,child);
1968 attr = qs_get_next_attr(doc,attr)) {
1969 char *nm = qs_get_attr_name(doc,attr);
1970 char *val = qs_get_attr_value(doc,attr);
1971 if (STRCASEEQ('s','S',"selected", nm)) {
1972 /*----------------------------------------------------------------------*/
1973 /* CHTML 1.0 version 2.0 */
1974 /*----------------------------------------------------------------------*/
1975 selected = apr_pstrdup(doc->buf.pool, val);
1977 else if (STRCASEEQ('v','V',"value", nm)) {
1978 /*----------------------------------------------------------------------*/
1979 /* CHTML 1.0 version 2.0 */
1980 /*----------------------------------------------------------------------*/
1981 value = apr_pstrdup(doc->buf.pool, val);
1984 if (value && *value) {
1993 return chtml50->out;
1998 * It is a handler who processes the OPTION tag.
2000 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2001 * destination is specified.
2002 * @param node [i] The OPTION tag node is specified.
2003 * @return The conversion result is returned.
2006 s_chtml50_end_option_tag(void *pdoc, Node *UNUSED(child))
2008 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2012 return chtml50->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_chtml50_start_div_tag(void *pdoc, Node *child)
2033 chtml50 = GET_CHTML50(pdoc);
2039 for (attr = qs_get_attr(doc,child);
2041 attr = qs_get_next_attr(doc,attr)) {
2042 char *nm = qs_get_attr_name(doc,attr);
2043 char *val = qs_get_attr_value(doc,attr);
2044 if (STRCASEEQ('a','A',"align", nm)) {
2045 /*----------------------------------------------------------------------*/
2046 /* CHTML 1.0 (W3C version 3.2) */
2047 /*----------------------------------------------------------------------*/
2048 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2049 align = apr_pstrdup(doc->buf.pool, val);
2060 return chtml50->out;
2065 * It is a handler who processes the DIV tag.
2067 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2068 * destination is specified.
2069 * @param node [i] The DIV tag node is specified.
2070 * @return The conversion result is returned.
2073 s_chtml50_end_div_tag(void *pdoc, Node *UNUSED(node))
2075 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2076 Doc *doc = chtml50->doc;
2080 return chtml50->out;
2085 * It is a handler who processes the UL tag.
2087 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2088 * destination is specified.
2089 * @param node [i] The UL tag node is specified.
2090 * @return The conversion result is returned.
2093 s_chtml50_start_ul_tag(void *pdoc, Node *node)
2095 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2096 Doc *doc = chtml50->doc;
2099 /*--------------------------------------------------------------------------*/
2100 /* Get Attributes */
2101 /*--------------------------------------------------------------------------*/
2102 for (attr = qs_get_attr(doc,node);
2104 attr = qs_get_next_attr(doc,attr)) {
2105 char *name = qs_get_attr_name(doc,attr);
2106 char *value = qs_get_attr_value(doc,attr);
2107 if (STRCASEEQ('t','T',"type",name)) {
2108 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
2116 return chtml50->out;
2121 * It is a handler who processes the UL tag.
2123 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2124 * destination is specified.
2125 * @param node [i] The UL tag node is specified.
2126 * @return The conversion result is returned.
2129 s_chtml50_end_ul_tag(void *pdoc, Node *UNUSED(child))
2131 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2132 Doc *doc = chtml50->doc;
2136 return chtml50->out;
2141 * It is a handler who processes the PRE tag.
2143 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2144 * destination is specified.
2145 * @param node [i] The PRE tag node is specified.
2146 * @return The conversion result is returned.
2149 s_chtml50_start_pre_tag(void *pdoc, Node *UNUSED(node))
2151 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2152 Doc *doc = chtml50->doc;
2154 chtml50->pre_flag++;
2157 return chtml50->out;
2162 * It is a handler who processes the PRE tag.
2164 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2165 * destination is specified.
2166 * @param node [i] The PRE tag node is specified.
2167 * @return The conversion result is returned.
2170 s_chtml50_end_pre_tag(void *pdoc, Node *UNUSED(child))
2172 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2173 Doc *doc = chtml50->doc;
2176 chtml50->pre_flag--;
2178 return chtml50->out;
2183 * It is a handler who processes the P tag.
2185 * @param pdoc [i/o] The pointer to the XHTML 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_chtml50_start_p_tag(void *pdoc, Node *node)
2199 chtml50 = GET_CHTML50(pdoc);
2204 for (attr = qs_get_attr(doc,node);
2206 attr = qs_get_next_attr(doc,attr)) {
2207 char *nm = qs_get_attr_name(doc,attr);
2208 char *val = qs_get_attr_value(doc,attr);
2209 if (STRCASEEQ('a','A',"align", nm)) {
2210 /*----------------------------------------------------------------------*/
2211 /* CHTML 1.0 (W3C version 3.2) */
2212 /*----------------------------------------------------------------------*/
2213 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2214 align = apr_pstrdup(doc->buf.pool, val);
2225 return chtml50->out;
2230 * It is a handler who processes the P tag.
2232 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2233 * destination is specified.
2234 * @param node [i] The P tag node is specified.
2235 * @return The conversion result is returned.
2238 s_chtml50_end_p_tag(void *pdoc, Node *UNUSED(child))
2243 chtml50 = GET_CHTML50(pdoc);
2248 return chtml50->out;
2253 * It is a handler who processes the OL tag.
2255 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2256 * destination is specified.
2257 * @param node [i] The OL tag node is specified.
2258 * @return The conversion result is returned.
2261 s_chtml50_start_ol_tag(void *pdoc, Node *node)
2268 chtml50 = GET_CHTML50(pdoc);
2273 /*--------------------------------------------------------------------------*/
2274 /* Get Attributes */
2275 /*--------------------------------------------------------------------------*/
2276 for (attr = qs_get_attr(doc,node);
2278 attr = qs_get_next_attr(doc,attr)) {
2279 char *name = qs_get_attr_name(doc,attr);
2280 char *value = qs_get_attr_value(doc,attr);
2281 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
2286 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
2294 return chtml50->out;
2299 * It is a handler who processes the OL tag.
2301 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2302 * destination is specified.
2303 * @param node [i] The OL tag node is specified.
2304 * @return The conversion result is returned.
2307 s_chtml50_end_ol_tag(void *pdoc, Node *UNUSED(node))
2309 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2310 Doc *doc = chtml50->doc;
2314 return chtml50->out;
2319 * It is a handler who processes the LI tag.
2321 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2322 * destination is specified.
2323 * @param node [i] The LI tag node is specified.
2324 * @return The conversion result is returned.
2327 s_chtml50_start_li_tag(void *pdoc, Node *node)
2329 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2330 Doc *doc = chtml50->doc;
2334 /*--------------------------------------------------------------------------*/
2335 /* Get Attributes */
2336 /*--------------------------------------------------------------------------*/
2337 for (attr = qs_get_attr(doc,node);
2339 attr = qs_get_next_attr(doc,attr)) {
2340 char *name = qs_get_attr_name(doc,attr);
2341 char *value = qs_get_attr_value(doc,attr);
2342 if (STRCASEEQ('t','T',"type",name)) {
2343 if (value && (*value == '1' || *value == 'a' || *value == 'A' || STRCASEEQ('d','D',"disc",value) || STRCASEEQ('s','S',"square",value) || STRCASEEQ('c','C',"circle",value))) {
2349 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
2356 return chtml50->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_chtml50_end_li_tag(void *pdoc, Node *UNUSED(child))
2371 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2373 return chtml50->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_chtml50_start_h1_tag(void *pdoc, Node *node)
2393 chtml50 = GET_CHTML50(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 chtml50->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_chtml50_end_h1_tag(void *pdoc, Node *UNUSED(child))
2432 chtml50 = GET_CHTML50(pdoc);
2437 return chtml50->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_chtml50_start_h2_tag(void *pdoc, Node *node)
2457 chtml50 = GET_CHTML50(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 chtml50->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_chtml50_end_h2_tag(void *pdoc, Node *UNUSED(child))
2492 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2493 Doc *doc = chtml50->doc;
2497 return chtml50->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_chtml50_start_h3_tag(void *pdoc, Node *node)
2517 chtml50 = GET_CHTML50(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 chtml50->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_chtml50_end_h3_tag(void *pdoc, Node *UNUSED(child))
2553 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2554 Doc *doc = chtml50->doc;
2558 return chtml50->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_chtml50_start_h4_tag(void *pdoc, Node *node)
2578 chtml50 = GET_CHTML50(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 chtml50->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_chtml50_end_h4_tag(void *pdoc, Node *UNUSED(child))
2613 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2614 Doc *doc = chtml50->doc;
2618 return chtml50->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_chtml50_start_h5_tag(void *pdoc, Node *node)
2638 chtml50 = GET_CHTML50(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 chtml50->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_chtml50_end_h5_tag(void *pdoc, Node *UNUSED(child))
2673 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2674 Doc *doc = chtml50->doc;
2678 return chtml50->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_chtml50_start_h6_tag(void *pdoc, Node *node)
2698 chtml50 = GET_CHTML50(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 chtml50->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_chtml50_end_h6_tag(void *pdoc, Node *UNUSED(child))
2733 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2734 Doc *doc = chtml50->doc;
2738 return chtml50->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_chtml50_start_textarea_tag(void *pdoc, Node *node)
2758 chtml50 = GET_CHTML50(pdoc);
2762 chtml50->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 chtml50->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_chtml50_end_textarea_tag(void *pdoc, Node *UNUSED(child))
2812 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2813 Doc *doc = chtml50->doc;
2816 chtml50->textarea_flag--;
2818 return chtml50->out;
2823 s_chtml50_chxjif_tag(void *pdoc, Node *node)
2830 chtml50 = GET_CHTML50(pdoc);
2834 for (child = qs_get_child_node(doc, node);
2836 child = qs_get_next_node(doc, child)) {
2838 s_chtml50_chxjif_tag(chtml50, child);
2846 s_chtml50_text_tag(void *pdoc, Node *child)
2859 chtml50 = GET_CHTML50(pdoc);
2863 textval = qs_get_node_value(doc,child);
2864 if (strlen(textval) == 0) {
2865 return chtml50->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_chtml50_search_emoji(chtml50, &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 (chtml50->pre_flag) {
2892 one_byte[0] = textval[ii+0];
2893 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2895 else if (chtml50->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 chtml50->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_chtml50_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
2920 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2921 Doc *doc = chtml50->doc;
2922 W_L("<blockquote>");
2923 return chtml50->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_chtml50_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
2938 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2939 Doc *doc = chtml50->doc;
2940 W_L("</blockquote>");
2941 return chtml50->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_chtml50_start_dir_tag(void *pdoc, Node *node)
2956 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2957 Doc *doc = chtml50->doc;
2960 for (attr = qs_get_attr(doc,node);
2962 attr = qs_get_next_attr(doc,attr)) {
2963 char *name = qs_get_attr_name(doc,attr);
2964 char *value = qs_get_attr_value(doc,attr);
2965 if (STRCASEEQ('t','T',"type",name)) {
2966 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
2974 return chtml50->out;
2979 * It is a handler who processes the DIR tag.
2981 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2982 * destination is specified.
2983 * @param node [i] The DIR tag node is specified.
2984 * @return The conversion result is returned.
2987 s_chtml50_end_dir_tag(void *pdoc, Node *UNUSED(child))
2989 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2990 Doc *doc = chtml50->doc;
2992 return chtml50->out;
2997 * It is a handler who processes the DL tag.
2999 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3000 * destination is specified.
3001 * @param node [i] The DL tag node is specified.
3002 * @return The conversion result is returned.
3005 s_chtml50_start_dl_tag(void *pdoc, Node *UNUSED(child))
3007 chtml50_t *chtml50 = GET_CHTML50(pdoc);
3008 Doc *doc = chtml50->doc;
3010 return chtml50->out;
3015 * It is a handler who processes the DL tag.
3017 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3018 * destination is specified.
3019 * @param node [i] The DL tag node is specified.
3020 * @return The conversion result is returned.
3023 s_chtml50_end_dl_tag(void *pdoc, Node *UNUSED(child))
3025 chtml50_t *chtml50 = GET_CHTML50(pdoc);
3026 Doc *doc = chtml50->doc;
3028 return chtml50->out;
3033 * It is a handler who processes the DT tag.
3035 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3036 * destination is specified.
3037 * @param node [i] The DT tag node is specified.
3038 * @return The conversion result is returned.
3041 s_chtml50_start_dt_tag(void *pdoc, Node *UNUSED(child))
3043 chtml50_t *chtml50 = GET_CHTML50(pdoc);
3044 Doc *doc = chtml50->doc;
3046 return chtml50->out;
3051 * It is a handler who processes the DT tag.
3053 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3054 * destination is specified.
3055 * @param node [i] The DT tag node is specified.
3056 * @return The conversion result is returned.
3059 s_chtml50_end_dt_tag(void *pdoc, Node *UNUSED(child))
3061 chtml50_t *chtml50 = GET_CHTML50(pdoc);
3063 return chtml50->out;
3068 * It is a handler who processes the DD tag.
3070 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3071 * destination is specified.
3072 * @param node [i] The DD tag node is specified.
3073 * @return The conversion result is returned.
3076 s_chtml50_start_dd_tag(void *pdoc, Node *UNUSED(child))
3078 chtml50_t *chtml50 = GET_CHTML50(pdoc);
3079 Doc *doc = chtml50->doc;
3083 return chtml50->out;
3088 * It is a handler who processes the DD tag.
3090 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3091 * destination is specified.
3092 * @param node [i] The DD tag node is specified.
3093 * @return The conversion result is returned.
3096 s_chtml50_end_dd_tag(void *pdoc, Node *UNUSED(child))
3098 chtml50_t *chtml50 = GET_CHTML50(pdoc);
3100 return chtml50->out;
3105 * It is a handler who processes the MARQUEE tag.
3107 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3108 * destination is specified.
3109 * @param node [i] The MARQUEE tag node is specified.
3110 * @return The conversion result is returned.
3113 s_chtml50_start_marquee_tag(void *pdoc, Node *node)
3115 chtml50_t *chtml50 = GET_CHTML50(pdoc);
3116 Doc *doc = chtml50->doc;
3119 /*--------------------------------------------------------------------------*/
3120 /* Get Attributes */
3121 /*--------------------------------------------------------------------------*/
3122 for (attr = qs_get_attr(doc,node);
3124 attr = qs_get_next_attr(doc,attr)) {
3125 char *name = qs_get_attr_name(doc,attr);
3126 char *value = qs_get_attr_value(doc,attr);
3127 if (STRCASEEQ('d','D',"direction", name)) {
3128 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3129 W_L(" direction=\"");
3134 else if (STRCASEEQ('b','B',"behavior",name)) {
3135 if (value && (STRCASEEQ('s','S',"scroll",value) || STRCASEEQ('s','S',"slide",value) || STRCASEEQ('a','A',"alternate",value))) {
3136 W_L(" behavior=\"");
3141 else if (STRCASEEQ('l','L',"loop",name)) {
3142 if (value && *value) {
3148 else if (STRCASEEQ('b','B',"bgcolor",name)) {
3149 if (value && *value) {
3157 return chtml50->out;
3162 * It is a handler who processes the MARQUEE tag.
3164 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3165 * destination is specified.
3166 * @param node [i] The MARQUEE tag node is specified.
3167 * @return The conversion result is returned.
3170 s_chtml50_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3172 chtml50_t *chtml50 = GET_CHTML50(pdoc);
3173 Doc *doc = chtml50->doc;
3175 return chtml50->out;
3180 * It is a handler who processes the BLINK tag.
3182 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3183 * destination is specified.
3184 * @param node [i] The BLINK tag node is specified.
3185 * @return The conversion result is returned.
3188 s_chtml50_start_blink_tag(void *pdoc, Node *UNUSED(child))
3190 chtml50_t *chtml50 = GET_CHTML50(pdoc);
3191 Doc *doc = chtml50->doc;
3193 return chtml50->out;
3198 * It is a handler who processes the BLINK tag.
3200 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3201 * destination is specified.
3202 * @param node [i] The BLINK tag node is specified.
3203 * @return The conversion result is returned.
3206 s_chtml50_end_blink_tag(void *pdoc, Node *UNUSED(child))
3208 chtml50_t *chtml50 = GET_CHTML50(pdoc);
3209 Doc *doc = chtml50->doc;
3211 return chtml50->out;
3216 * It is a handler who processes the MENU tag.
3218 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3219 * destination is specified.
3220 * @param node [i] The MENU tag node is specified.
3221 * @return The conversion result is returned.
3224 s_chtml50_start_menu_tag(void *pdoc, Node *node)
3226 chtml50_t *chtml50 = GET_CHTML50(pdoc);
3227 Doc *doc = chtml50->doc;
3230 /*--------------------------------------------------------------------------*/
3231 /* Get Attributes */
3232 /*--------------------------------------------------------------------------*/
3233 for (attr = qs_get_attr(doc,node);
3235 attr = qs_get_next_attr(doc,attr)) {
3236 char *name = qs_get_attr_name(doc,attr);
3237 char *value = qs_get_attr_value(doc,attr);
3238 if (STRCASEEQ('t','T',"type",name)) {
3239 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
3247 return chtml50->out;
3252 * It is a handler who processes the MENU tag.
3254 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3255 * destination is specified.
3256 * @param node [i] The MENU tag node is specified.
3257 * @return The conversion result is returned.
3260 s_chtml50_end_menu_tag(void *pdoc, Node *UNUSED(child))
3262 chtml50_t *chtml50 = GET_CHTML50(pdoc);
3263 Doc *doc = chtml50->doc;
3265 return chtml50->out;
3270 * It is a handler who processes the PLAINTEXT tag.
3272 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3273 * destination is specified.
3274 * @param node [i] The PLAINTEXT tag node is specified.
3275 * @return The conversion result is returned.
3278 s_chtml50_start_plaintext_tag(void *pdoc, Node *node)
3280 chtml50_t *chtml50 = GET_CHTML50(pdoc);
3281 Doc *doc = chtml50->doc;
3283 s_chtml50_start_plaintext_tag_inner(pdoc,node);
3284 return chtml50->out;
3288 s_chtml50_start_plaintext_tag_inner(void *pdoc, Node *node)
3290 chtml50_t *chtml50 = GET_CHTML50(pdoc);
3291 Doc *doc = chtml50->doc;
3293 for (child = qs_get_child_node(doc, node);
3295 child = qs_get_next_node(doc, child)) {
3297 s_chtml50_start_plaintext_tag_inner(pdoc, child);
3299 return chtml50->out;
3304 * It is a handler who processes the PLAINTEXT tag.
3306 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3307 * destination is specified.
3308 * @param node [i] The PLAINTEXT tag node is specified.
3309 * @return The conversion result is returned.
3312 s_chtml50_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3314 chtml50_t *chtml50 = GET_CHTML50(pdoc);
3315 return chtml50->out;
3320 * It is handler who processes the New Line Code.
3323 s_chtml50_newline_mark(void *pdoc, Node *UNUSED(node))
3325 chtml50_t *chtml50 = GET_CHTML50(pdoc);
3326 Doc *doc = chtml50->doc;
3328 return chtml50->out;