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_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"
26 #include "chxj_conv_z2h.h"
28 #define GET_CHTML50(X) ((chtml50_t *)(X))
31 #define W_L(X) do { chtml50->out = BUFFERED_WRITE_LITERAL(chtml50->out, &doc->buf, (X)); } while(0)
32 #define W_V(X) do { chtml50->out = (X) ? BUFFERED_WRITE_VALUE(chtml50->out, &doc->buf, (X)) \
33 : BUFFERED_WRITE_LITERAL(chtml50->out, &doc->buf, ""); } while(0)
35 #define W_NLCODE() do { char *nlcode = TO_NLCODE(chtml50->conf); W_V(nlcode); } while (0)
37 static char *s_chtml50_start_html_tag (void *pdoc, Node *node);
38 static char *s_chtml50_end_html_tag (void *pdoc, Node *node);
39 static char *s_chtml50_start_meta_tag (void *pdoc, Node *node);
40 static char *s_chtml50_end_meta_tag (void *pdoc, Node *node);
41 static char *s_chtml50_start_textarea_tag (void *pdoc, Node *node);
42 static char *s_chtml50_end_textarea_tag (void *pdoc, Node *node);
43 static char *s_chtml50_start_p_tag (void *pdoc, Node *node);
44 static char *s_chtml50_end_p_tag (void *pdoc, Node *node);
45 static char *s_chtml50_start_pre_tag (void *pdoc, Node *node);
46 static char *s_chtml50_end_pre_tag (void *pdoc, Node *node);
47 static char *s_chtml50_start_h1_tag (void *pdoc, Node *node);
48 static char *s_chtml50_end_h1_tag (void *pdoc, Node *node);
49 static char *s_chtml50_start_h2_tag (void *pdoc, Node *node);
50 static char *s_chtml50_end_h2_tag (void *pdoc, Node *node);
51 static char *s_chtml50_start_h3_tag (void *pdoc, Node *node);
52 static char *s_chtml50_end_h3_tag (void *pdoc, Node *node);
53 static char *s_chtml50_start_h4_tag (void *pdoc, Node *node);
54 static char *s_chtml50_end_h4_tag (void *pdoc, Node *node);
55 static char *s_chtml50_start_h5_tag (void *pdoc, Node *node);
56 static char *s_chtml50_end_h5_tag (void *pdoc, Node *node);
57 static char *s_chtml50_start_h6_tag (void *pdoc, Node *node);
58 static char *s_chtml50_end_h6_tag (void *pdoc, Node *node);
59 static char *s_chtml50_start_ul_tag (void *pdoc, Node *node);
60 static char *s_chtml50_end_ul_tag (void *pdoc, Node *node);
61 static char *s_chtml50_start_ol_tag (void *pdoc, Node *node);
62 static char *s_chtml50_end_ol_tag (void *pdoc, Node *node);
63 static char *s_chtml50_start_li_tag (void *pdoc, Node *node);
64 static char *s_chtml50_end_li_tag (void *pdoc, Node *node);
65 static char *s_chtml50_start_head_tag (void *pdoc, Node *node);
66 static char *s_chtml50_end_head_tag (void *pdoc, Node *node);
67 static char *s_chtml50_start_title_tag (void *pdoc, Node *node);
68 static char *s_chtml50_end_title_tag (void *pdoc, Node *node);
69 static char *s_chtml50_start_base_tag (void *pdoc, Node *node);
70 static char *s_chtml50_end_base_tag (void *pdoc, Node *node);
71 static char *s_chtml50_start_body_tag (void *pdoc, Node *node);
72 static char *s_chtml50_end_body_tag (void *pdoc, Node *node);
73 static char *s_chtml50_start_a_tag (void *pdoc, Node *node);
74 static char *s_chtml50_end_a_tag (void *pdoc, Node *node);
75 static char *s_chtml50_start_br_tag (void *pdoc, Node *node);
76 static char *s_chtml50_end_br_tag (void *pdoc, Node *node);
77 static char *s_chtml50_start_tr_tag (void *pdoc, Node *node);
78 static char *s_chtml50_end_tr_tag (void *pdoc, Node *node);
79 static char *s_chtml50_start_font_tag (void *pdoc, Node *node);
80 static char *s_chtml50_end_font_tag (void *pdoc, Node *node);
81 static char *s_chtml50_start_form_tag (void *pdoc, Node *node);
82 static char *s_chtml50_end_form_tag (void *pdoc, Node *node);
83 static char *s_chtml50_start_input_tag (void *pdoc, Node *node);
84 static char *s_chtml50_end_input_tag (void *pdoc, Node *node);
85 static char *s_chtml50_start_center_tag (void *pdoc, Node *node);
86 static char *s_chtml50_end_center_tag (void *pdoc, Node *node);
87 static char *s_chtml50_start_hr_tag (void *pdoc, Node *node);
88 static char *s_chtml50_end_hr_tag (void *pdoc, Node *node);
89 static char *s_chtml50_start_img_tag (void *pdoc, Node *node);
90 static char *s_chtml50_end_img_tag (void *pdoc, Node *node);
91 static char *s_chtml50_start_select_tag (void *pdoc, Node *node);
92 static char *s_chtml50_end_select_tag (void *pdoc, Node *node);
93 static char *s_chtml50_start_option_tag (void *pdoc, Node *node);
94 static char *s_chtml50_end_option_tag (void *pdoc, Node *node);
95 static char *s_chtml50_start_div_tag (void *pdoc, Node *node);
96 static char *s_chtml50_end_div_tag (void *pdoc, Node *node);
97 static char *s_chtml50_chxjif_tag (void *pdoc, Node *node);
98 static char *s_chtml50_text_tag (void *pdoc, Node *node);
99 static char *s_chtml50_start_blockquote_tag(void *pdoc, Node *node);
100 static char *s_chtml50_end_blockquote_tag (void *pdoc, Node *node);
101 static char *s_chtml50_start_dir_tag (void *pdoc, Node *node);
102 static char *s_chtml50_end_dir_tag (void *pdoc, Node *node);
103 static char *s_chtml50_start_dl_tag (void *pdoc, Node *node);
104 static char *s_chtml50_end_dl_tag (void *pdoc, Node *node);
105 static char *s_chtml50_start_dt_tag (void *pdoc, Node *node);
106 static char *s_chtml50_end_dt_tag (void *pdoc, Node *node);
107 static char *s_chtml50_start_dd_tag (void *pdoc, Node *node);
108 static char *s_chtml50_end_dd_tag (void *pdoc, Node *node);
109 static char *s_chtml50_start_marquee_tag (void *pdoc, Node *node);
110 static char *s_chtml50_end_marquee_tag (void *pdoc, Node *node);
111 static char *s_chtml50_start_blink_tag (void *pdoc, Node *node);
112 static char *s_chtml50_end_blink_tag (void *pdoc, Node *node);
113 static char *s_chtml50_start_menu_tag (void *pdoc, Node *node);
114 static char *s_chtml50_end_menu_tag (void *pdoc, Node *node);
115 static char *s_chtml50_start_plaintext_tag (void *pdoc, Node *node);
116 static char *s_chtml50_start_plaintext_tag_inner (void *pdoc, Node *node);
117 static char *s_chtml50_end_plaintext_tag (void *pdoc, Node *node);
118 static char *s_chtml50_newline_mark (void *pdoc, Node *node);
120 static void s_init_chtml50(chtml50_t *chtml, Doc *doc, request_rec *r, device_table *spec);
122 static int s_chtml50_search_emoji(chtml50_t *chtml, char *txt, char **rslt);
125 tag_handler chtml50_handler[] = {
128 s_chtml50_start_html_tag,
129 s_chtml50_end_html_tag,
133 s_chtml50_start_meta_tag,
134 s_chtml50_end_meta_tag,
138 s_chtml50_start_textarea_tag,
139 s_chtml50_end_textarea_tag,
143 s_chtml50_start_p_tag,
148 s_chtml50_start_pre_tag,
149 s_chtml50_end_pre_tag,
153 s_chtml50_start_ul_tag,
154 s_chtml50_end_ul_tag,
158 s_chtml50_start_li_tag,
159 s_chtml50_end_li_tag,
163 s_chtml50_start_ol_tag,
164 s_chtml50_end_ol_tag,
168 s_chtml50_start_h1_tag,
169 s_chtml50_end_h1_tag,
173 s_chtml50_start_h2_tag,
174 s_chtml50_end_h2_tag,
178 s_chtml50_start_h3_tag,
179 s_chtml50_end_h3_tag,
183 s_chtml50_start_h4_tag,
184 s_chtml50_end_h4_tag,
188 s_chtml50_start_h5_tag,
189 s_chtml50_end_h5_tag,
193 s_chtml50_start_h6_tag,
194 s_chtml50_end_h6_tag,
198 s_chtml50_start_head_tag,
199 s_chtml50_end_head_tag,
203 s_chtml50_start_title_tag,
204 s_chtml50_end_title_tag,
208 s_chtml50_start_base_tag,
209 s_chtml50_end_base_tag,
213 s_chtml50_start_body_tag,
214 s_chtml50_end_body_tag,
218 s_chtml50_start_a_tag,
223 s_chtml50_start_br_tag,
224 s_chtml50_end_br_tag,
233 s_chtml50_start_tr_tag,
234 s_chtml50_end_tr_tag,
248 s_chtml50_start_font_tag,
249 s_chtml50_end_font_tag,
253 s_chtml50_start_form_tag,
254 s_chtml50_end_form_tag,
258 s_chtml50_start_input_tag,
259 s_chtml50_end_input_tag,
263 s_chtml50_start_center_tag,
264 s_chtml50_end_center_tag,
268 s_chtml50_start_hr_tag,
269 s_chtml50_end_hr_tag,
273 s_chtml50_start_img_tag,
274 s_chtml50_end_img_tag,
278 s_chtml50_start_select_tag,
279 s_chtml50_end_select_tag,
283 s_chtml50_start_option_tag,
284 s_chtml50_end_option_tag,
288 s_chtml50_start_div_tag,
289 s_chtml50_end_div_tag,
293 s_chtml50_chxjif_tag,
298 s_chtml50_chxjif_tag,
343 s_chtml50_start_dt_tag,
344 s_chtml50_end_dt_tag,
358 s_chtml50_start_blockquote_tag,
359 s_chtml50_end_blockquote_tag,
363 s_chtml50_start_dir_tag,
364 s_chtml50_end_dir_tag,
368 s_chtml50_start_dl_tag,
369 s_chtml50_end_dl_tag,
373 s_chtml50_start_dd_tag,
374 s_chtml50_end_dd_tag,
378 s_chtml50_start_menu_tag,
379 s_chtml50_end_menu_tag,
383 s_chtml50_start_plaintext_tag,
384 s_chtml50_end_plaintext_tag,
388 s_chtml50_start_blink_tag,
389 s_chtml50_end_blink_tag,
393 s_chtml50_start_marquee_tag,
394 s_chtml50_end_marquee_tag,
398 s_chtml50_newline_mark,
405 * converts from CHTML5.0 to CHTML3.0.
407 * @param r [i] Requet_rec is appointed.
408 * @param spec [i] The result of the device specification processing which
409 * was done in advance is appointed.
410 * @param src [i] The character string before the converting is appointed.
411 * @return The character string after the converting is returned.
414 chxj_convert_chtml50(
420 chxjconvrule_entry *entryp,
429 DBG(r, "start chxj_convert_chtml50()");
431 /*--------------------------------------------------------------------------*/
433 /*--------------------------------------------------------------------------*/
435 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
437 DBG(r,"i found qrcode xml");
438 DBG(r, "end chxj_convert_chtml50()");
441 DBG(r,"not found qrcode xml");
443 /*--------------------------------------------------------------------------*/
444 /* The CHTML structure is initialized. */
445 /*--------------------------------------------------------------------------*/
446 s_init_chtml50(&chtml50, &doc, r, spec);
448 chtml50.entryp = entryp;
449 chtml50.cookie = cookie;
451 chxj_set_content_type(r, chxj_header_inf_set_content_type(r, "text/html; charset=Windows-31J"));
453 /*--------------------------------------------------------------------------*/
454 /* The character string of the input is analyzed. */
455 /*--------------------------------------------------------------------------*/
456 qs_init_malloc(&doc);
457 qs_init_root_node(&doc);
459 ss = apr_pcalloc(r->pool, srclen + 1);
460 memset(ss, 0, srclen + 1);
461 memcpy(ss, src, srclen);
464 chxj_dump_out("[src] CHTML -> CHTML4.0", ss, srclen);
466 chxj_buffered_write_init(r->pool, &doc.buf);
468 qs_parse_string(&doc,ss, strlen(ss));
470 /*--------------------------------------------------------------------------*/
471 /* It converts it from CHTML to CHTML. */
472 /*--------------------------------------------------------------------------*/
473 chxj_node_convert(spec,r,(void*)&chtml50, &doc, qs_get_root(&doc), 0);
474 chtml50.out = chxj_buffered_write_flush(chtml50.out, &doc.buf);
475 dst = apr_pstrdup(r->pool, chtml50.out);
476 chxj_buffered_write_terminate(&doc.buf);
478 qs_all_free(&doc,QX_LOGMARK);
481 dst = apr_pstrdup(r->pool,ss);
483 if (strlen(dst) == 0) {
484 dst = apr_psprintf(r->pool, "\n");
487 *dstlen = strlen(dst);
490 chxj_dump_out("[src] CHTML -> CHTML4.0", dst, *dstlen);
493 DBG(r, "end chxj_convert_chtml50()");
499 * The CHTML structure is initialized.
501 * @param chtml50 [i/o] The pointer to the HDML structure that wants to be
502 * initialized is specified.
503 * @param doc [i] The Doc structure that should be set to the initialized
504 * HDML structure is specified.
505 * @param r [i] To use POOL, the pointer to request_rec is specified.
506 * @param spec [i] The pointer to the device_table
509 s_init_chtml50(chtml50_t *chtml50, Doc *doc, request_rec *r, device_table *spec)
511 memset(doc, 0, sizeof(Doc));
512 memset(chtml50, 0, sizeof(chtml50_t));
516 chtml50->spec = spec;
517 chtml50->out = qs_alloc_zero_byte_string(r->pool);
518 chtml50->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
519 chtml50->doc->parse_mode = PARSE_MODE_CHTML;
524 * Corresponding EMOJI to a current character-code is retrieved.
525 * The substitution character string is stored in the rslt pointer if agreeing.
527 * @param chtml50 [i] The pointer to the CHTML structure is specified.
528 * @param txt [i] The character string to want to examine whether it is
529 * EMOJI is specified.
530 * @param rslt [o] The pointer to the pointer that stores the result is
532 * @return When corresponding EMOJI exists, it returns it excluding 0.
535 s_chtml50_search_emoji(chtml50_t *chtml50, char *txt, char **rslt)
542 spec = chtml50->spec;
548 DBG(r,"spec is NULL");
551 for (ee = chtml50->conf->emoji;
554 if (ee->imode == NULL) {
555 DBG(r, "emoji->imode is NULL");
559 if (ee->imode->string != NULL
560 && strlen(ee->imode->string) > 0
561 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
563 if (spec == NULL || spec->emoji_type == NULL) {
564 *rslt = apr_palloc(r->pool, 3);
565 (*rslt)[0] = ee->imode->hex1byte & 0xff;
566 (*rslt)[1] = ee->imode->hex2byte & 0xff;
568 return strlen(ee->imode->string);
580 chxj_chtml50_emoji_only_converter(request_rec *r, device_table *spec, const char *src, apr_size_t len)
591 chtml50 = &__chtml50;
594 DBG(r, "REQ[%X] start chxj_chtml50_emoji_eonly_converter()", (unsigned int)(apr_size_t)r);
595 memset(doc, 0, sizeof(Doc));
596 memset(chtml50, 0, sizeof(chtml50_t));
600 chtml50->spec = spec;
601 chtml50->out = qs_alloc_zero_byte_string(r->pool);
602 chtml50->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
603 chtml50->doc->parse_mode = PARSE_MODE_CHTML;
605 apr_pool_create(&pool, r->pool);
607 chxj_buffered_write_init(pool, &doc->buf);
609 for (ii=0; ii<len; ii++) {
613 rtn = s_chtml50_search_emoji(chtml50, (char *)&src[ii], &out);
620 if (is_sjis_kanji(src[ii])) {
621 two_byte[0] = src[ii+0];
622 two_byte[1] = src[ii+1];
628 one_byte[0] = src[ii+0];
633 chtml50->out = chxj_buffered_write_flush(chtml50->out, &doc->buf);
635 DBG(r, "REQ[%X] end chxj_chtml50_emoji_eonly_converter()", (unsigned int)(apr_size_t)r);
641 * It is a handler who processes the HTML tag.
643 * @param pdoc [i/o] The pointer to the CHTML structure at the output
644 * destination is specified.
645 * @param node [i] The HTML tag node is specified.
646 * @return The conversion result is returned.
649 s_chtml50_start_html_tag(void *pdoc, Node *UNUSED(node))
651 chtml50_t *chtml50 = GET_CHTML50(pdoc);
652 Doc *doc = chtml50->doc;
654 /*--------------------------------------------------------------------------*/
656 /*--------------------------------------------------------------------------*/
664 * It is a handler who processes the HTML tag.
666 * @param pdoc [i/o] The pointer to the CHTML structure at the output
667 * destination is specified.
668 * @param node [i] The HTML tag node is specified.
669 * @return The conversion result is returned.
672 s_chtml50_end_html_tag(void *pdoc, Node *UNUSED(child))
674 chtml50_t *chtml50 = GET_CHTML50(pdoc);
675 Doc *doc = chtml50->doc;
684 * It is a handler who processes the META tag.
686 * @param pdoc [i/o] The pointer to the CHTML structure at the output
687 * destination is specified.
688 * @param node [i] The META tag node is specified.
689 * @return The conversion result is returned.
692 s_chtml50_start_meta_tag(void *pdoc, Node *node)
698 int content_type_flag;
701 chtml50 = GET_CHTML50(pdoc);
705 content_type_flag = 0;
709 /*--------------------------------------------------------------------------*/
711 /*--------------------------------------------------------------------------*/
712 for (attr = qs_get_attr(doc,node);
714 attr = qs_get_next_attr(doc,attr)) {
715 char *name = qs_get_attr_name(doc,attr);
716 char *value = qs_get_attr_value(doc,attr);
720 if (strcasecmp(name, "http-equiv") == 0 && value && *value) {
721 /*----------------------------------------------------------------------*/
723 /*----------------------------------------------------------------------*/
724 W_L(" http-equiv=\"");
727 if (STRCASEEQ('c','C',"content-type", value))
728 content_type_flag = 1;
730 if (STRCASEEQ('r','R',"refresh", value))
737 if (strcasecmp(name, "content") == 0 && value && *value) {
738 if (content_type_flag) {
742 W_V(chxj_header_inf_set_content_type(r, "text/html; charset=SHIFT_JIS"));
750 buf = apr_pstrdup(r->pool, value);
751 url = strchr(buf, ';');
753 sec = apr_pstrdup(r->pool, buf);
756 url = chxj_encoding_parameter(r, url);
757 url = chxj_add_cookie_parameter(r, url, chtml50->cookie);
788 * It is a handler who processes the META tag.
790 * @param pdoc [i/o] The pointer to the CHTML structure at the output
791 * destination is specified.
792 * @param node [i] The META tag node is specified.
793 * @return The conversion result is returned.
796 s_chtml50_end_meta_tag(void* pdoc, Node* UNUSED(child))
798 chtml50_t *chtml50 = GET_CHTML50(pdoc);
805 * It is a handler who processes the HEAD tag.
807 * @param pdoc [i/o] The pointer to the CHTML structure at the output
808 * destination is specified.
809 * @param node [i] The HEAD tag node is specified.
810 * @return The conversion result is returned.
813 s_chtml50_start_head_tag(void* pdoc, Node* UNUSED(node))
815 chtml50_t *chtml50 = GET_CHTML50(pdoc);
816 Doc *doc = chtml50->doc;
825 * It is a handler who processes the HEAD tag.
827 * @param pdoc [i/o] The pointer to the CHTML structure at the output
828 * destination is specified.
829 * @param node [i] The HEAD tag node is specified.
830 * @return The conversion result is returned.
833 s_chtml50_end_head_tag(void *pdoc, Node *UNUSED(node))
835 chtml50_t *chtml50 = GET_CHTML50(pdoc);
836 Doc *doc = chtml50->doc;
845 * It is a handler who processes the TITLE tag.
847 * @param pdoc [i/o] The pointer to the CHTML structure at the output
848 * destination is specified.
849 * @param node [i] The TITLE tag node is specified.
850 * @return The conversion result is returned.
853 s_chtml50_start_title_tag(void *pdoc, Node *UNUSED(node))
855 chtml50_t *chtml50 = GET_CHTML50(pdoc);
856 Doc *doc = chtml50->doc;
865 * It is a handler who processes the TITLE tag.
867 * @param pdoc [i/o] The pointer to the CHTML structure at the output
868 * destination is specified.
869 * @param node [i] The TITLE tag node is specified.
870 * @return The conversion result is returned.
873 s_chtml50_end_title_tag(void *pdoc, Node *UNUSED(child))
875 chtml50_t *chtml50 = GET_CHTML50(pdoc);
876 Doc *doc = chtml50->doc;
885 * It is a handler who processes the BASE tag.
887 * @param pdoc [i/o] The pointer to the CHTML structure at the output
888 * destination is specified.
889 * @param node [i] The BASE tag node is specified.
890 * @return The conversion result is returned.
893 s_chtml50_start_base_tag(void *pdoc, Node *node)
900 chtml50 = GET_CHTML50(pdoc);
905 /*--------------------------------------------------------------------------*/
907 /*--------------------------------------------------------------------------*/
908 for (attr = qs_get_attr(doc,node);
910 attr = qs_get_next_attr(doc,attr)) {
911 char *name = qs_get_attr_name(doc,attr);
912 char *value = qs_get_attr_value(doc,attr);
913 if (STRCASEEQ('h','H',"href", name)) {
926 * It is a handler who processes the BASE tag.
928 * @param pdoc [i/o] The pointer to the CHTML structure at the output
929 * destination is specified.
930 * @param node [i] The BASE tag node is specified.
931 * @return The conversion result is returned.
934 s_chtml50_end_base_tag(void *pdoc, Node *UNUSED(child))
936 chtml50_t *chtml50 = GET_CHTML50(pdoc);
943 * It is a handler who processes the BODY tag.
945 * @param pdoc [i/o] The pointer to the CHTML structure at the output
946 * destination is specified.
947 * @param node [i] The BODY tag node is specified.
948 * @return The conversion result is returned.
951 s_chtml50_start_body_tag(void *pdoc, Node *node)
958 chtml50 = GET_CHTML50(pdoc);
963 /*--------------------------------------------------------------------------*/
965 /*--------------------------------------------------------------------------*/
966 for (attr = qs_get_attr(doc,node);
968 attr = qs_get_next_attr(doc,attr)) {
969 char *name = qs_get_attr_name(doc,attr);
970 char *value = qs_get_attr_value(doc,attr);
971 if (STRCASEEQ('b','B', "bgcolor", name) && value && *value) {
972 /*----------------------------------------------------------------------*/
974 /*----------------------------------------------------------------------*/
979 else if (STRCASEEQ('t','T', "text", name) && value && *value) {
980 /*----------------------------------------------------------------------*/
982 /*----------------------------------------------------------------------*/
987 else if (STRCASEEQ('l','L',"link", name) && value && *value) {
988 /*----------------------------------------------------------------------*/
990 /*----------------------------------------------------------------------*/
995 else if (STRCASEEQ('a','A',"alink", name) && value && *value) {
996 /*----------------------------------------------------------------------*/
998 /*----------------------------------------------------------------------*/
1003 else if (STRCASEEQ('v','V',"vlink", name) && value && *value) {
1004 /*----------------------------------------------------------------------*/
1006 /*----------------------------------------------------------------------*/
1014 return chtml50->out;
1019 * It is a handler who processes the BODY tag.
1021 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1022 * destination is specified.
1023 * @param node [i] The BODY tag node is specified.
1024 * @return The conversion result is returned.
1027 s_chtml50_end_body_tag(void *pdoc, Node *UNUSED(child))
1032 chtml50 = GET_CHTML50(pdoc);
1037 return chtml50->out;
1042 * It is a handler who processes the A tag.
1044 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1045 * destination is specified.
1046 * @param node [i] The A tag node is specified.
1047 * @return The conversion result is returned.
1050 s_chtml50_start_a_tag(void *pdoc, Node *node)
1057 chtml50 = GET_CHTML50(pdoc);
1062 /*--------------------------------------------------------------------------*/
1063 /* Get Attributes */
1064 /*--------------------------------------------------------------------------*/
1065 for (attr = qs_get_attr(doc,node);
1067 attr = qs_get_next_attr(doc,attr)) {
1068 char *name = qs_get_attr_name(doc,attr);
1069 char *value = qs_get_attr_value(doc,attr);
1070 if (STRCASEEQ('n','N',"name", name)) {
1071 /*----------------------------------------------------------------------*/
1073 /*----------------------------------------------------------------------*/
1078 else if (STRCASEEQ('h','H',"href", name)) {
1079 /*----------------------------------------------------------------------*/
1081 /*----------------------------------------------------------------------*/
1082 value = chxj_encoding_parameter(r, value);
1083 if (! chxj_starts_with(value, "mailto:") && ! chxj_starts_with(value, "tel:")) {
1084 value = chxj_add_cookie_parameter(r, value, chtml50->cookie);
1090 else if (STRCASEEQ('a','A',"accesskey", name)) {
1091 /*----------------------------------------------------------------------*/
1093 /*----------------------------------------------------------------------*/
1094 W_L(" accesskey=\"");
1098 else if (STRCASEEQ('c','C',"cti", name)) {
1099 /*----------------------------------------------------------------------*/
1101 /*----------------------------------------------------------------------*/
1106 else if (STRCASEEQ('i','I',"ijam", name)) {
1107 /*----------------------------------------------------------------------*/
1109 /*----------------------------------------------------------------------*/
1112 else if (STRCASEEQ('u','U',"utn", name)) {
1113 /*----------------------------------------------------------------------*/
1115 /* It is special only for CHTML. */
1116 /*----------------------------------------------------------------------*/
1119 else if (STRCASEEQ('t','T',"telbook", name)) {
1120 /*----------------------------------------------------------------------*/
1122 /*----------------------------------------------------------------------*/
1125 else if (STRCASEEQ('k','K',"kana", name)) {
1126 /*----------------------------------------------------------------------*/
1128 /*----------------------------------------------------------------------*/
1131 else if (STRCASEEQ('e','E',"email", name)) {
1132 /*----------------------------------------------------------------------*/
1134 /*----------------------------------------------------------------------*/
1137 else if (STRCASEEQ('i','I',"ista", name)) {
1138 /*----------------------------------------------------------------------*/
1140 /*----------------------------------------------------------------------*/
1143 else if (STRCASEEQ('i','I',"ilet", name)) {
1144 /*----------------------------------------------------------------------*/
1146 /*----------------------------------------------------------------------*/
1149 else if (STRCASEEQ('i','I',"iswf", name)) {
1150 /*----------------------------------------------------------------------*/
1152 /*----------------------------------------------------------------------*/
1155 else if (STRCASEEQ('i','I',"irst", name)) {
1156 /*----------------------------------------------------------------------*/
1158 /*----------------------------------------------------------------------*/
1163 return chtml50->out;
1168 * It is a handler who processes the A tag.
1170 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1171 * destination is specified.
1172 * @param node [i] The A tag node is specified.
1173 * @return The conversion result is returned.
1176 s_chtml50_end_a_tag(void *pdoc, Node *UNUSED(child))
1181 chtml50 = GET_CHTML50(pdoc);
1186 return chtml50->out;
1191 * It is a handler who processes the BR tag.
1193 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1194 * destination is specified.
1195 * @param node [i] The BR tag node is specified.
1196 * @return The conversion result is returned.
1199 s_chtml50_start_br_tag(void *pdoc, Node *node)
1206 chtml50 = GET_CHTML50(pdoc);
1210 /*--------------------------------------------------------------------------*/
1211 /* Get Attributes */
1212 /*--------------------------------------------------------------------------*/
1213 for (attr = qs_get_attr(doc,node);
1215 attr = qs_get_next_attr(doc,attr)) {
1216 char *name = qs_get_attr_name(doc,attr);
1217 char *value = qs_get_attr_value(doc,attr);
1218 if (STRCASEEQ('c','C',"clear",name)) {
1219 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1227 return chtml50->out;
1232 * It is a handler who processes the BR tag.
1234 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1235 * destination is specified.
1236 * @param node [i] The BR tag node is specified.
1237 * @return The conversion result is returned.
1240 s_chtml50_end_br_tag(void *pdoc, Node *UNUSED(child))
1242 chtml50_t *chtml50 = GET_CHTML50(pdoc);
1244 return chtml50->out;
1249 * It is a handler who processes the TR tag.
1251 * @param chtml50 [i/o] The pointer to the CHTML structure at the output
1252 * destination is specified.
1253 * @param node [i] The TR tag node is specified.
1254 * @return The conversion result is returned.
1257 s_chtml50_start_tr_tag(void *pdoc, Node *UNUSED(node))
1259 chtml50_t *chtml50 = GET_CHTML50(pdoc);
1261 return chtml50->out;
1266 * It is a handler who processes the TR tag.
1268 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1269 * destination is specified.
1270 * @param node [i] The TR tag node is specified.
1271 * @return The conversion result is returned.
1274 s_chtml50_end_tr_tag(void *pdoc, Node *UNUSED(child))
1280 chtml50 = GET_CHTML50(pdoc);
1286 return chtml50->out;
1291 * It is a handler who processes the FONT tag.
1293 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1294 * destination is specified.
1295 * @param node [i] The FONT tag node is specified.
1296 * @return The conversion result is returned.
1299 s_chtml50_start_font_tag(void *pdoc, Node *node)
1308 chtml50 = GET_CHTML50(pdoc);
1312 /*--------------------------------------------------------------------------*/
1313 /* Get Attributes */
1314 /*--------------------------------------------------------------------------*/
1315 for (attr = qs_get_attr(doc,node);
1316 attr && (color == NULL || size == NULL);
1317 attr = qs_get_next_attr(doc,attr)) {
1318 char *name = qs_get_attr_name(doc,attr);
1319 char *value = qs_get_attr_value(doc,attr);
1320 if (STRCASEEQ('c','C',"color", name) && value && *value) {
1321 color = apr_pstrdup(doc->buf.pool, value);
1323 else if (STRCASEEQ('s','S',"size", name) && value && *value) {
1324 /*----------------------------------------------------------------------*/
1326 /*----------------------------------------------------------------------*/
1327 size = apr_pstrdup(doc->buf.pool, value);
1336 if (*(size + 1) == 0) {
1345 char ch = *(size + 1);
1346 if (ch == '1' || ch == '2' || ch == '3') {
1347 if (*(size + 2) == 0) {
1359 if (color && size) break;
1361 if (color || size) {
1374 chtml50->font_flag++;
1376 return chtml50->out;
1381 * It is a handler who processes the FONT tag.
1383 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1384 * destination is specified.
1385 * @param node [i] The FONT tag node is specified.
1386 * @return The conversion result is returned.
1389 s_chtml50_end_font_tag(void *pdoc, Node *UNUSED(child))
1395 chtml50 = GET_CHTML50(pdoc);
1399 if (chtml50->font_flag) {
1401 chtml50->font_flag--;
1404 return chtml50->out;
1409 * It is a handler who processes the FORM tag.
1411 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1412 * destination is specified.
1413 * @param node [i] The FORM tag node is specified.
1414 * @return The conversion result is returned.
1417 s_chtml50_start_form_tag(void *pdoc, Node *node)
1423 char *new_hidden_tag = NULL;
1424 char *attr_method = NULL;
1425 char *attr_action = NULL;
1426 char *attr_utn = NULL;
1428 chtml50 = GET_CHTML50(pdoc);
1432 /*--------------------------------------------------------------------------*/
1433 /* Get Attributes */
1434 /*--------------------------------------------------------------------------*/
1435 for (attr = qs_get_attr(doc,node);
1437 attr = qs_get_next_attr(doc,attr)) {
1438 char *name = qs_get_attr_name(doc,attr);
1439 char *value = qs_get_attr_value(doc,attr);
1440 if (STRCASEEQ('a','A',"action", name)) {
1441 /*----------------------------------------------------------------------*/
1443 /*----------------------------------------------------------------------*/
1444 attr_action = chxj_encoding_parameter(r, value);
1445 attr_action = chxj_add_cookie_parameter(r, attr_action, chtml50->cookie);
1447 else if (STRCASEEQ('m','M',"method", name)) {
1448 /*----------------------------------------------------------------------*/
1450 /*----------------------------------------------------------------------*/
1451 attr_method = apr_pstrdup(doc->pool, value);
1453 else if (STRCASEEQ('u','U',"utn", name)) {
1454 /*----------------------------------------------------------------------*/
1456 /* It is special only for CHTML. */
1457 /*----------------------------------------------------------------------*/
1462 int post_flag = (attr_method && strcasecmp(attr_method, "post") == 0) ? 1 : 0;
1467 char *new_query_string = NULL;
1468 q = strchr(attr_action, '?');
1470 new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 0, post_flag, &new_query_string, CHXJ_TRUE, CHXJ_FALSE, chtml50->entryp);
1471 if (new_hidden_tag || new_query_string) {
1477 if (new_query_string) {
1479 W_V(new_query_string);
1492 if (new_hidden_tag) {
1493 W_V(new_hidden_tag);
1495 return chtml50->out;
1500 * It is a handler who processes the FORM tag.
1502 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1503 * destination is specified.
1504 * @param node [i] The FORM tag node is specified.
1505 * @return The conversion result is returned.
1508 s_chtml50_end_form_tag(void *pdoc, Node *UNUSED(child))
1513 chtml50 = GET_CHTML50(pdoc);
1518 return chtml50->out;
1523 * It is a handler who processes the INPUT tag.
1525 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1526 * destination is specified.
1527 * @param node [i] The INPUT tag node is specified.
1528 * @return The conversion result is returned.
1531 s_chtml50_start_input_tag(void *pdoc, Node *node)
1536 char *max_length = NULL;
1540 char *istyle = NULL;
1542 char *checked = NULL;
1543 char *accesskey = NULL;
1545 chtml50 = GET_CHTML50(pdoc);
1549 /*--------------------------------------------------------------------------*/
1550 /* Get Attributes */
1551 /*--------------------------------------------------------------------------*/
1552 type = qs_get_type_attr(doc, node, doc->buf.pool);
1553 name = qs_get_name_attr(doc, node, doc->buf.pool);
1554 value = qs_get_value_attr(doc,node, doc->buf.pool);
1555 istyle = qs_get_istyle_attr(doc,node,doc->buf.pool);
1556 max_length = qs_get_maxlength_attr(doc,node,doc->buf.pool);
1557 checked = qs_get_checked_attr(doc,node,doc->buf.pool);
1558 accesskey = qs_get_accesskey_attr(doc, node, doc->buf.pool);
1559 size = qs_get_size_attr(doc, node, doc->buf.pool);
1562 type = qs_trim_string(doc->buf.pool, type);
1563 if (type && (STRCASEEQ('t','T',"text", type) ||
1564 STRCASEEQ('p','P',"password",type) ||
1565 STRCASEEQ('c','C',"checkbox",type) ||
1566 STRCASEEQ('r','R',"radio", type) ||
1567 STRCASEEQ('h','H',"hidden", type) ||
1568 STRCASEEQ('s','S',"submit", type) ||
1569 STRCASEEQ('r','R',"reset", type))) {
1575 if (size && *size) {
1580 if (name && *name) {
1585 if (value && *value) {
1586 if (type && (STRCASEEQ('s','S',"submit",type) || STRCASEEQ('r','R',"reset",type))) {
1587 apr_size_t value_len = strlen(value);
1588 value = chxj_conv_z2h(r, value, &value_len, chtml50->entryp);
1592 W_V(chxj_add_slash_to_doublequote(doc->pool, value));
1595 if (accesskey && *accesskey) {
1596 W_L(" accesskey=\"");
1601 /*------------------------------------------------------------------------*/
1603 /*------------------------------------------------------------------------*/
1604 if (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4') {
1611 /*--------------------------------------------------------------------------*/
1612 /* The figure is default for the password. */
1613 /*--------------------------------------------------------------------------*/
1614 if (max_length && *max_length) {
1615 if (chxj_chk_numeric(max_length) != 0) {
1616 max_length = apr_psprintf(r->pool, "0");
1618 if (istyle != NULL && *istyle == '1') {
1619 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length) * 2);
1623 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length));
1632 return chtml50->out;
1637 * It is a handler who processes the INPUT tag.
1639 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1640 * destination is specified.
1641 * @param node [i] The INPUT tag node is specified.
1642 * @return The conversion result is returned.
1645 s_chtml50_end_input_tag(void *pdoc, Node *UNUSED(child))
1647 chtml50_t *chtml50 = GET_CHTML50(pdoc);
1649 return chtml50->out;
1654 * It is a handler who processes the CENTER tag.
1656 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1657 * destination is specified.
1658 * @param node [i] The CENTER tag node is specified.
1659 * @return The conversion result is returned.
1662 s_chtml50_start_center_tag(void *pdoc, Node *UNUSED(node))
1667 chtml50 = GET_CHTML50(pdoc);
1672 return chtml50->out;
1677 * It is a handler who processes the CENTER tag.
1679 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1680 * destination is specified.
1681 * @param node [i] The CENTER tag node is specified.
1682 * @return The conversion result is returned.
1685 s_chtml50_end_center_tag(void *pdoc, Node *UNUSED(child))
1690 chtml50 = GET_CHTML50(pdoc);
1695 return chtml50->out;
1700 * It is a handler who processes the HR tag.
1702 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1703 * destination is specified.
1704 * @param node [i] The HR tag node is specified.
1705 * @return The conversion result is returned.
1708 s_chtml50_start_hr_tag(void *pdoc, Node *node)
1715 chtml50 = GET_CHTML50(pdoc);
1721 for (attr = qs_get_attr(doc,node);
1723 attr = qs_get_next_attr(doc,attr)) {
1724 char *name = qs_get_attr_name(doc,attr);
1725 char *value = qs_get_attr_value(doc,attr);
1726 if (STRCASEEQ('a','A',"align", name)) {
1727 /*----------------------------------------------------------------------*/
1729 /*----------------------------------------------------------------------*/
1730 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1736 else if (STRCASEEQ('s','S',"size", name)) {
1737 /*----------------------------------------------------------------------*/
1739 /*----------------------------------------------------------------------*/
1740 if (value && *value) {
1746 else if (STRCASEEQ('w','W',"width", name)) {
1747 /*----------------------------------------------------------------------*/
1749 /*----------------------------------------------------------------------*/
1750 if (value && *value) {
1756 else if (STRCASEEQ('n','N',"noshade", name)) {
1757 /*----------------------------------------------------------------------*/
1759 /*----------------------------------------------------------------------*/
1762 else if (STRCASEEQ('c','C',"color", name) && value && *value) {
1763 /*----------------------------------------------------------------------*/
1765 /*----------------------------------------------------------------------*/
1773 return chtml50->out;
1778 * It is a handler who processes the HR tag.
1780 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1781 * destination is specified.
1782 * @param node [i] The HR tag node is specified.
1783 * @return The conversion result is returned.
1786 s_chtml50_end_hr_tag(void *pdoc, Node *UNUSED(child))
1788 chtml50_t *chtml50 = GET_CHTML50(pdoc);
1790 return chtml50->out;
1795 * It is a handler who processes the IMG tag.
1797 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1798 * destination is specified.
1799 * @param node [i] The IMG tag node is specified.
1800 * @return The conversion result is returned.
1803 s_chtml50_start_img_tag(void *pdoc, Node *node)
1805 #ifndef IMG_NOT_CONVERT_FILENAME
1813 chtml50 = GET_CHTML50(pdoc);
1816 #ifndef IMG_NOT_CONVERT_FILENAME
1817 spec = chtml50->spec;
1821 /*--------------------------------------------------------------------------*/
1822 /* Get Attributes */
1823 /*--------------------------------------------------------------------------*/
1824 for (attr = qs_get_attr(doc,node);
1826 attr = qs_get_next_attr(doc,attr)) {
1827 char *name = qs_get_attr_name(doc,attr);
1828 char *value = qs_get_attr_value(doc,attr);
1829 if (STRCASEEQ('s','S',"src", name)) {
1830 /*----------------------------------------------------------------------*/
1832 /*----------------------------------------------------------------------*/
1833 #ifdef IMG_NOT_CONVERT_FILENAME
1834 value = chxj_encoding_parameter(r, value);
1835 value = chxj_add_cookie_parameter(r, value, chtml50->cookie);
1836 value = chxj_add_cookie_no_update_parameter(r, value);
1841 value = chxj_img_conv(r,spec,value);
1842 value = chxj_encoding_parameter(r, value);
1843 value = chxj_add_cookie_parameter(r, value, chtml50->cookie);
1844 value = chxj_add_cookie_no_update_parameter(r, value);
1850 else if (STRCASEEQ('a','A',"align", name)) {
1851 /*----------------------------------------------------------------------*/
1853 /*----------------------------------------------------------------------*/
1855 if (STRCASEEQ('t','T',"top", value) ||
1856 STRCASEEQ('m','M',"middle",value) ||
1857 STRCASEEQ('b','B',"bottom",value) ||
1858 STRCASEEQ('l','L',"left", value) ||
1859 STRCASEEQ('c','C',"center", value) ||
1860 STRCASEEQ('r','R',"right", value)) {
1867 else if (STRCASEEQ('w','W',"width", name) && value && *value) {
1868 /*----------------------------------------------------------------------*/
1870 /*----------------------------------------------------------------------*/
1875 else if (STRCASEEQ('h','H', "height", name) && value && *value) {
1876 /*----------------------------------------------------------------------*/
1878 /*----------------------------------------------------------------------*/
1883 else if (STRCASEEQ('h','H',"hspace", name) && value && *value) {
1884 /*----------------------------------------------------------------------*/
1886 /*----------------------------------------------------------------------*/
1891 else if (STRCASEEQ('v','V',"vspace", name) && value && *value) {
1892 /*----------------------------------------------------------------------*/
1894 /*----------------------------------------------------------------------*/
1899 else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
1900 /*----------------------------------------------------------------------*/
1902 /*----------------------------------------------------------------------*/
1910 return chtml50->out;
1915 * It is a handler who processes the IMG tag.
1917 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1918 * destination is specified.
1919 * @param node [i] The IMG tag node is specified.
1920 * @return The conversion result is returned.
1923 s_chtml50_end_img_tag(void *pdoc, Node *UNUSED(child))
1925 chtml50_t *chtml50 = GET_CHTML50(pdoc);
1927 return chtml50->out;
1932 * It is a handler who processes the SELECT tag.
1934 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1935 * destination is specified.
1936 * @param node [i] The SELECT tag node is specified.
1937 * @return The conversion result is returned.
1940 s_chtml50_start_select_tag(void *pdoc, Node *child)
1942 chtml50_t *chtml50 = GET_CHTML50(pdoc);
1943 Doc *doc = chtml50->doc;
1946 char *multiple = NULL;
1950 for (attr = qs_get_attr(doc,child);
1952 attr = qs_get_next_attr(doc,attr)) {
1953 char *nm = qs_get_attr_name(doc,attr);
1954 char *val = qs_get_attr_value(doc,attr);
1955 if (STRCASEEQ('s','S',"size", nm)) {
1956 /*----------------------------------------------------------------------*/
1957 /* CHTML 1.0 version 2.0 */
1958 /*----------------------------------------------------------------------*/
1959 size = apr_pstrdup(doc->buf.pool, val);
1961 else if (STRCASEEQ('n','N',"name", nm)) {
1962 /*----------------------------------------------------------------------*/
1963 /* CHTML 1.0 version 2.0 */
1964 /*----------------------------------------------------------------------*/
1965 name = apr_pstrdup(doc->buf.pool, val);
1967 else if (STRCASEEQ('m','M',"multiple", nm)) {
1968 /*----------------------------------------------------------------------*/
1969 /* CHTML 1.0 version 2.0 */
1970 /*----------------------------------------------------------------------*/
1971 multiple = apr_pstrdup(doc->buf.pool, val);
1974 if (size && *size) {
1979 if (name && *name) {
1989 return chtml50->out;
1994 * It is a handler who processes the SELECT tag.
1996 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1997 * destination is specified.
1998 * @param node [i] The SELECT tag node is specified.
1999 * @return The conversion result is returned.
2002 s_chtml50_end_select_tag(void *pdoc, Node *UNUSED(child))
2004 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2005 Doc *doc = chtml50->doc;
2009 return chtml50->out;
2014 * It is a handler who processes the OPTION tag.
2016 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2017 * destination is specified.
2018 * @param node [i] The OPTION tag node is specified.
2019 * @return The conversion result is returned.
2022 s_chtml50_start_option_tag(void *pdoc, Node *child)
2031 chtml50 = GET_CHTML50(pdoc);
2038 for (attr = qs_get_attr(doc,child);
2040 attr = qs_get_next_attr(doc,attr)) {
2041 char *nm = qs_get_attr_name(doc,attr);
2042 char *val = qs_get_attr_value(doc,attr);
2043 if (STRCASEEQ('s','S',"selected", nm)) {
2044 /*----------------------------------------------------------------------*/
2045 /* CHTML 1.0 version 2.0 */
2046 /*----------------------------------------------------------------------*/
2047 selected = apr_pstrdup(doc->buf.pool, val);
2049 else if (STRCASEEQ('v','V',"value", nm)) {
2050 /*----------------------------------------------------------------------*/
2051 /* CHTML 1.0 version 2.0 */
2052 /*----------------------------------------------------------------------*/
2053 value = apr_pstrdup(doc->buf.pool, val);
2065 return chtml50->out;
2070 * It is a handler who processes the OPTION tag.
2072 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2073 * destination is specified.
2074 * @param node [i] The OPTION tag node is specified.
2075 * @return The conversion result is returned.
2078 s_chtml50_end_option_tag(void *pdoc, Node *UNUSED(child))
2080 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2084 return chtml50->out;
2089 * It is a handler who processes the DIV tag.
2091 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2092 * destination is specified.
2093 * @param node [i] The DIV tag node is specified.
2094 * @return The conversion result is returned.
2097 s_chtml50_start_div_tag(void *pdoc, Node *child)
2105 chtml50 = GET_CHTML50(pdoc);
2111 for (attr = qs_get_attr(doc,child);
2113 attr = qs_get_next_attr(doc,attr)) {
2114 char *nm = qs_get_attr_name(doc,attr);
2115 char *val = qs_get_attr_value(doc,attr);
2116 if (STRCASEEQ('a','A',"align", nm)) {
2117 /*----------------------------------------------------------------------*/
2118 /* CHTML 1.0 (W3C version 3.2) */
2119 /*----------------------------------------------------------------------*/
2120 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2121 align = apr_pstrdup(doc->buf.pool, val);
2132 return chtml50->out;
2137 * It is a handler who processes the DIV tag.
2139 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2140 * destination is specified.
2141 * @param node [i] The DIV tag node is specified.
2142 * @return The conversion result is returned.
2145 s_chtml50_end_div_tag(void *pdoc, Node *UNUSED(node))
2147 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2148 Doc *doc = chtml50->doc;
2152 return chtml50->out;
2157 * It is a handler who processes the UL tag.
2159 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2160 * destination is specified.
2161 * @param node [i] The UL tag node is specified.
2162 * @return The conversion result is returned.
2165 s_chtml50_start_ul_tag(void *pdoc, Node *node)
2167 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2168 Doc *doc = chtml50->doc;
2171 /*--------------------------------------------------------------------------*/
2172 /* Get Attributes */
2173 /*--------------------------------------------------------------------------*/
2174 for (attr = qs_get_attr(doc,node);
2176 attr = qs_get_next_attr(doc,attr)) {
2177 char *name = qs_get_attr_name(doc,attr);
2178 char *value = qs_get_attr_value(doc,attr);
2179 if (STRCASEEQ('t','T',"type",name)) {
2180 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
2188 return chtml50->out;
2193 * It is a handler who processes the UL tag.
2195 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2196 * destination is specified.
2197 * @param node [i] The UL tag node is specified.
2198 * @return The conversion result is returned.
2201 s_chtml50_end_ul_tag(void *pdoc, Node *UNUSED(child))
2203 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2204 Doc *doc = chtml50->doc;
2208 return chtml50->out;
2213 * It is a handler who processes the PRE tag.
2215 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2216 * destination is specified.
2217 * @param node [i] The PRE tag node is specified.
2218 * @return The conversion result is returned.
2221 s_chtml50_start_pre_tag(void *pdoc, Node *UNUSED(node))
2223 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2224 Doc *doc = chtml50->doc;
2226 chtml50->pre_flag++;
2229 return chtml50->out;
2234 * It is a handler who processes the PRE tag.
2236 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2237 * destination is specified.
2238 * @param node [i] The PRE tag node is specified.
2239 * @return The conversion result is returned.
2242 s_chtml50_end_pre_tag(void *pdoc, Node *UNUSED(child))
2244 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2245 Doc *doc = chtml50->doc;
2248 chtml50->pre_flag--;
2250 return chtml50->out;
2255 * It is a handler who processes the P tag.
2257 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2258 * destination is specified.
2259 * @param node [i] The P tag node is specified.
2260 * @return The conversion result is returned.
2263 s_chtml50_start_p_tag(void *pdoc, Node *node)
2271 chtml50 = GET_CHTML50(pdoc);
2276 for (attr = qs_get_attr(doc,node);
2278 attr = qs_get_next_attr(doc,attr)) {
2279 char *nm = qs_get_attr_name(doc,attr);
2280 char *val = qs_get_attr_value(doc,attr);
2281 if (STRCASEEQ('a','A',"align", nm)) {
2282 /*----------------------------------------------------------------------*/
2283 /* CHTML 1.0 (W3C version 3.2) */
2284 /*----------------------------------------------------------------------*/
2285 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2286 align = apr_pstrdup(doc->buf.pool, val);
2297 return chtml50->out;
2302 * It is a handler who processes the P tag.
2304 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2305 * destination is specified.
2306 * @param node [i] The P tag node is specified.
2307 * @return The conversion result is returned.
2310 s_chtml50_end_p_tag(void *pdoc, Node *UNUSED(child))
2315 chtml50 = GET_CHTML50(pdoc);
2320 return chtml50->out;
2325 * It is a handler who processes the OL tag.
2327 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2328 * destination is specified.
2329 * @param node [i] The OL tag node is specified.
2330 * @return The conversion result is returned.
2333 s_chtml50_start_ol_tag(void *pdoc, Node *node)
2340 chtml50 = GET_CHTML50(pdoc);
2345 /*--------------------------------------------------------------------------*/
2346 /* Get Attributes */
2347 /*--------------------------------------------------------------------------*/
2348 for (attr = qs_get_attr(doc,node);
2350 attr = qs_get_next_attr(doc,attr)) {
2351 char *name = qs_get_attr_name(doc,attr);
2352 char *value = qs_get_attr_value(doc,attr);
2353 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
2358 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
2366 return chtml50->out;
2371 * It is a handler who processes the OL tag.
2373 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2374 * destination is specified.
2375 * @param node [i] The OL tag node is specified.
2376 * @return The conversion result is returned.
2379 s_chtml50_end_ol_tag(void *pdoc, Node *UNUSED(node))
2381 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2382 Doc *doc = chtml50->doc;
2386 return chtml50->out;
2391 * It is a handler who processes the LI tag.
2393 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2394 * destination is specified.
2395 * @param node [i] The LI tag node is specified.
2396 * @return The conversion result is returned.
2399 s_chtml50_start_li_tag(void *pdoc, Node *node)
2401 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2402 Doc *doc = chtml50->doc;
2406 /*--------------------------------------------------------------------------*/
2407 /* Get Attributes */
2408 /*--------------------------------------------------------------------------*/
2409 for (attr = qs_get_attr(doc,node);
2411 attr = qs_get_next_attr(doc,attr)) {
2412 char *name = qs_get_attr_name(doc,attr);
2413 char *value = qs_get_attr_value(doc,attr);
2414 if (STRCASEEQ('t','T',"type",name)) {
2415 if (value && (*value == '1' || *value == 'a' || *value == 'A' || STRCASEEQ('d','D',"disc",value) || STRCASEEQ('s','S',"square",value) || STRCASEEQ('c','C',"circle",value))) {
2421 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
2428 return chtml50->out;
2433 * It is a handler who processes the LI tag.
2435 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2436 * destination is specified.
2437 * @param node [i] The LI tag node is specified.
2438 * @return The conversion result is returned.
2441 s_chtml50_end_li_tag(void *pdoc, Node *UNUSED(child))
2443 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2445 return chtml50->out;
2450 * It is a handler who processes the H1 tag.
2452 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2453 * destination is specified.
2454 * @param node [i] The H1 tag node is specified.
2455 * @return The conversion result is returned.
2458 s_chtml50_start_h1_tag(void *pdoc, Node *node)
2465 chtml50 = GET_CHTML50(pdoc);
2470 for (attr = qs_get_attr(doc,node);
2472 attr = qs_get_next_attr(doc,attr)) {
2473 char *name = qs_get_attr_name(doc,attr);
2474 char *value = qs_get_attr_value(doc,attr);
2475 if (STRCASEEQ('a','A',"align", name)) {
2476 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2486 return chtml50->out;
2491 * It is a handler who processes the H1 tag.
2493 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2494 * destination is specified.
2495 * @param node [i] The H1 tag node is specified.
2496 * @return The conversion result is returned.
2499 s_chtml50_end_h1_tag(void *pdoc, Node *UNUSED(child))
2504 chtml50 = GET_CHTML50(pdoc);
2509 return chtml50->out;
2514 * It is a handler who processes the H2 tag.
2516 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2517 * destination is specified.
2518 * @param node [i] The H2 tag node is specified.
2519 * @return The conversion result is returned.
2522 s_chtml50_start_h2_tag(void *pdoc, Node *node)
2529 chtml50 = GET_CHTML50(pdoc);
2534 for (attr = qs_get_attr(doc,node);
2536 attr = qs_get_next_attr(doc,attr)) {
2537 char *name = qs_get_attr_name(doc,attr);
2538 char *value = qs_get_attr_value(doc,attr);
2539 if (STRCASEEQ('a','A',"align", name)) {
2540 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2549 return chtml50->out;
2554 * It is a handler who processes the H2 tag.
2556 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2557 * destination is specified.
2558 * @param node [i] The H2 tag node is specified.
2559 * @return The conversion result is returned.
2562 s_chtml50_end_h2_tag(void *pdoc, Node *UNUSED(child))
2564 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2565 Doc *doc = chtml50->doc;
2569 return chtml50->out;
2574 * It is a handler who processes the H3 tag.
2576 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2577 * destination is specified.
2578 * @param node [i] The H3 tag node is specified.
2579 * @return The conversion result is returned.
2582 s_chtml50_start_h3_tag(void *pdoc, Node *node)
2589 chtml50 = GET_CHTML50(pdoc);
2594 for (attr = qs_get_attr(doc,node);
2596 attr = qs_get_next_attr(doc,attr)) {
2597 char *name = qs_get_attr_name(doc,attr);
2598 char *value = qs_get_attr_value(doc,attr);
2599 if (STRCASEEQ('a','A',"align", name)) {
2600 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2610 return chtml50->out;
2615 * It is a handler who processes the H3 tag.
2617 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2618 * destination is specified.
2619 * @param node [i] The H3 tag node is specified.
2620 * @return The conversion result is returned.
2623 s_chtml50_end_h3_tag(void *pdoc, Node *UNUSED(child))
2625 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2626 Doc *doc = chtml50->doc;
2630 return chtml50->out;
2635 * It is a handler who processes the H4 tag.
2637 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2638 * destination is specified.
2639 * @param node [i] The H4 tag node is specified.
2640 * @return The conversion result is returned.
2643 s_chtml50_start_h4_tag(void *pdoc, Node *node)
2650 chtml50 = GET_CHTML50(pdoc);
2655 for (attr = qs_get_attr(doc,node);
2657 attr = qs_get_next_attr(doc,attr)) {
2658 char *name = qs_get_attr_name(doc,attr);
2659 char *value = qs_get_attr_value(doc,attr);
2660 if (STRCASEEQ('a','A',"align", name)) {
2661 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2670 return chtml50->out;
2675 * It is a handler who processes the H4 tag.
2677 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2678 * destination is specified.
2679 * @param node [i] The H4 tag node is specified.
2680 * @return The conversion result is returned.
2683 s_chtml50_end_h4_tag(void *pdoc, Node *UNUSED(child))
2685 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2686 Doc *doc = chtml50->doc;
2690 return chtml50->out;
2695 * It is a handler who processes the H5 tag.
2697 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2698 * destination is specified.
2699 * @param node [i] The H5 tag node is specified.
2700 * @return The conversion result is returned.
2703 s_chtml50_start_h5_tag(void *pdoc, Node *node)
2710 chtml50 = GET_CHTML50(pdoc);
2715 for (attr = qs_get_attr(doc,node);
2717 attr = qs_get_next_attr(doc,attr)) {
2718 char *name = qs_get_attr_name(doc,attr);
2719 char *value = qs_get_attr_value(doc,attr);
2720 if (STRCASEEQ('a','A',"align", name)) {
2721 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2730 return chtml50->out;
2735 * It is a handler who processes the H5 tag.
2737 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2738 * destination is specified.
2739 * @param node [i] The H5 tag node is specified.
2740 * @return The conversion result is returned.
2743 s_chtml50_end_h5_tag(void *pdoc, Node *UNUSED(child))
2745 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2746 Doc *doc = chtml50->doc;
2750 return chtml50->out;
2755 * It is a handler who processes the H6 tag.
2757 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2758 * destination is specified.
2759 * @param node [i] The H6 tag node is specified.
2760 * @return The conversion result is returned.
2763 s_chtml50_start_h6_tag(void *pdoc, Node *node)
2770 chtml50 = GET_CHTML50(pdoc);
2775 for (attr = qs_get_attr(doc,node);
2777 attr = qs_get_next_attr(doc,attr)) {
2778 char *name = qs_get_attr_name(doc,attr);
2779 char *value = qs_get_attr_value(doc,attr);
2780 if (STRCASEEQ('a','A',"align", name)) {
2781 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2790 return chtml50->out;
2795 * It is a handler who processes the H6 tag.
2797 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2798 * destination is specified.
2799 * @param node [i] The H6 tag node is specified.
2800 * @return The conversion result is returned.
2803 s_chtml50_end_h6_tag(void *pdoc, Node *UNUSED(child))
2805 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2806 Doc *doc = chtml50->doc;
2810 return chtml50->out;
2815 * It is a handler who processes the TEXTARE tag.
2817 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2818 * destination is specified.
2819 * @param node [i] The TEXTAREA tag node is specified.
2820 * @return The conversion result is returned.
2823 s_chtml50_start_textarea_tag(void *pdoc, Node *node)
2830 chtml50 = GET_CHTML50(pdoc);
2834 chtml50->textarea_flag++;
2837 for (attr = qs_get_attr(doc,node);
2839 attr = qs_get_next_attr(doc,attr)) {
2840 char *name = qs_get_attr_name(doc,attr);
2841 char *value = qs_get_attr_value(doc,attr);
2842 if (STRCASEEQ('a','A',"accesskey",name) && value && *value != 0) {
2843 W_L(" accesskey=\"");
2847 else if (STRCASEEQ('i','I',"istyle", name) && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
2852 else if (STRCASEEQ('n','N',"name", name) && value && *value) {
2857 else if (STRCASEEQ('r','R',"rows", name) && value && *value) {
2862 else if (STRCASEEQ('c','C',"cols", name) && value && *value) {
2869 return chtml50->out;
2874 * It is a handler who processes the TEXTAREA tag.
2876 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2877 * destination is specified.
2878 * @param node [i] The TEXTAREA tag node is specified.
2879 * @return The conversion result is returned.
2882 s_chtml50_end_textarea_tag(void *pdoc, Node *UNUSED(child))
2884 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2885 Doc *doc = chtml50->doc;
2888 chtml50->textarea_flag--;
2890 return chtml50->out;
2895 s_chtml50_chxjif_tag(void *pdoc, Node *node)
2902 chtml50 = GET_CHTML50(pdoc);
2906 for (child = qs_get_child_node(doc, node);
2908 child = qs_get_next_node(doc, child)) {
2910 s_chtml50_chxjif_tag(chtml50, child);
2918 s_chtml50_text_tag(void *pdoc, Node *child)
2930 apr_size_t z2h_input_len;
2932 chtml50 = GET_CHTML50(pdoc);
2936 textval = qs_get_node_value(doc,child);
2937 if (strlen(textval) == 0) {
2938 return chtml50->out;
2941 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
2942 memset(tmp, 0, qs_get_node_size(doc,child)+1);
2944 tdst = qs_alloc_zero_byte_string(doc->buf.pool);
2945 memset(one_byte, 0, sizeof(one_byte));
2948 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
2950 int rtn = s_chtml50_search_emoji(chtml50, &textval[ii], &out);
2952 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
2957 if (is_sjis_kanji(textval[ii])) {
2958 one_byte[0] = textval[ii+0];
2959 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2960 one_byte[0] = textval[ii+1];
2961 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2964 else if (chtml50->pre_flag) {
2965 one_byte[0] = textval[ii+0];
2966 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2968 else if (chtml50->textarea_flag) {
2969 one_byte[0] = textval[ii+0];
2970 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2972 else if (textval[ii] != '\r' && textval[ii] != '\n') {
2973 one_byte[0] = textval[ii+0];
2974 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2977 z2h_input_len = strlen(tdst);
2978 tdst = chxj_conv_z2h(r, tdst, &z2h_input_len, chtml50->entryp);
2980 return chtml50->out;
2985 * It is a handler who processes the BLOCKQUOTE tag.
2987 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2988 * destination is specified.
2989 * @param node [i] The BLOCKQUOTE tag node is specified.
2990 * @return The conversion result is returned.
2993 s_chtml50_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
2995 chtml50_t *chtml50 = GET_CHTML50(pdoc);
2996 Doc *doc = chtml50->doc;
2997 W_L("<blockquote>");
2998 return chtml50->out;
3003 * It is a handler who processes the BLOCKQUOTE tag.
3005 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3006 * destination is specified.
3007 * @param node [i] The BLOCKQUOTE tag node is specified.
3008 * @return The conversion result is returned.
3011 s_chtml50_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
3013 chtml50_t *chtml50 = GET_CHTML50(pdoc);
3014 Doc *doc = chtml50->doc;
3015 W_L("</blockquote>");
3016 return chtml50->out;
3021 * It is a handler who processes the DIR tag.
3023 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3024 * destination is specified.
3025 * @param node [i] The DIR tag node is specified.
3026 * @return The conversion result is returned.
3029 s_chtml50_start_dir_tag(void *pdoc, Node *node)
3031 chtml50_t *chtml50 = GET_CHTML50(pdoc);
3032 Doc *doc = chtml50->doc;
3035 for (attr = qs_get_attr(doc,node);
3037 attr = qs_get_next_attr(doc,attr)) {
3038 char *name = qs_get_attr_name(doc,attr);
3039 char *value = qs_get_attr_value(doc,attr);
3040 if (STRCASEEQ('t','T',"type",name)) {
3041 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
3049 return chtml50->out;
3054 * It is a handler who processes the DIR tag.
3056 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3057 * destination is specified.
3058 * @param node [i] The DIR tag node is specified.
3059 * @return The conversion result is returned.
3062 s_chtml50_end_dir_tag(void *pdoc, Node *UNUSED(child))
3064 chtml50_t *chtml50 = GET_CHTML50(pdoc);
3065 Doc *doc = chtml50->doc;
3067 return chtml50->out;
3072 * It is a handler who processes the DL tag.
3074 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3075 * destination is specified.
3076 * @param node [i] The DL tag node is specified.
3077 * @return The conversion result is returned.
3080 s_chtml50_start_dl_tag(void *pdoc, Node *UNUSED(child))
3082 chtml50_t *chtml50 = GET_CHTML50(pdoc);
3083 Doc *doc = chtml50->doc;
3085 return chtml50->out;
3090 * It is a handler who processes the DL tag.
3092 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3093 * destination is specified.
3094 * @param node [i] The DL tag node is specified.
3095 * @return The conversion result is returned.
3098 s_chtml50_end_dl_tag(void *pdoc, Node *UNUSED(child))
3100 chtml50_t *chtml50 = GET_CHTML50(pdoc);
3101 Doc *doc = chtml50->doc;
3103 return chtml50->out;
3108 * It is a handler who processes the DT tag.
3110 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3111 * destination is specified.
3112 * @param node [i] The DT tag node is specified.
3113 * @return The conversion result is returned.
3116 s_chtml50_start_dt_tag(void *pdoc, Node *UNUSED(child))
3118 chtml50_t *chtml50 = GET_CHTML50(pdoc);
3119 Doc *doc = chtml50->doc;
3121 return chtml50->out;
3126 * It is a handler who processes the DT tag.
3128 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3129 * destination is specified.
3130 * @param node [i] The DT tag node is specified.
3131 * @return The conversion result is returned.
3134 s_chtml50_end_dt_tag(void *pdoc, Node *UNUSED(child))
3136 chtml50_t *chtml50 = GET_CHTML50(pdoc);
3138 return chtml50->out;
3143 * It is a handler who processes the DD tag.
3145 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3146 * destination is specified.
3147 * @param node [i] The DD tag node is specified.
3148 * @return The conversion result is returned.
3151 s_chtml50_start_dd_tag(void *pdoc, Node *UNUSED(child))
3153 chtml50_t *chtml50 = GET_CHTML50(pdoc);
3154 Doc *doc = chtml50->doc;
3158 return chtml50->out;
3163 * It is a handler who processes the DD tag.
3165 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3166 * destination is specified.
3167 * @param node [i] The DD tag node is specified.
3168 * @return The conversion result is returned.
3171 s_chtml50_end_dd_tag(void *pdoc, Node *UNUSED(child))
3173 chtml50_t *chtml50 = GET_CHTML50(pdoc);
3175 return chtml50->out;
3180 * It is a handler who processes the MARQUEE tag.
3182 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3183 * destination is specified.
3184 * @param node [i] The MARQUEE tag node is specified.
3185 * @return The conversion result is returned.
3188 s_chtml50_start_marquee_tag(void *pdoc, Node *node)
3190 chtml50_t *chtml50 = GET_CHTML50(pdoc);
3191 Doc *doc = chtml50->doc;
3194 /*--------------------------------------------------------------------------*/
3195 /* Get Attributes */
3196 /*--------------------------------------------------------------------------*/
3197 for (attr = qs_get_attr(doc,node);
3199 attr = qs_get_next_attr(doc,attr)) {
3200 char *name = qs_get_attr_name(doc,attr);
3201 char *value = qs_get_attr_value(doc,attr);
3202 if (STRCASEEQ('d','D',"direction", name)) {
3203 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3204 W_L(" direction=\"");
3209 else if (STRCASEEQ('b','B',"behavior",name)) {
3210 if (value && (STRCASEEQ('s','S',"scroll",value) || STRCASEEQ('s','S',"slide",value) || STRCASEEQ('a','A',"alternate",value))) {
3211 W_L(" behavior=\"");
3216 else if (STRCASEEQ('l','L',"loop",name)) {
3217 if (value && *value) {
3223 else if (STRCASEEQ('b','B',"bgcolor",name)) {
3224 if (value && *value) {
3232 return chtml50->out;
3237 * It is a handler who processes the MARQUEE tag.
3239 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3240 * destination is specified.
3241 * @param node [i] The MARQUEE tag node is specified.
3242 * @return The conversion result is returned.
3245 s_chtml50_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3247 chtml50_t *chtml50 = GET_CHTML50(pdoc);
3248 Doc *doc = chtml50->doc;
3250 return chtml50->out;
3255 * It is a handler who processes the BLINK tag.
3257 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3258 * destination is specified.
3259 * @param node [i] The BLINK tag node is specified.
3260 * @return The conversion result is returned.
3263 s_chtml50_start_blink_tag(void *pdoc, Node *UNUSED(child))
3265 chtml50_t *chtml50 = GET_CHTML50(pdoc);
3266 Doc *doc = chtml50->doc;
3268 return chtml50->out;
3273 * It is a handler who processes the BLINK tag.
3275 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3276 * destination is specified.
3277 * @param node [i] The BLINK tag node is specified.
3278 * @return The conversion result is returned.
3281 s_chtml50_end_blink_tag(void *pdoc, Node *UNUSED(child))
3283 chtml50_t *chtml50 = GET_CHTML50(pdoc);
3284 Doc *doc = chtml50->doc;
3286 return chtml50->out;
3291 * It is a handler who processes the MENU tag.
3293 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3294 * destination is specified.
3295 * @param node [i] The MENU tag node is specified.
3296 * @return The conversion result is returned.
3299 s_chtml50_start_menu_tag(void *pdoc, Node *node)
3301 chtml50_t *chtml50 = GET_CHTML50(pdoc);
3302 Doc *doc = chtml50->doc;
3305 /*--------------------------------------------------------------------------*/
3306 /* Get Attributes */
3307 /*--------------------------------------------------------------------------*/
3308 for (attr = qs_get_attr(doc,node);
3310 attr = qs_get_next_attr(doc,attr)) {
3311 char *name = qs_get_attr_name(doc,attr);
3312 char *value = qs_get_attr_value(doc,attr);
3313 if (STRCASEEQ('t','T',"type",name)) {
3314 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
3322 return chtml50->out;
3327 * It is a handler who processes the MENU tag.
3329 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3330 * destination is specified.
3331 * @param node [i] The MENU tag node is specified.
3332 * @return The conversion result is returned.
3335 s_chtml50_end_menu_tag(void *pdoc, Node *UNUSED(child))
3337 chtml50_t *chtml50 = GET_CHTML50(pdoc);
3338 Doc *doc = chtml50->doc;
3340 return chtml50->out;
3345 * It is a handler who processes the PLAINTEXT tag.
3347 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3348 * destination is specified.
3349 * @param node [i] The PLAINTEXT tag node is specified.
3350 * @return The conversion result is returned.
3353 s_chtml50_start_plaintext_tag(void *pdoc, Node *node)
3355 chtml50_t *chtml50 = GET_CHTML50(pdoc);
3356 Doc *doc = chtml50->doc;
3358 s_chtml50_start_plaintext_tag_inner(pdoc,node);
3359 return chtml50->out;
3363 s_chtml50_start_plaintext_tag_inner(void *pdoc, Node *node)
3365 chtml50_t *chtml50 = GET_CHTML50(pdoc);
3366 Doc *doc = chtml50->doc;
3368 for (child = qs_get_child_node(doc, node);
3370 child = qs_get_next_node(doc, child)) {
3372 s_chtml50_start_plaintext_tag_inner(pdoc, child);
3374 return chtml50->out;
3379 * It is a handler who processes the PLAINTEXT tag.
3381 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3382 * destination is specified.
3383 * @param node [i] The PLAINTEXT tag node is specified.
3384 * @return The conversion result is returned.
3387 s_chtml50_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3389 chtml50_t *chtml50 = GET_CHTML50(pdoc);
3390 return chtml50->out;
3395 * It is handler who processes the New Line Code.
3398 s_chtml50_newline_mark(void *pdoc, Node *UNUSED(node))
3400 chtml50_t *chtml50 = GET_CHTML50(pdoc);
3401 Doc *doc = chtml50->doc;
3403 return chtml50->out;