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.
17 #include "chxj_chtml20.h"
18 #include "chxj_hdml.h"
19 #include "chxj_str_util.h"
20 #include "chxj_dump.h"
21 #include "chxj_img_conv.h"
22 #include "chxj_qr_code.h"
23 #include "chxj_encoding.h"
24 #include "chxj_buffered_write.h"
25 #include "chxj_header_inf.h"
28 #define GET_CHTML20(X) ((chtml20_t*)(X))
31 #define W_L(X) do { chtml20->out = BUFFERED_WRITE_LITERAL(chtml20->out, &doc->buf, (X)); } while(0)
32 #define W_V(X) do { chtml20->out = (X) ? BUFFERED_WRITE_VALUE(chtml20->out, &doc->buf, (X)) \
33 : BUFFERED_WRITE_LITERAL(chtml20->out, &doc->buf, ""); } while(0)
35 #define W_NLCODE() do { char *nlcode = TO_NLCODE(chtml20->conf); W_V(nlcode); } while (0)
37 static char *s_chtml20_start_html_tag (void *pdoc, Node *node);
38 static char *s_chtml20_end_html_tag (void *pdoc, Node *node);
39 static char *s_chtml20_start_meta_tag (void *pdoc, Node *node);
40 static char *s_chtml20_end_meta_tag (void *pdoc, Node *node);
41 static char *s_chtml20_start_textarea_tag(void *pdoc, Node *node);
42 static char *s_chtml20_end_textarea_tag (void *pdoc, Node *node);
43 static char *s_chtml20_start_p_tag (void *pdoc, Node *node);
44 static char *s_chtml20_end_p_tag (void *pdoc, Node *node);
45 static char *s_chtml20_start_pre_tag (void *pdoc, Node *node);
46 static char *s_chtml20_end_pre_tag (void *pdoc, Node *node);
47 static char *s_chtml20_start_h1_tag (void *pdoc, Node *node);
48 static char *s_chtml20_end_h1_tag (void *pdoc, Node *node);
49 static char *s_chtml20_start_h2_tag (void *pdoc, Node *node);
50 static char *s_chtml20_end_h2_tag (void *pdoc, Node *node);
51 static char *s_chtml20_start_h3_tag (void *pdoc, Node *node);
52 static char *s_chtml20_end_h3_tag (void *pdoc, Node *node);
53 static char *s_chtml20_start_h4_tag (void *pdoc, Node *node);
54 static char *s_chtml20_end_h4_tag (void *pdoc, Node *node);
55 static char *s_chtml20_start_h5_tag (void *pdoc, Node *node);
56 static char *s_chtml20_end_h5_tag (void *pdoc, Node *node);
57 static char *s_chtml20_start_h6_tag (void *pdoc, Node *node);
58 static char *s_chtml20_end_h6_tag (void *pdoc, Node *node);
59 static char *s_chtml20_start_ul_tag (void *pdoc, Node *node);
60 static char *s_chtml20_end_ul_tag (void *pdoc, Node *node);
61 static char *s_chtml20_start_ol_tag (void *pdoc, Node *node);
62 static char *s_chtml20_end_ol_tag (void *pdoc, Node *node);
63 static char *s_chtml20_start_li_tag (void *pdoc, Node *node);
64 static char *s_chtml20_end_li_tag (void *pdoc, Node *node);
65 static char *s_chtml20_start_head_tag (void *pdoc, Node *node);
66 static char *s_chtml20_end_head_tag (void *pdoc, Node *node);
67 static char *s_chtml20_start_title_tag (void *pdoc, Node *node);
68 static char *s_chtml20_end_title_tag (void *pdoc, Node *node);
69 static char *s_chtml20_start_base_tag (void *pdoc, Node *node);
70 static char *s_chtml20_end_base_tag (void *pdoc, Node *node);
71 static char *s_chtml20_start_body_tag (void *pdoc, Node *node);
72 static char *s_chtml20_end_body_tag (void *pdoc, Node *node);
73 static char *s_chtml20_start_a_tag (void *pdoc, Node *node);
74 static char *s_chtml20_end_a_tag (void *pdoc, Node *node);
75 static char *s_chtml20_start_br_tag (void *pdoc, Node *node);
76 static char *s_chtml20_end_br_tag (void *pdoc, Node *node);
77 static char *s_chtml20_start_tr_tag (void *pdoc, Node *node);
78 static char *s_chtml20_end_tr_tag (void *pdoc, Node *node);
79 static char *s_chtml20_start_font_tag (void *pdoc, Node *node);
80 static char *s_chtml20_end_font_tag (void *pdoc, Node *node);
81 static char *s_chtml20_start_form_tag (void *pdoc, Node *node);
82 static char *s_chtml20_end_form_tag (void *pdoc, Node *node);
83 static char *s_chtml20_start_input_tag (void *pdoc, Node *node);
84 static char *s_chtml20_end_input_tag (void *pdoc, Node *node);
85 static char *s_chtml20_start_center_tag (void *pdoc, Node *node);
86 static char *s_chtml20_end_center_tag (void *pdoc, Node *node);
87 static char *s_chtml20_start_hr_tag (void *pdoc, Node *node);
88 static char *s_chtml20_end_hr_tag (void *pdoc, Node *node);
89 static char *s_chtml20_start_img_tag (void *pdoc, Node *node);
90 static char *s_chtml20_end_img_tag (void *pdoc, Node *node);
91 static char *s_chtml20_start_select_tag (void *pdoc, Node *node);
92 static char *s_chtml20_end_select_tag (void *pdoc, Node *node);
93 static char *s_chtml20_start_option_tag (void *pdoc, Node *node);
94 static char *s_chtml20_end_option_tag (void *pdoc, Node *node);
95 static char *s_chtml20_start_div_tag (void *pdoc, Node *node);
96 static char *s_chtml20_end_div_tag (void *pdoc, Node *node);
97 static char *s_chtml20_start_blockquote_tag(void *pdoc, Node *node);
98 static char *s_chtml20_end_blockquote_tag (void *pdoc, Node *node);
99 static char *s_chtml20_start_dir_tag (void *pdoc, Node *node);
100 static char *s_chtml20_end_dir_tag (void *pdoc, Node *node);
101 static char *s_chtml20_start_dl_tag (void *pdoc, Node *node);
102 static char *s_chtml20_end_dl_tag (void *pdoc, Node *node);
103 static char *s_chtml20_start_dt_tag (void *pdoc, Node *node);
104 static char *s_chtml20_end_dt_tag (void *pdoc, Node *node);
105 static char *s_chtml20_start_dd_tag (void *pdoc, Node *node);
106 static char *s_chtml20_end_dd_tag (void *pdoc, Node *node);
107 static char *s_chtml20_start_menu_tag (void *pdoc, Node *node);
108 static char *s_chtml20_end_menu_tag (void *pdoc, Node *node);
109 static char *s_chtml20_start_plaintext_tag (void *pdoc, Node *node);
110 static char *s_chtml20_start_plaintext_tag_inner (void *pdoc, Node *node);
111 static char *s_chtml20_end_plaintext_tag (void *pdoc, Node *node);
112 static char *s_chtml20_start_blink_tag (void *pdoc, Node *node);
113 static char *s_chtml20_end_blink_tag (void *pdoc, Node *node);
114 static char *s_chtml20_start_marquee_tag (void *pdoc, Node *node);
115 static char *s_chtml20_end_marquee_tag (void *pdoc, Node *node);
116 static char *s_chtml20_newline_mark (void *pdoc, Node *node);
118 static void s_init_chtml20(chtml20_t *chtml, Doc *doc, request_rec *r, device_table *spec);
120 static int s_chtml20_search_emoji(chtml20_t *chtml, char *txt, char **rslt);
122 static char *s_chtml20_chxjif_tag(void *pdoc, Node *node);
123 static char *s_chtml20_text_tag(void *pdoc, Node *node);
126 tag_handler chtml20_handler[] = {
129 s_chtml20_start_html_tag,
130 s_chtml20_end_html_tag,
134 s_chtml20_start_meta_tag,
135 s_chtml20_end_meta_tag,
139 s_chtml20_start_textarea_tag,
140 s_chtml20_end_textarea_tag,
144 s_chtml20_start_p_tag,
149 s_chtml20_start_pre_tag,
150 s_chtml20_end_pre_tag,
154 s_chtml20_start_ul_tag,
155 s_chtml20_end_ul_tag,
159 s_chtml20_start_li_tag,
160 s_chtml20_end_li_tag,
164 s_chtml20_start_ol_tag,
165 s_chtml20_end_ol_tag,
169 s_chtml20_start_h1_tag,
170 s_chtml20_end_h1_tag,
174 s_chtml20_start_h2_tag,
175 s_chtml20_end_h2_tag,
179 s_chtml20_start_h3_tag,
180 s_chtml20_end_h3_tag,
184 s_chtml20_start_h4_tag,
185 s_chtml20_end_h4_tag,
189 s_chtml20_start_h5_tag,
190 s_chtml20_end_h5_tag,
194 s_chtml20_start_h6_tag,
195 s_chtml20_end_h6_tag,
199 s_chtml20_start_head_tag,
200 s_chtml20_end_head_tag,
204 s_chtml20_start_title_tag,
205 s_chtml20_end_title_tag,
209 s_chtml20_start_base_tag,
210 s_chtml20_end_base_tag,
214 s_chtml20_start_body_tag,
215 s_chtml20_end_body_tag,
219 s_chtml20_start_a_tag,
224 s_chtml20_start_br_tag,
225 s_chtml20_end_br_tag,
234 s_chtml20_start_tr_tag,
235 s_chtml20_end_tr_tag,
249 s_chtml20_start_font_tag,
250 s_chtml20_end_font_tag,
254 s_chtml20_start_form_tag,
255 s_chtml20_end_form_tag,
259 s_chtml20_start_input_tag,
260 s_chtml20_end_input_tag,
264 s_chtml20_start_center_tag,
265 s_chtml20_end_center_tag,
269 s_chtml20_start_hr_tag,
270 s_chtml20_end_hr_tag,
274 s_chtml20_start_img_tag,
275 s_chtml20_end_img_tag,
279 s_chtml20_start_select_tag,
280 s_chtml20_end_select_tag,
284 s_chtml20_start_option_tag,
285 s_chtml20_end_option_tag,
289 s_chtml20_start_div_tag,
290 s_chtml20_end_div_tag,
294 s_chtml20_chxjif_tag,
339 s_chtml20_start_dt_tag,
340 s_chtml20_end_dt_tag,
354 s_chtml20_start_blockquote_tag,
355 s_chtml20_end_blockquote_tag,
359 s_chtml20_start_dir_tag,
360 s_chtml20_end_dir_tag,
364 s_chtml20_start_dl_tag,
365 s_chtml20_end_dl_tag,
369 s_chtml20_start_dd_tag,
370 s_chtml20_end_dd_tag,
374 s_chtml20_start_menu_tag,
375 s_chtml20_end_menu_tag,
379 s_chtml20_start_plaintext_tag,
380 s_chtml20_end_plaintext_tag,
384 s_chtml20_start_blink_tag,
385 s_chtml20_end_blink_tag,
389 s_chtml20_start_marquee_tag,
390 s_chtml20_end_marquee_tag,
394 s_chtml20_newline_mark,
400 * converts from CHTML5.0 to CHTML2.0.
402 * @param r [i] Requet_rec is appointed.
403 * @param spec [i] The result of the device specification processing which
404 * was done in advance is appointed.
405 * @param src [i] The character string before the converting is appointed.
406 * @return The character string after the converting is returned.
409 chxj_convert_chtml20(
415 chxjconvrule_entry *entryp,
424 /*--------------------------------------------------------------------------*/
426 /*--------------------------------------------------------------------------*/
428 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
430 DBG(r,"i found qrcode xml");
433 DBG(r,"not found qrcode xml");
435 /*--------------------------------------------------------------------------*/
436 /* The CHTML structure is initialized. */
437 /*--------------------------------------------------------------------------*/
438 s_init_chtml20(&chtml20, &doc, r, spec);
441 chtml20.entryp = entryp;
442 chtml20.cookie = cookie;
444 chxj_set_content_type(r, chxj_header_inf_set_content_type(r, "text/html; charset=Windows-31J"));
446 /*--------------------------------------------------------------------------*/
447 /* The character string of the input is analyzed. */
448 /*--------------------------------------------------------------------------*/
449 qs_init_malloc(&doc);
450 qs_init_root_node(&doc);
452 ss = apr_pcalloc(r->pool, srclen + 1);
453 memset(ss, 0, srclen + 1);
454 memcpy(ss, src, srclen);
457 chxj_dump_out("[src] CHTML -> CHTML2.0", ss, srclen);
460 qs_parse_string(&doc,ss, strlen(ss));
462 chxj_buffered_write_init(r->pool, &doc.buf);
463 /*--------------------------------------------------------------------------*/
464 /* It converts it from CHTML to CHTML. */
465 /*--------------------------------------------------------------------------*/
466 chxj_node_convert(spec,r,(void *)&chtml20, &doc, qs_get_root(&doc), 0);
467 chtml20.out = chxj_buffered_write_flush(chtml20.out, &doc.buf);
468 dst = apr_pstrdup(r->pool, chtml20.out);
469 chxj_buffered_write_terminate(&doc.buf);
471 qs_all_free(&doc,QX_LOGMARK);
474 return apr_pstrdup(r->pool,ss);
477 if (strlen(dst) == 0) {
478 dst = apr_psprintf(r->pool, "\n");
481 *dstlen = strlen(dst);
484 chxj_dump_out("[dst] CHTML -> CHTML2.0", dst, *dstlen);
491 * The CHTML structure is initialized.
493 * @param chtml20 [i/o] The pointer to the HDML structure that wants to be
494 * initialized is specified.
495 * @param doc [i] The Doc structure that should be set to the initialized
496 * HDML structure is specified.
497 * @param r [i] To use POOL, the pointer to request_rec is specified.
498 * @param spec [i] The pointer to the device_table
501 s_init_chtml20(chtml20_t *chtml20, Doc *doc, request_rec *r, device_table *spec)
503 memset(doc, 0, sizeof(Doc));
504 memset(chtml20, 0, sizeof(chtml20_t));
508 chtml20->spec = spec;
509 chtml20->out = qs_alloc_zero_byte_string(r->pool);
510 chtml20->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
512 chtml20->doc->parse_mode = PARSE_MODE_CHTML;
517 * Corresponding EMOJI to a current character-code is retrieved.
518 * The substitution character string is stored in the rslt pointer if agreeing.
520 * @param chtml20 [i] The pointer to the CHTML structure is specified.
521 * @param txt [i] The character string to want to examine whether it is
522 * EMOJI is specified.
523 * @param rslt [o] The pointer to the pointer that stores the result is
525 * @return When corresponding EMOJI exists, it returns it excluding 0.
528 s_chtml20_search_emoji(chtml20_t *chtml20, char *txt, char **rslt)
535 spec = chtml20->spec;
541 DBG(r,"spec is NULL");
543 for (ee = chtml20->conf->emoji;
547 if (ee->imode == NULL) {
548 DBG(r,"emoji->imode is NULL");
552 if (ee->imode->string != NULL
553 && strlen(ee->imode->string) > 0
554 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
555 if (spec == NULL || spec->emoji_type == NULL) {
556 *rslt = apr_palloc(r->pool, 3);
557 (*rslt)[0] = ee->imode->hex1byte & 0xff;
558 (*rslt)[1] = ee->imode->hex2byte & 0xff;
560 return strlen(ee->imode->string);
572 * It is a handler who processes the HTML tag.
574 * @param pdoc [i/o] The pointer to the CHTML structure at the output
575 * destination is specified.
576 * @param node [i] The HTML tag node is specified.
577 * @return The conversion result is returned.
580 s_chtml20_start_html_tag(void *pdoc, Node *UNUSED(node))
586 chtml20 = GET_CHTML20(pdoc);
590 /*--------------------------------------------------------------------------*/
592 /*--------------------------------------------------------------------------*/
599 * It is a handler who processes the HTML tag.
601 * @param pdoc [i/o] The pointer to the CHTML structure at the output
602 * destination is specified.
603 * @param node [i] The HTML tag node is specified.
604 * @return The conversion result is returned.
607 s_chtml20_end_html_tag(void *pdoc, Node *UNUSED(child))
613 chtml20 = GET_CHTML20(pdoc);
623 * It is a handler who processes the META tag.
625 * @param pdoc [i/o] The pointer to the CHTML structure at the output
626 * destination is specified.
627 * @param node [i] The META tag node is specified.
628 * @return The conversion result is returned.
631 s_chtml20_start_meta_tag(void *pdoc, Node *node)
637 int content_type_flag;
640 chtml20 = GET_CHTML20(pdoc);
644 content_type_flag = 0;
648 /*--------------------------------------------------------------------------*/
650 /*--------------------------------------------------------------------------*/
651 for (attr = qs_get_attr(doc,node);
653 attr = qs_get_next_attr(doc,attr)) {
654 char *name = qs_get_attr_name(doc,attr);
655 char *value = qs_get_attr_value(doc,attr);
659 if (strcasecmp(name, "http-equiv") == 0 && value && *value) {
660 /*----------------------------------------------------------------------*/
662 /*----------------------------------------------------------------------*/
663 W_L(" http-equiv=\"");
666 if (STRCASEEQ('c','C',"content-type", value)) {
667 content_type_flag = 1;
669 if (STRCASEEQ('r','R',"refresh", value)) {
677 if (strcasecmp(name, "content") == 0 && value && *value) {
678 if (content_type_flag) {
682 W_V(chxj_header_inf_set_content_type(r, "text/html; charset=SHIFT_JIS"));
685 else if (refresh_flag) {
686 char *buf = apr_pstrdup(r->pool, value);
690 url = strchr(buf, ';');
692 sec = apr_pstrdup(r->pool, buf);
695 url = chxj_encoding_parameter(r, url);
696 url = chxj_add_cookie_parameter(r, url, chtml20->cookie);
727 * It is a handler who processes the META tag.
729 * @param pdoc [i/o] The pointer to the CHTML structure at the output
730 * destination is specified.
731 * @param node [i] The META tag node is specified.
732 * @return The conversion result is returned.
735 s_chtml20_end_meta_tag(void *pdoc, Node *UNUSED(child))
737 chtml20_t *chtml20 = GET_CHTML20(pdoc);
744 * It is a handler who processes the HEAD tag.
746 * @param pdoc [i/o] The pointer to the CHTML structure at the output
747 * destination is specified.
748 * @param node [i] The HEAD tag node is specified.
749 * @return The conversion result is returned.
752 s_chtml20_start_head_tag(void *pdoc, Node *UNUSED(node))
757 chtml20 = GET_CHTML20(pdoc);
767 * It is a handler who processes the HEAD tag.
769 * @param pdoc [i/o] The pointer to the CHTML structure at the output
770 * destination is specified.
771 * @param node [i] The HEAD tag node is specified.
772 * @return The conversion result is returned.
775 s_chtml20_end_head_tag(void *pdoc, Node *UNUSED(child))
781 chtml20 = GET_CHTML20(pdoc);
792 * It is a handler who processes the TITLE tag.
794 * @param pdoc [i/o] The pointer to the CHTML structure at the output
795 * destination is specified.
796 * @param node [i] The TITLE tag node is specified.
797 * @return The conversion result is returned.
800 s_chtml20_start_title_tag(void *pdoc, Node *UNUSED(node))
806 chtml20 = GET_CHTML20(pdoc);
817 * It is a handler who processes the TITLE tag.
819 * @param pdoc [i/o] The pointer to the CHTML structure at the output
820 * destination is specified.
821 * @param node [i] The TITLE tag node is specified.
822 * @return The conversion result is returned.
825 s_chtml20_end_title_tag(void *pdoc, Node *UNUSED(child))
831 chtml20 = GET_CHTML20(pdoc);
842 * It is a handler who processes the BASE tag.
844 * @param pdoc [i/o] The pointer to the CHTML structure at the output
845 * destination is specified.
846 * @param node [i] The BASE tag node is specified.
847 * @return The conversion result is returned.
850 s_chtml20_start_base_tag(void *pdoc, Node *node)
857 chtml20 = GET_CHTML20(pdoc);
862 /*--------------------------------------------------------------------------*/
864 /*--------------------------------------------------------------------------*/
865 for (attr = qs_get_attr(doc,node);
867 attr = qs_get_next_attr(doc,attr)) {
868 char *name = qs_get_attr_name(doc,attr);
869 char *value = qs_get_attr_value(doc,attr);
870 if (STRCASEEQ('h','H',"href", name)) {
883 * It is a handler who processes the BASE tag.
885 * @param pdoc [i/o] The pointer to the CHTML structure at the output
886 * destination is specified.
887 * @param node [i] The BASE tag node is specified.
888 * @return The conversion result is returned.
891 s_chtml20_end_base_tag(void *pdoc, Node *UNUSED(child))
897 chtml20 = GET_CHTML20(pdoc);
906 * It is a handler who processes the BODY tag.
908 * @param pdoc [i/o] The pointer to the CHTML structure at the output
909 * destination is specified.
910 * @param node [i] The BODY tag node is specified.
911 * @return The conversion result is returned.
914 s_chtml20_start_body_tag(void *pdoc, Node *node)
921 chtml20 = GET_CHTML20(pdoc);
926 /*--------------------------------------------------------------------------*/
928 /*--------------------------------------------------------------------------*/
929 for (attr = qs_get_attr(doc,node);
931 attr = qs_get_next_attr(doc,attr)) {
932 char *name = qs_get_attr_name(doc,attr);
933 char *value = qs_get_attr_value(doc,attr);
937 if (strcasecmp(name, "bgcolor") == 0 && value && *value != 0) {
938 /*----------------------------------------------------------------------*/
940 /*----------------------------------------------------------------------*/
949 if (strcasecmp(name, "text") == 0 && value && *value != 0) {
950 /*----------------------------------------------------------------------*/
952 /*----------------------------------------------------------------------*/
961 if (strcasecmp(name, "link") == 0 && value && *value != 0) {
962 /*----------------------------------------------------------------------*/
964 /*----------------------------------------------------------------------*/
973 if (strcasecmp(name, "alink") == 0) {
974 /*----------------------------------------------------------------------*/
976 /*----------------------------------------------------------------------*/
983 if (strcasecmp(name, "vlink") == 0) {
984 /*----------------------------------------------------------------------*/
986 /*----------------------------------------------------------------------*/
1002 * It is a handler who processes the BODY tag.
1004 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1005 * destination is specified.
1006 * @param node [i] The BODY tag node is specified.
1007 * @return The conversion result is returned.
1010 s_chtml20_end_body_tag(void *pdoc, Node *UNUSED(child))
1016 chtml20 = GET_CHTML20(pdoc);
1022 return chtml20->out;
1027 * It is a handler who processes the A tag.
1029 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1030 * destination is specified.
1031 * @param node [i] The A tag node is specified.
1032 * @return The conversion result is returned.
1035 s_chtml20_start_a_tag(void *pdoc, Node *node)
1042 chtml20 = GET_CHTML20(pdoc);
1047 /*--------------------------------------------------------------------------*/
1048 /* Get Attributes */
1049 /*--------------------------------------------------------------------------*/
1050 for (attr = qs_get_attr(doc,node);
1052 attr = qs_get_next_attr(doc,attr)) {
1053 char *name = qs_get_attr_name(doc,attr);
1054 char *value = qs_get_attr_value(doc,attr);
1058 if (strcasecmp(name, "name") == 0) {
1059 /*--------------------------------------------------------------------*/
1061 /*--------------------------------------------------------------------*/
1070 if (strcasecmp(name, "href") == 0) {
1071 /*--------------------------------------------------------------------*/
1073 /*--------------------------------------------------------------------*/
1074 value = chxj_encoding_parameter(r, value);
1075 if (! chxj_starts_with(value, "mailto:") && ! chxj_starts_with(value, "telto:")) {
1076 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
1086 if (strcasecmp(name, "accesskey") == 0) {
1087 /*--------------------------------------------------------------------*/
1089 /*--------------------------------------------------------------------*/
1090 W_L(" accesskey=\"");
1098 if (strcasecmp(name, "cti") == 0) {
1099 /*--------------------------------------------------------------------*/
1101 /*--------------------------------------------------------------------*/
1110 if (strcasecmp(name, "ijam") == 0) {
1111 /*--------------------------------------------------------------------*/
1113 /*--------------------------------------------------------------------*/
1117 if (strcasecmp(name, "ista") == 0) {
1118 /*--------------------------------------------------------------------*/
1120 /*--------------------------------------------------------------------*/
1124 if (strcasecmp(name, "ilet") == 0) {
1125 /*--------------------------------------------------------------------*/
1127 /*--------------------------------------------------------------------*/
1131 if (strcasecmp(name, "iswf") == 0) {
1132 /*--------------------------------------------------------------------*/
1134 /*--------------------------------------------------------------------*/
1138 if (strcasecmp(name, "irst") == 0) {
1139 /*--------------------------------------------------------------------*/
1141 /*--------------------------------------------------------------------*/
1148 if (strcasecmp(name, "utn") == 0) {
1149 /*--------------------------------------------------------------------*/
1151 /*--------------------------------------------------------------------*/
1158 if (strcasecmp(name, "telbook") == 0) {
1159 /*--------------------------------------------------------------------*/
1161 /*--------------------------------------------------------------------*/
1168 if (strcasecmp(name, "kana") == 0) {
1169 /*--------------------------------------------------------------------*/
1171 /*--------------------------------------------------------------------*/
1178 if (strcasecmp(name, "email") == 0) {
1179 /*--------------------------------------------------------------------*/
1181 /*--------------------------------------------------------------------*/
1191 return chtml20->out;
1196 * It is a handler who processes the A tag.
1198 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1199 * destination is specified.
1200 * @param node [i] The A tag node is specified.
1201 * @return The conversion result is returned.
1204 s_chtml20_end_a_tag(void *pdoc, Node *UNUSED(child))
1210 chtml20 = GET_CHTML20(pdoc);
1216 return chtml20->out;
1221 * It is a handler who processes the BR tag.
1223 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1224 * destination is specified.
1225 * @param node [i] The BR tag node is specified.
1226 * @return The conversion result is returned.
1229 s_chtml20_start_br_tag(void *pdoc, Node *node)
1236 chtml20 = GET_CHTML20(pdoc);
1241 /*--------------------------------------------------------------------------*/
1242 /* Get Attributes */
1243 /*--------------------------------------------------------------------------*/
1244 for (attr = qs_get_attr(doc,node);
1246 attr = qs_get_next_attr(doc,attr)) {
1247 char *name = qs_get_attr_name(doc,attr);
1248 char *value = qs_get_attr_value(doc,attr);
1249 if (STRCASEEQ('c','C',"clear",name)) {
1250 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1259 return chtml20->out;
1264 * It is a handler who processes the BR tag.
1266 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1267 * destination is specified.
1268 * @param node [i] The BR tag node is specified.
1269 * @return The conversion result is returned.
1272 s_chtml20_end_br_tag(void *pdoc, Node *UNUSED(child))
1278 chtml20 = GET_CHTML20(pdoc);
1282 return chtml20->out;
1287 * It is a handler who processes the TR tag.
1289 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1290 * destination is specified.
1291 * @param node [i] The TR tag node is specified.
1292 * @return The conversion result is returned.
1295 s_chtml20_start_tr_tag(void *pdoc, Node *UNUSED(node))
1301 chtml20 = GET_CHTML20(pdoc);
1305 return chtml20->out;
1310 * It is a handler who processes the TR tag.
1312 * @param chtml20 [i/o] The pointer to the CHTML structure at the output
1313 * destination is specified.
1314 * @param node [i] The TR tag node is specified.
1315 * @return The conversion result is returned.
1318 s_chtml20_end_tr_tag(void *pdoc, Node *UNUSED(child))
1324 chtml20 = GET_CHTML20(pdoc);
1330 return chtml20->out;
1335 * It is a handler who processes the FONT tag.
1337 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1338 * destination is specified.
1339 * @param node [i] The FONT tag node is specified.
1340 * @return The conversion result is returned.
1343 s_chtml20_start_font_tag(void *pdoc, Node *node)
1351 chtml20 = GET_CHTML20(pdoc);
1356 /*--------------------------------------------------------------------------*/
1357 /* Get Attributes */
1358 /*--------------------------------------------------------------------------*/
1359 for (attr = qs_get_attr(doc,node);
1360 attr && color == NULL;
1361 attr = qs_get_next_attr(doc,attr)) {
1362 char *name = qs_get_attr_name(doc,attr);
1363 char *value = qs_get_attr_value(doc,attr);
1367 if (strcasecmp(name, "color") == 0 && value && *value) {
1368 color = apr_pstrdup(doc->buf.pool, value);
1374 if (strcasecmp(name, "size") == 0) {
1375 /*--------------------------------------------------------------------*/
1377 /*--------------------------------------------------------------------*/
1387 W_L("<font color=\"");
1390 chtml20->font_flag++;
1392 return chtml20->out;
1397 * It is a handler who processes the FONT tag.
1399 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1400 * destination is specified.
1401 * @param node [i] The FONT tag node is specified.
1402 * @return The conversion result is returned.
1405 s_chtml20_end_font_tag(void *pdoc, Node *UNUSED(child))
1411 chtml20 = GET_CHTML20(pdoc);
1415 if (chtml20->font_flag) {
1417 chtml20->font_flag--;
1419 return chtml20->out;
1424 * It is a handler who processes the FORM tag.
1426 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1427 * destination is specified.
1428 * @param node [i] The FORM tag node is specified.
1429 * @return The conversion result is returned.
1432 s_chtml20_start_form_tag(void *pdoc, Node *node)
1438 char *new_hidden_tag = NULL;
1439 char *attr_method = NULL;
1440 char *attr_action = NULL;
1442 chtml20 = GET_CHTML20(pdoc);
1446 /*--------------------------------------------------------------------------*/
1447 /* Get Attributes */
1448 /*--------------------------------------------------------------------------*/
1449 for (attr = qs_get_attr(doc,node);
1451 attr = qs_get_next_attr(doc,attr)) {
1454 name = qs_get_attr_name(doc,attr);
1455 value = qs_get_attr_value(doc,attr);
1460 if (strcasecmp(name, "action") == 0) {
1461 /*--------------------------------------------------------------------*/
1463 /*--------------------------------------------------------------------*/
1464 attr_action = chxj_encoding_parameter(r, value);
1465 attr_action= chxj_add_cookie_parameter(r, attr_action, chtml20->cookie);
1471 if (strcasecmp(name, "method") == 0) {
1472 /*--------------------------------------------------------------------*/
1474 /*--------------------------------------------------------------------*/
1475 attr_method = apr_pstrdup(doc->pool, value);
1481 if (strcasecmp(name, "utn") == 0) {
1482 /*--------------------------------------------------------------------*/
1484 /*--------------------------------------------------------------------*/
1494 int post_flag = (attr_method && strcasecmp(attr_method, "post") == 0) ? 1 : 0;
1499 q = strchr(attr_action, '?');
1501 new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 0, post_flag);
1502 if (new_hidden_tag) {
1516 if (new_hidden_tag) {
1517 W_V(new_hidden_tag);
1519 return chtml20->out;
1524 * It is a handler who processes the FORM tag.
1526 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1527 * destination is specified.
1528 * @param node [i] The FORM tag node is specified.
1529 * @return The conversion result is returned.
1532 s_chtml20_end_form_tag(void *pdoc, Node *UNUSED(child))
1538 chtml20 = GET_CHTML20(pdoc);
1544 return chtml20->out;
1549 * It is a handler who processes the INPUT tag.
1551 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1552 * destination is specified.
1553 * @param node [i] The INPUT tag node is specified.
1554 * @return The conversion result is returned.
1557 s_chtml20_start_input_tag(void *pdoc, Node *node)
1562 char *max_length = NULL;
1566 char *istyle = NULL;
1568 char *checked = NULL;
1569 char *accesskey = NULL;
1571 chtml20 = GET_CHTML20(pdoc);
1577 /*--------------------------------------------------------------------------*/
1578 /* Get Attributes */
1579 /*--------------------------------------------------------------------------*/
1580 type = qs_get_type_attr(doc, node, doc->buf.pool);
1581 name = qs_get_name_attr(doc, node, doc->buf.pool);
1582 value = qs_get_value_attr(doc,node,doc->buf.pool);
1583 istyle = qs_get_istyle_attr(doc,node,doc->buf.pool);
1584 max_length = qs_get_maxlength_attr(doc,node,doc->buf.pool);
1585 checked = qs_get_checked_attr(doc,node,doc->buf.pool);
1586 accesskey = qs_get_accesskey_attr(doc, node, doc->buf.pool);
1587 size = qs_get_size_attr(doc, node, doc->buf.pool);
1590 type = qs_trim_string(doc->buf.pool, type);
1591 if (type && (STRCASEEQ('t','T',"text", type) ||
1592 STRCASEEQ('p','P',"password",type) ||
1593 STRCASEEQ('c','C',"checkbox",type) ||
1594 STRCASEEQ('r','R',"radio", type) ||
1595 STRCASEEQ('h','H',"hidden", type) ||
1596 STRCASEEQ('s','S',"submit", type) ||
1597 STRCASEEQ('r','R',"reset", type))) {
1603 if (size && *size) {
1608 if (name && *name) {
1613 if (value && *value) {
1615 W_V(chxj_add_slash_to_doublequote(doc->pool, value));
1618 if (accesskey && *accesskey) {
1619 W_L(" accesskey=\"");
1624 /*------------------------------------------------------------------------*/
1626 /*------------------------------------------------------------------------*/
1627 if (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4') {
1633 /*--------------------------------------------------------------------------*/
1634 /* The figure is default for the password. */
1635 /*--------------------------------------------------------------------------*/
1636 if (max_length && *max_length) {
1637 if (chxj_chk_numeric(max_length) != 0) {
1638 max_length = apr_psprintf(doc->buf.pool, "0");
1640 if (istyle && *istyle == '1') {
1641 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length) * 2);
1645 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length));
1654 return chtml20->out;
1659 * It is a handler who processes the INPUT tag.
1661 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1662 * destination is specified.
1663 * @param node [i] The INPUT tag node is specified.
1664 * @return The conversion result is returned.
1667 s_chtml20_end_input_tag(void *pdoc, Node *UNUSED(child))
1673 chtml20 = GET_CHTML20(pdoc);
1677 return chtml20->out;
1682 * It is a handler who processes the CENTER tag.
1684 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1685 * destination is specified.
1686 * @param node [i] The CENTER tag node is specified.
1687 * @return The conversion result is returned.
1690 s_chtml20_start_center_tag(void *pdoc, Node *UNUSED(node))
1696 chtml20 = GET_CHTML20(pdoc);
1701 return chtml20->out;
1706 * It is a handler who processes the CENTER tag.
1708 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1709 * destination is specified.
1710 * @param node [i] The CENTER tag node is specified.
1711 * @return The conversion result is returned.
1714 s_chtml20_end_center_tag(void *pdoc, Node *UNUSED(child))
1720 chtml20 = GET_CHTML20(pdoc);
1726 return chtml20->out;
1731 * It is a handler who processes the UL tag.
1733 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1734 * destination is specified.
1735 * @param node [i] The UL tag node is specified.
1736 * @return The conversion result is returned.
1739 s_chtml20_start_ul_tag(void *pdoc, Node *UNUSED(node))
1745 chtml20 = GET_CHTML20(pdoc);
1751 return chtml20->out;
1756 * It is a handler who processes the UL tag.
1758 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1759 * destination is specified.
1760 * @param node [i] The UL tag node is specified.
1761 * @return The conversion result is returned.
1764 s_chtml20_end_ul_tag(void *pdoc, Node *UNUSED(child))
1770 chtml20 = GET_CHTML20(pdoc);
1776 return chtml20->out;
1781 * It is a handler who processes the OL tag.
1783 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1784 * destination is specified.
1785 * @param node [i] The OL tag node is specified.
1786 * @return The conversion result is returned.
1789 s_chtml20_start_ol_tag(void *pdoc, Node *node)
1796 chtml20 = GET_CHTML20(pdoc);
1801 /*--------------------------------------------------------------------------*/
1802 /* Get Attributes */
1803 /*--------------------------------------------------------------------------*/
1804 for (attr = qs_get_attr(doc,node);
1806 attr = qs_get_next_attr(doc,attr)) {
1807 char *name = qs_get_attr_name(doc,attr);
1808 char *value = qs_get_attr_value(doc,attr);
1809 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
1814 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
1822 return chtml20->out;
1827 * It is a handler who processes the OL tag.
1829 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1830 * destination is specified.
1831 * @param node [i] The OL tag node is specified.
1832 * @return The conversion result is returned.
1835 s_chtml20_end_ol_tag(void *pdoc, Node *UNUSED(child))
1841 chtml20 = GET_CHTML20(pdoc);
1847 return chtml20->out;
1852 * It is a handler who processes the LI tag.
1854 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1855 * destination is specified.
1856 * @param node [i] The LI tag node is specified.
1857 * @return The conversion result is returned.
1860 s_chtml20_start_li_tag(void *pdoc, Node *node)
1867 chtml20 = GET_CHTML20(pdoc);
1872 /*--------------------------------------------------------------------------*/
1873 /* Get Attributes */
1874 /*--------------------------------------------------------------------------*/
1875 for (attr = qs_get_attr(doc,node);
1877 attr = qs_get_next_attr(doc,attr)) {
1878 char *name = qs_get_attr_name(doc,attr);
1879 char *value = qs_get_attr_value(doc,attr);
1880 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
1885 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
1892 return chtml20->out;
1897 * It is a handler who processes the LI tag.
1899 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1900 * destination is specified.
1901 * @param node [i] The LI tag node is specified.
1902 * @return The conversion result is returned.
1905 s_chtml20_end_li_tag(void *pdoc, Node *UNUSED(child))
1907 chtml20_t *chtml20 = GET_CHTML20(pdoc);
1908 return chtml20->out;
1913 * It is a handler who processes the HR tag.
1915 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1916 * destination is specified.
1917 * @param node [i] The HR tag node is specified.
1918 * @return The conversion result is returned.
1921 s_chtml20_start_hr_tag(void *pdoc, Node *node)
1928 chtml20 = GET_CHTML20(pdoc);
1934 for (attr = qs_get_attr(doc,node);
1936 attr = qs_get_next_attr(doc,attr)) {
1937 char *name = qs_get_attr_name(doc,attr);
1938 char *value = qs_get_attr_value(doc,attr);
1942 if (strcasecmp(name, "align") == 0) {
1943 /*--------------------------------------------------------------------*/
1945 /*--------------------------------------------------------------------*/
1946 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1956 if (strcasecmp(name, "size") == 0) {
1957 /*--------------------------------------------------------------------*/
1959 /*--------------------------------------------------------------------*/
1960 if (value && value[0] != '\0') {
1970 if (strcasecmp(name, "width") == 0) {
1971 /*--------------------------------------------------------------------*/
1973 /*--------------------------------------------------------------------*/
1974 if (value && value[0] != '\0') {
1984 if (strcasecmp(name, "noshade") == 0) {
1985 /*--------------------------------------------------------------------*/
1987 /*--------------------------------------------------------------------*/
1994 if (strcasecmp(name, "color") == 0) {
1995 /*--------------------------------------------------------------------*/
1997 /*--------------------------------------------------------------------*/
2007 return chtml20->out;
2012 * It is a handler who processes the HR tag.
2014 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2015 * destination is specified.
2016 * @param node [i] The HR tag node is specified.
2017 * @return The conversion result is returned.
2020 s_chtml20_end_hr_tag(void *pdoc, Node *UNUSED(child))
2022 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2023 return chtml20->out;
2028 * It is a handler who processes the IMG tag.
2030 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2031 * destination is specified.
2032 * @param node [i] The IMG tag node is specified.
2033 * @return The conversion result is returned.
2036 s_chtml20_start_img_tag(void *pdoc, Node *node)
2042 #ifndef IMG_NOT_CONVERT_FILENAME
2046 chtml20 = GET_CHTML20(pdoc);
2050 #ifndef IMG_NOT_CONVERT_FILENAME
2051 spec = chtml20->spec;
2055 /*-------------------------------------------------------------------------*/
2056 /* Get Attributes */
2057 /*-------------------------------------------------------------------------*/
2058 for (attr = qs_get_attr(doc,node);
2060 attr = qs_get_next_attr(doc,attr)) {
2061 char *name = qs_get_attr_name(doc,attr);
2062 char *value = qs_get_attr_value(doc,attr);
2066 if (strcasecmp(name, "src") == 0) {
2067 /*-------------------------------------------------------------------*/
2069 /*-------------------------------------------------------------------*/
2070 #ifdef IMG_NOT_CONVERT_FILENAME
2071 value = chxj_encoding_parameter(r, value);
2072 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
2073 value = chxj_add_cookie_no_update_parameter(r, value);
2078 value = chxj_img_conv(r, spec, value);
2079 value = chxj_encoding_parameter(r, value);
2080 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
2081 value = chxj_add_cookie_no_update_parameter(r, value);
2091 if (strcasecmp(name, "align" ) == 0) {
2092 /*--------------------------------------------------------------------*/
2094 /*--------------------------------------------------------------------*/
2096 if (STRCASEEQ('t','T',"top", value) ||
2097 STRCASEEQ('m','M',"middle",value) ||
2098 STRCASEEQ('b','B',"bottom",value) ||
2099 STRCASEEQ('l','L',"left", value) ||
2100 STRCASEEQ('r','R',"right", value)) {
2105 else if (STRCASEEQ('c','C',"center", value)) {
2112 else if (strcasecmp(name, "alt" ) == 0 && value && *value) {
2113 /*--------------------------------------------------------------------*/
2115 /*--------------------------------------------------------------------*/
2124 if (strcasecmp(name, "width" ) == 0 && value && *value) {
2125 /*--------------------------------------------------------------------*/
2127 /*--------------------------------------------------------------------*/
2136 if (strcasecmp(name, "height") == 0 && value && *value) {
2137 /*--------------------------------------------------------------------*/
2139 /*--------------------------------------------------------------------*/
2144 else if (strcasecmp(name, "hspace") == 0 && value && *value) {
2145 /*--------------------------------------------------------------------*/
2147 /*--------------------------------------------------------------------*/
2156 if (strcasecmp(name, "vspace") == 0 && value && *value) {
2157 /*--------------------------------------------------------------------*/
2159 /*--------------------------------------------------------------------*/
2171 return chtml20->out;
2176 * It is a handler who processes the IMG tag.
2178 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2179 * destination is specified.
2180 * @param node [i] The IMG tag node is specified.
2181 * @return The conversion result is returned.
2184 s_chtml20_end_img_tag(void *pdoc, Node *UNUSED(child))
2186 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2188 return chtml20->out;
2193 * It is a handler who processes the SELECT tag.
2195 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2196 * destination is specified.
2197 * @param node [i] The SELECT tag node is specified.
2198 * @return The conversion result is returned.
2201 s_chtml20_start_select_tag(void *pdoc, Node *child)
2208 chtml20 = GET_CHTML20(pdoc);
2214 char *multiple = NULL;
2217 for (attr = qs_get_attr(doc,child);
2219 attr = qs_get_next_attr(doc,attr)) {
2220 char *nm = qs_get_attr_name(doc,attr);
2221 char *val = qs_get_attr_value(doc,attr);
2225 if (strcasecmp(nm, "size") == 0) {
2226 /*--------------------------------------------------------------------*/
2227 /* CHTML 1.0 version 2.0 */
2228 /*--------------------------------------------------------------------*/
2229 size = apr_pstrdup(doc->buf.pool, val);
2235 if (strcasecmp(nm, "name") == 0) {
2236 /*--------------------------------------------------------------------*/
2237 /* CHTML 1.0 version 2.0 */
2238 /*--------------------------------------------------------------------*/
2239 name = apr_pstrdup(doc->buf.pool, val);
2245 if (strcasecmp(nm, "multiple") == 0) {
2246 /*--------------------------------------------------------------------*/
2247 /* CHTML 1.0 version 2.0 */
2248 /*--------------------------------------------------------------------*/
2249 multiple = apr_pstrdup(doc->buf.pool, val);
2257 if (size && *size) {
2262 if (name && *name) {
2271 return chtml20->out;
2276 * It is a handler who processes the SELECT tag.
2278 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2279 * destination is specified.
2280 * @param node [i] The SELECT tag node is specified.
2281 * @return The conversion result is returned.
2284 s_chtml20_end_select_tag(void *pdoc, Node *UNUSED(child))
2289 chtml20 = GET_CHTML20(pdoc);
2293 return chtml20->out;
2298 * It is a handler who processes the OPTION tag.
2300 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2301 * destination is specified.
2302 * @param node [i] The OPTION tag node is specified.
2303 * @return The conversion result is returned.
2306 s_chtml20_start_option_tag(void *pdoc, Node *child)
2313 chtml20 = GET_CHTML20(pdoc);
2317 char *selected = NULL;
2321 for (attr = qs_get_attr(doc,child);
2323 attr = qs_get_next_attr(doc,attr)) {
2324 char *nm = qs_get_attr_name(doc,attr);
2325 char *val = qs_get_attr_value(doc,attr);
2329 if (strcasecmp(nm, "selected") == 0) {
2330 /*--------------------------------------------------------------------*/
2331 /* CHTML 1.0 version 2.0 */
2332 /*--------------------------------------------------------------------*/
2333 selected = apr_pstrdup(doc->buf.pool, val);
2339 if (strcasecmp(nm, "value") == 0) {
2340 /*--------------------------------------------------------------------*/
2341 /* CHTML 1.0 version 2.0 */
2342 /*--------------------------------------------------------------------*/
2343 value = apr_pstrdup(doc->buf.pool, val);
2352 if (value && *value) {
2362 return chtml20->out;
2367 * It is a handler who processes the OPTION tag.
2369 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2370 * destination is specified.
2371 * @param node [i] The OPTION tag node is specified.
2372 * @return The conversion result is returned.
2375 s_chtml20_end_option_tag(void *pdoc, Node *UNUSED(child))
2377 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2381 return chtml20->out;
2386 * It is a handler who processes the DIV tag.
2388 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2389 * destination is specified.
2390 * @param node [i] The DIV tag node is specified.
2391 * @return The conversion result is returned.
2394 s_chtml20_start_div_tag(void *pdoc, Node *child)
2401 chtml20 = GET_CHTML20(pdoc);
2409 for (attr = qs_get_attr(doc,child);
2411 attr = qs_get_next_attr(doc,attr)) {
2412 char *nm = qs_get_attr_name(doc,attr);
2413 char *val = qs_get_attr_value(doc,attr);
2414 if (STRCASEEQ('a','A', "align", nm)) {
2415 /*----------------------------------------------------------------------*/
2416 /* CHTML 1.0 (W3C version 3.2) */
2417 /*----------------------------------------------------------------------*/
2418 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2419 align = apr_pstrdup(doc->buf.pool, val);
2429 return chtml20->out;
2434 * It is a handler who processes the DIV tag.
2436 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2437 * destination is specified.
2438 * @param node [i] The DIV tag node is specified.
2439 * @return The conversion result is returned.
2442 s_chtml20_end_div_tag(void *pdoc, Node *UNUSED(child))
2444 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2445 Doc *doc = chtml20->doc;
2448 return chtml20->out;
2453 * It is a handler who processes the H1 tag.
2455 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2456 * destination is specified.
2457 * @param node [i] The H1 tag node is specified.
2458 * @return The conversion result is returned.
2461 s_chtml20_start_h1_tag(void *pdoc, Node *node)
2468 chtml20 = GET_CHTML20(pdoc);
2473 for (attr = qs_get_attr(doc,node);
2475 attr = qs_get_next_attr(doc,attr)) {
2476 char *name = qs_get_attr_name(doc,attr);
2477 char *value = qs_get_attr_value(doc,attr);
2478 if (STRCASEEQ('a','A',"align", name)) {
2479 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2488 return chtml20->out;
2493 * It is a handler who processes the H1 tag.
2495 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2496 * destination is specified.
2497 * @param node [i] The H1 tag node is specified.
2498 * @return The conversion result is returned.
2501 s_chtml20_end_h1_tag(void *pdoc, Node *UNUSED(child))
2506 chtml20 = GET_CHTML20(pdoc);
2510 return chtml20->out;
2515 * It is a handler who processes the H2 tag.
2517 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2518 * destination is specified.
2519 * @param node [i] The H2 tag node is specified.
2520 * @return The conversion result is returned.
2523 s_chtml20_start_h2_tag(void *pdoc, Node *node)
2530 chtml20 = GET_CHTML20(pdoc);
2535 for (attr = qs_get_attr(doc,node);
2537 attr = qs_get_next_attr(doc,attr)) {
2538 char *name = qs_get_attr_name(doc,attr);
2539 char *value = qs_get_attr_value(doc,attr);
2540 if (STRCASEEQ('a','A',"align", name)) {
2541 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2550 return chtml20->out;
2555 * It is a handler who processes the H2 tag.
2557 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2558 * destination is specified.
2559 * @param node [i] The H2 tag node is specified.
2560 * @return The conversion result is returned.
2563 s_chtml20_end_h2_tag(void *pdoc, Node *UNUSED(child))
2565 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2566 Doc *doc = chtml20->doc;
2570 return chtml20->out;
2575 * It is a handler who processes the H3 tag.
2577 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2578 * destination is specified.
2579 * @param node [i] The H3 tag node is specified.
2580 * @return The conversion result is returned.
2583 s_chtml20_start_h3_tag(void *pdoc, Node *node)
2590 chtml20 = GET_CHTML20(pdoc);
2595 for (attr = qs_get_attr(doc,node);
2597 attr = qs_get_next_attr(doc,attr)) {
2598 char *name = qs_get_attr_name(doc,attr);
2599 char *value = qs_get_attr_value(doc,attr);
2600 if (STRCASEEQ('a','A',"align", name)) {
2601 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2610 return chtml20->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_chtml20_end_h3_tag(void *pdoc, Node *UNUSED(child))
2625 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2626 Doc *doc = chtml20->doc;
2629 return chtml20->out;
2634 * It is a handler who processes the H4 tag.
2636 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2637 * destination is specified.
2638 * @param node [i] The H4 tag node is specified.
2639 * @return The conversion result is returned.
2642 s_chtml20_start_h4_tag(void *pdoc, Node *node)
2649 chtml20 = GET_CHTML20(pdoc);
2654 for (attr = qs_get_attr(doc,node);
2656 attr = qs_get_next_attr(doc,attr)) {
2657 char *name = qs_get_attr_name(doc,attr);
2658 char *value = qs_get_attr_value(doc,attr);
2659 if (STRCASEEQ('a','A',"align", name)) {
2660 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2669 return chtml20->out;
2674 * It is a handler who processes the H4 tag.
2676 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2677 * destination is specified.
2678 * @param node [i] The H4 tag node is specified.
2679 * @return The conversion result is returned.
2682 s_chtml20_end_h4_tag(void *pdoc, Node *UNUSED(child))
2684 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2685 Doc *doc = chtml20->doc;
2688 return chtml20->out;
2693 * It is a handler who processes the H5 tag.
2695 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2696 * destination is specified.
2697 * @param node [i] The H5 tag node is specified.
2698 * @return The conversion result is returned.
2701 s_chtml20_start_h5_tag(void *pdoc, Node *node)
2708 chtml20 = GET_CHTML20(pdoc);
2713 for (attr = qs_get_attr(doc,node);
2715 attr = qs_get_next_attr(doc,attr)) {
2716 char *name = qs_get_attr_name(doc,attr);
2717 char *value = qs_get_attr_value(doc,attr);
2718 if (STRCASEEQ('a','A',"align", name)) {
2719 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2728 return chtml20->out;
2733 * It is a handler who processes the H5 tag.
2735 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2736 * destination is specified.
2737 * @param node [i] The H5 tag node is specified.
2738 * @return The conversion result is returned.
2741 s_chtml20_end_h5_tag(void *pdoc, Node *UNUSED(child))
2743 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2744 Doc *doc = chtml20->doc;
2747 return chtml20->out;
2752 * It is a handler who processes the H6 tag.
2754 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2755 * destination is specified.
2756 * @param node [i] The H6 tag node is specified.
2757 * @return The conversion result is returned.
2760 s_chtml20_start_h6_tag(void *pdoc, Node *node)
2767 chtml20 = GET_CHTML20(pdoc);
2772 for (attr = qs_get_attr(doc,node);
2774 attr = qs_get_next_attr(doc,attr)) {
2775 char *name = qs_get_attr_name(doc,attr);
2776 char *value = qs_get_attr_value(doc,attr);
2777 if (STRCASEEQ('a','A',"align", name)) {
2778 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2787 return chtml20->out;
2792 * It is a handler who processes the H6 tag.
2794 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2795 * destination is specified.
2796 * @param node [i] The H6 tag node is specified.
2797 * @return The conversion result is returned.
2800 s_chtml20_end_h6_tag(void *pdoc, Node *UNUSED(child))
2802 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2803 Doc *doc = chtml20->doc;
2806 return chtml20->out;
2811 * It is a handler who processes the PRE tag.
2813 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2814 * destination is specified.
2815 * @param node [i] The PRE tag node is specified.
2816 * @return The conversion result is returned.
2819 s_chtml20_start_pre_tag(void *pdoc, Node *UNUSED(node))
2821 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2822 Doc *doc = chtml20->doc;
2824 chtml20->pre_flag++;
2826 return chtml20->out;
2831 * It is a handler who processes the PRE tag.
2833 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2834 * destination is specified.
2835 * @param node [i] The PRE tag node is specified.
2836 * @return The conversion result is returned.
2839 s_chtml20_end_pre_tag(void *pdoc, Node *UNUSED(child))
2841 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2842 Doc *doc = chtml20->doc;
2845 chtml20->pre_flag--;
2847 return chtml20->out;
2852 * It is a handler who processes the P tag.
2854 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2855 * destination is specified.
2856 * @param node [i] The P tag node is specified.
2857 * @return The conversion result is returned.
2860 s_chtml20_start_p_tag(void *pdoc, Node *node)
2868 chtml20 = GET_CHTML20(pdoc);
2873 for (attr = qs_get_attr(doc,node);
2875 attr = qs_get_next_attr(doc,attr)) {
2876 char *nm = qs_get_attr_name(doc,attr);
2877 char *val = qs_get_attr_value(doc,attr);
2878 if (STRCASEEQ('a','A',"align", nm)) {
2879 /*----------------------------------------------------------------------*/
2880 /* CHTML 1.0 (W3C version 3.2) */
2881 /*----------------------------------------------------------------------*/
2882 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2883 align = apr_pstrdup(doc->buf.pool, val);
2894 return chtml20->out;
2899 * It is a handler who processes the P tag.
2901 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2902 * destination is specified.
2903 * @param node [i] The P tag node is specified.
2904 * @return The conversion result is returned.
2907 s_chtml20_end_p_tag(void *pdoc, Node *UNUSED(child))
2913 chtml20 = GET_CHTML20(pdoc);
2918 return chtml20->out;
2923 s_chtml20_chxjif_tag(void *pdoc, Node *node)
2930 chtml20 = GET_CHTML20(pdoc);
2934 for (child = qs_get_child_node(doc, node);
2936 child = qs_get_next_node(doc, child)) {
2939 s_chtml20_chxjif_tag(pdoc, child);
2947 * It is a handler who processes the TEXTARE tag.
2949 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2950 * destination is specified.
2951 * @param node [i] The TEXTAREA tag node is specified.
2952 * @return The conversion result is returned.
2955 s_chtml20_start_textarea_tag(void *pdoc, Node *node)
2962 chtml20 = GET_CHTML20(pdoc);
2966 chtml20->textarea_flag++;
2968 for (attr = qs_get_attr(doc,node);
2970 attr = qs_get_next_attr(doc,attr)) {
2971 char *name = qs_get_attr_name(doc,attr);
2972 char *value = qs_get_attr_value(doc,attr);
2976 if (strcasecmp(name, "accesskey") == 0 && value && *value != 0) {
2977 W_L(" accesskey=\"");
2985 if (strcasecmp(name, "name") == 0 && value && *value != 0) {
2994 if (strcasecmp(name, "rows") == 0 && value && *value != 0) {
3003 if (strcasecmp(name, "cols") == 0 && value && *value != 0) {
3012 if (strcasecmp(name, "istyle") == 0 && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
3024 return chtml20->out;
3029 * It is a handler who processes the TEXTAREA tag.
3031 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3032 * destination is specified.
3033 * @param node [i] The TEXTAREA tag node is specified.
3034 * @return The conversion result is returned.
3037 s_chtml20_end_textarea_tag(void *pdoc, Node *UNUSED(child))
3039 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3040 Doc *doc = chtml20->doc;
3043 chtml20->textarea_flag--;
3045 return chtml20->out;
3050 s_chtml20_text_tag(void *pdoc, Node *child)
3062 chtml20 = GET_CHTML20(pdoc);
3066 textval = qs_get_node_value(doc,child);
3067 if (strlen(textval) == 0) {
3068 return chtml20->out;
3071 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
3072 memset(tmp, 0, qs_get_node_size(doc,child)+1);
3074 tdst = qs_alloc_zero_byte_string(doc->buf.pool);
3075 memset(one_byte, 0, sizeof(one_byte));
3078 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
3080 int rtn = s_chtml20_search_emoji(chtml20, &textval[ii], &out);
3082 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
3086 if (is_sjis_kanji(textval[ii])) {
3087 one_byte[0] = textval[ii+0];
3088 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3089 one_byte[0] = textval[ii+1];
3090 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3094 if (chtml20->pre_flag) {
3095 one_byte[0] = textval[ii+0];
3096 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3099 if (chtml20->textarea_flag) {
3100 one_byte[0] = textval[ii+0];
3101 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3104 if (textval[ii] != '\r' && textval[ii] != '\n') {
3105 one_byte[0] = textval[ii+0];
3106 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3110 return chtml20->out;
3115 * It is a handler who processes the BLOCKQUOTE tag.
3117 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3118 * destination is specified.
3119 * @param node [i] The BLOCKQUOTE tag node is specified.
3120 * @return The conversion result is returned.
3123 s_chtml20_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
3125 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3126 Doc *doc = chtml20->doc;
3127 W_L("<blockquote>");
3128 return chtml20->out;
3133 * It is a handler who processes the BLOCKQUOTE tag.
3135 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3136 * destination is specified.
3137 * @param node [i] The BLOCKQUOTE tag node is specified.
3138 * @return The conversion result is returned.
3141 s_chtml20_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
3143 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3144 Doc *doc = chtml20->doc;
3145 W_L("</blockquote>");
3146 return chtml20->out;
3151 * It is a handler who processes the DIR tag.
3153 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3154 * destination is specified.
3155 * @param node [i] The DIR tag node is specified.
3156 * @return The conversion result is returned.
3159 s_chtml20_start_dir_tag(void *pdoc, Node *UNUSED(child))
3161 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3162 Doc *doc = chtml20->doc;
3164 return chtml20->out;
3169 * It is a handler who processes the DIR tag.
3171 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3172 * destination is specified.
3173 * @param node [i] The DIR tag node is specified.
3174 * @return The conversion result is returned.
3177 s_chtml20_end_dir_tag(void *pdoc, Node *UNUSED(child))
3179 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3180 Doc *doc = chtml20->doc;
3183 return chtml20->out;
3188 * It is a handler who processes the DL tag.
3190 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3191 * destination is specified.
3192 * @param node [i] The DL tag node is specified.
3193 * @return The conversion result is returned.
3196 s_chtml20_start_dl_tag(void *pdoc, Node *UNUSED(child))
3198 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3199 Doc *doc = chtml20->doc;
3201 return chtml20->out;
3206 * It is a handler who processes the DL tag.
3208 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3209 * destination is specified.
3210 * @param node [i] The DL tag node is specified.
3211 * @return The conversion result is returned.
3214 s_chtml20_end_dl_tag(void *pdoc, Node *UNUSED(child))
3216 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3217 Doc *doc = chtml20->doc;
3219 return chtml20->out;
3224 * It is a handter who processes the DT tag.
3226 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3227 * destination is specified.
3228 * @param node [i] The DT tag node is specified.
3229 * @return The conversion result is returned.
3232 s_chtml20_start_dt_tag(void *pdoc, Node *UNUSED(child))
3234 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3235 Doc *doc = chtml20->doc;
3237 return chtml20->out;
3242 * It is a handter who processes the DT tag.
3244 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3245 * destination is specified.
3246 * @param node [i] The DT tag node is specified.
3247 * @return The conversion result is returned.
3250 s_chtml20_end_dt_tag(void *pdoc, Node *UNUSED(child))
3252 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3254 return chtml20->out;
3259 * It is a handder who processes the DD tag.
3261 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3262 * destination is specified.
3263 * @param node [i] The DD tag node is specified.
3264 * @return The conversion result is returned.
3267 s_chtml20_start_dd_tag(void *pdoc, Node *UNUSED(child))
3269 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3270 Doc *doc = chtml20->doc;
3272 return chtml20->out;
3277 * It is a handder who processes the DD tag.
3279 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3280 * destination is specified.
3281 * @param node [i] The DD tag node is specified.
3282 * @return The conversion result is returned.
3285 s_chtml20_end_dd_tag(void *pdoc, Node *UNUSED(child))
3287 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3289 return chtml20->out;
3294 * It is a hanmenuer who processes the MENU tag.
3296 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3297 * destination is specified.
3298 * @param node [i] The MENU tag node is specified.
3299 * @return The conversion result is returned.
3302 s_chtml20_start_menu_tag(void *pdoc, Node *UNUSED(child))
3304 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3305 Doc *doc = chtml20->doc;
3308 return chtml20->out;
3313 * It is a hanmenuer who processes the MENU tag.
3315 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3316 * destination is specified.
3317 * @param node [i] The MENU tag node is specified.
3318 * @return The conversion result is returned.
3321 s_chtml20_end_menu_tag(void *pdoc, Node *UNUSED(child))
3323 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3324 Doc *doc = chtml20->doc;
3327 return chtml20->out;
3332 * It is a hanplaintexter who processes the PLAINTEXT tag.
3334 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3335 * destination is specified.
3336 * @param node [i] The PLAINTEXT tag node is specified.
3337 * @return The conversion result is returned.
3340 s_chtml20_start_plaintext_tag(void *pdoc, Node *node)
3342 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3343 Doc *doc = chtml20->doc;
3346 s_chtml20_start_plaintext_tag_inner(pdoc,node);
3347 return chtml20->out;
3351 s_chtml20_start_plaintext_tag_inner(void *pdoc, Node *node)
3353 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3354 Doc *doc = chtml20->doc;
3357 for (child = qs_get_child_node(doc, node);
3359 child = qs_get_next_node(doc, child)) {
3361 s_chtml20_start_plaintext_tag_inner(pdoc, child);
3363 return chtml20->out;
3368 * It is a hanplaintexter who processes the PLAINTEXT tag.
3370 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3371 * destination is specified.
3372 * @param node [i] The PLAINTEXT tag node is specified.
3373 * @return The conversion result is returned.
3376 s_chtml20_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3378 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3379 return chtml20->out;
3383 * It is a hanblinker who processes the BLINK tag.
3385 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3386 * destination is specified.
3387 * @param node [i] The BLINK tag node is specified.
3388 * @return The conversion result is returned.
3391 s_chtml20_start_blink_tag(void *pdoc, Node *UNUSED(child))
3393 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3394 Doc *doc = chtml20->doc;
3396 return chtml20->out;
3401 * It is a hanblinker who processes the BLINK tag.
3403 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3404 * destination is specified.
3405 * @param node [i] The BLINK tag node is specified.
3406 * @return The conversion result is returned.
3409 s_chtml20_end_blink_tag(void *pdoc, Node *UNUSED(child))
3411 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3412 Doc *doc = chtml20->doc;
3414 return chtml20->out;
3419 * It is a hanmarqueeer who processes the MARQUEE tag.
3421 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3422 * destination is specified.
3423 * @param node [i] The MARQUEE tag node is specified.
3424 * @return The conversion result is returned.
3427 s_chtml20_start_marquee_tag(void *pdoc, Node *node)
3429 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3430 Doc *doc = chtml20->doc;
3433 /*--------------------------------------------------------------------------*/
3434 /* Get Attributes */
3435 /*--------------------------------------------------------------------------*/
3436 for (attr = qs_get_attr(doc,node);
3438 attr = qs_get_next_attr(doc,attr)) {
3439 char *name = qs_get_attr_name(doc,attr);
3440 char *value = qs_get_attr_value(doc,attr);
3441 if (STRCASEEQ('d','D',"direction", name)) {
3442 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3443 W_L(" direction=\"");
3448 else if (STRCASEEQ('b','B',"behavior",name)) {
3449 if (value && (STRCASEEQ('s','S',"scroll",value) || STRCASEEQ('s','S',"slide",value) || STRCASEEQ('a','A',"alternate",value))) {
3450 W_L(" behavior=\"");
3455 else if (STRCASEEQ('l','L',"loop",name)) {
3456 if (value && *value) {
3464 return chtml20->out;
3469 * It is a hanmarqueeer who processes the MARQUEE tag.
3471 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3472 * destination is specified.
3473 * @param node [i] The MARQUEE tag node is specified.
3474 * @return The conversion result is returned.
3477 s_chtml20_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3479 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3480 Doc *doc = chtml20->doc;
3482 return chtml20->out;
3487 * * It is handler who processes the New Line Code.
3490 s_chtml20_newline_mark(void *pdoc, Node *UNUSED(node))
3492 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3493 Doc *doc = chtml20->doc;
3495 return chtml20->out;