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 char *new_query_string = NULL;
1500 q = strchr(attr_action, '?');
1502 new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 0, post_flag, &new_query_string, CHXJ_TRUE);
1503 if (new_hidden_tag) {
1509 if (new_query_string) {
1511 W_V(new_query_string);
1521 if (new_hidden_tag) {
1522 W_V(new_hidden_tag);
1524 return chtml20->out;
1529 * It is a handler who processes the FORM tag.
1531 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1532 * destination is specified.
1533 * @param node [i] The FORM tag node is specified.
1534 * @return The conversion result is returned.
1537 s_chtml20_end_form_tag(void *pdoc, Node *UNUSED(child))
1543 chtml20 = GET_CHTML20(pdoc);
1549 return chtml20->out;
1554 * It is a handler who processes the INPUT tag.
1556 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1557 * destination is specified.
1558 * @param node [i] The INPUT tag node is specified.
1559 * @return The conversion result is returned.
1562 s_chtml20_start_input_tag(void *pdoc, Node *node)
1567 char *max_length = NULL;
1571 char *istyle = NULL;
1573 char *checked = NULL;
1574 char *accesskey = NULL;
1576 chtml20 = GET_CHTML20(pdoc);
1582 /*--------------------------------------------------------------------------*/
1583 /* Get Attributes */
1584 /*--------------------------------------------------------------------------*/
1585 type = qs_get_type_attr(doc, node, doc->buf.pool);
1586 name = qs_get_name_attr(doc, node, doc->buf.pool);
1587 value = qs_get_value_attr(doc,node,doc->buf.pool);
1588 istyle = qs_get_istyle_attr(doc,node,doc->buf.pool);
1589 max_length = qs_get_maxlength_attr(doc,node,doc->buf.pool);
1590 checked = qs_get_checked_attr(doc,node,doc->buf.pool);
1591 accesskey = qs_get_accesskey_attr(doc, node, doc->buf.pool);
1592 size = qs_get_size_attr(doc, node, doc->buf.pool);
1595 type = qs_trim_string(doc->buf.pool, type);
1596 if (type && (STRCASEEQ('t','T',"text", type) ||
1597 STRCASEEQ('p','P',"password",type) ||
1598 STRCASEEQ('c','C',"checkbox",type) ||
1599 STRCASEEQ('r','R',"radio", type) ||
1600 STRCASEEQ('h','H',"hidden", type) ||
1601 STRCASEEQ('s','S',"submit", type) ||
1602 STRCASEEQ('r','R',"reset", type))) {
1608 if (size && *size) {
1613 if (name && *name) {
1618 if (value && *value) {
1620 W_V(chxj_add_slash_to_doublequote(doc->pool, value));
1623 if (accesskey && *accesskey) {
1624 W_L(" accesskey=\"");
1629 /*------------------------------------------------------------------------*/
1631 /*------------------------------------------------------------------------*/
1632 if (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4') {
1638 /*--------------------------------------------------------------------------*/
1639 /* The figure is default for the password. */
1640 /*--------------------------------------------------------------------------*/
1641 if (max_length && *max_length) {
1642 if (chxj_chk_numeric(max_length) != 0) {
1643 max_length = apr_psprintf(doc->buf.pool, "0");
1645 if (istyle && *istyle == '1') {
1646 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length) * 2);
1650 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length));
1659 return chtml20->out;
1664 * It is a handler who processes the INPUT tag.
1666 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1667 * destination is specified.
1668 * @param node [i] The INPUT tag node is specified.
1669 * @return The conversion result is returned.
1672 s_chtml20_end_input_tag(void *pdoc, Node *UNUSED(child))
1678 chtml20 = GET_CHTML20(pdoc);
1682 return chtml20->out;
1687 * It is a handler who processes the CENTER tag.
1689 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1690 * destination is specified.
1691 * @param node [i] The CENTER tag node is specified.
1692 * @return The conversion result is returned.
1695 s_chtml20_start_center_tag(void *pdoc, Node *UNUSED(node))
1701 chtml20 = GET_CHTML20(pdoc);
1706 return chtml20->out;
1711 * It is a handler who processes the CENTER tag.
1713 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1714 * destination is specified.
1715 * @param node [i] The CENTER tag node is specified.
1716 * @return The conversion result is returned.
1719 s_chtml20_end_center_tag(void *pdoc, Node *UNUSED(child))
1725 chtml20 = GET_CHTML20(pdoc);
1731 return chtml20->out;
1736 * It is a handler who processes the UL tag.
1738 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1739 * destination is specified.
1740 * @param node [i] The UL tag node is specified.
1741 * @return The conversion result is returned.
1744 s_chtml20_start_ul_tag(void *pdoc, Node *UNUSED(node))
1750 chtml20 = GET_CHTML20(pdoc);
1756 return chtml20->out;
1761 * It is a handler who processes the UL tag.
1763 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1764 * destination is specified.
1765 * @param node [i] The UL tag node is specified.
1766 * @return The conversion result is returned.
1769 s_chtml20_end_ul_tag(void *pdoc, Node *UNUSED(child))
1775 chtml20 = GET_CHTML20(pdoc);
1781 return chtml20->out;
1786 * It is a handler who processes the OL tag.
1788 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1789 * destination is specified.
1790 * @param node [i] The OL tag node is specified.
1791 * @return The conversion result is returned.
1794 s_chtml20_start_ol_tag(void *pdoc, Node *node)
1801 chtml20 = GET_CHTML20(pdoc);
1806 /*--------------------------------------------------------------------------*/
1807 /* Get Attributes */
1808 /*--------------------------------------------------------------------------*/
1809 for (attr = qs_get_attr(doc,node);
1811 attr = qs_get_next_attr(doc,attr)) {
1812 char *name = qs_get_attr_name(doc,attr);
1813 char *value = qs_get_attr_value(doc,attr);
1814 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
1819 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
1827 return chtml20->out;
1832 * It is a handler who processes the OL tag.
1834 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1835 * destination is specified.
1836 * @param node [i] The OL tag node is specified.
1837 * @return The conversion result is returned.
1840 s_chtml20_end_ol_tag(void *pdoc, Node *UNUSED(child))
1846 chtml20 = GET_CHTML20(pdoc);
1852 return chtml20->out;
1857 * It is a handler who processes the LI tag.
1859 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1860 * destination is specified.
1861 * @param node [i] The LI tag node is specified.
1862 * @return The conversion result is returned.
1865 s_chtml20_start_li_tag(void *pdoc, Node *node)
1872 chtml20 = GET_CHTML20(pdoc);
1877 /*--------------------------------------------------------------------------*/
1878 /* Get Attributes */
1879 /*--------------------------------------------------------------------------*/
1880 for (attr = qs_get_attr(doc,node);
1882 attr = qs_get_next_attr(doc,attr)) {
1883 char *name = qs_get_attr_name(doc,attr);
1884 char *value = qs_get_attr_value(doc,attr);
1885 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
1890 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
1897 return chtml20->out;
1902 * It is a handler who processes the LI tag.
1904 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1905 * destination is specified.
1906 * @param node [i] The LI tag node is specified.
1907 * @return The conversion result is returned.
1910 s_chtml20_end_li_tag(void *pdoc, Node *UNUSED(child))
1912 chtml20_t *chtml20 = GET_CHTML20(pdoc);
1913 return chtml20->out;
1918 * It is a handler who processes the HR tag.
1920 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1921 * destination is specified.
1922 * @param node [i] The HR tag node is specified.
1923 * @return The conversion result is returned.
1926 s_chtml20_start_hr_tag(void *pdoc, Node *node)
1933 chtml20 = GET_CHTML20(pdoc);
1939 for (attr = qs_get_attr(doc,node);
1941 attr = qs_get_next_attr(doc,attr)) {
1942 char *name = qs_get_attr_name(doc,attr);
1943 char *value = qs_get_attr_value(doc,attr);
1947 if (strcasecmp(name, "align") == 0) {
1948 /*--------------------------------------------------------------------*/
1950 /*--------------------------------------------------------------------*/
1951 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1961 if (strcasecmp(name, "size") == 0) {
1962 /*--------------------------------------------------------------------*/
1964 /*--------------------------------------------------------------------*/
1965 if (value && value[0] != '\0') {
1975 if (strcasecmp(name, "width") == 0) {
1976 /*--------------------------------------------------------------------*/
1978 /*--------------------------------------------------------------------*/
1979 if (value && value[0] != '\0') {
1989 if (strcasecmp(name, "noshade") == 0) {
1990 /*--------------------------------------------------------------------*/
1992 /*--------------------------------------------------------------------*/
1999 if (strcasecmp(name, "color") == 0) {
2000 /*--------------------------------------------------------------------*/
2002 /*--------------------------------------------------------------------*/
2012 return chtml20->out;
2017 * It is a handler who processes the HR tag.
2019 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2020 * destination is specified.
2021 * @param node [i] The HR tag node is specified.
2022 * @return The conversion result is returned.
2025 s_chtml20_end_hr_tag(void *pdoc, Node *UNUSED(child))
2027 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2028 return chtml20->out;
2033 * It is a handler who processes the IMG tag.
2035 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2036 * destination is specified.
2037 * @param node [i] The IMG tag node is specified.
2038 * @return The conversion result is returned.
2041 s_chtml20_start_img_tag(void *pdoc, Node *node)
2047 #ifndef IMG_NOT_CONVERT_FILENAME
2051 chtml20 = GET_CHTML20(pdoc);
2055 #ifndef IMG_NOT_CONVERT_FILENAME
2056 spec = chtml20->spec;
2060 /*-------------------------------------------------------------------------*/
2061 /* Get Attributes */
2062 /*-------------------------------------------------------------------------*/
2063 for (attr = qs_get_attr(doc,node);
2065 attr = qs_get_next_attr(doc,attr)) {
2066 char *name = qs_get_attr_name(doc,attr);
2067 char *value = qs_get_attr_value(doc,attr);
2071 if (strcasecmp(name, "src") == 0) {
2072 /*-------------------------------------------------------------------*/
2074 /*-------------------------------------------------------------------*/
2075 #ifdef IMG_NOT_CONVERT_FILENAME
2076 value = chxj_encoding_parameter(r, value);
2077 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
2078 value = chxj_add_cookie_no_update_parameter(r, value);
2083 value = chxj_img_conv(r, spec, value);
2084 value = chxj_encoding_parameter(r, value);
2085 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
2086 value = chxj_add_cookie_no_update_parameter(r, value);
2096 if (strcasecmp(name, "align" ) == 0) {
2097 /*--------------------------------------------------------------------*/
2099 /*--------------------------------------------------------------------*/
2101 if (STRCASEEQ('t','T',"top", value) ||
2102 STRCASEEQ('m','M',"middle",value) ||
2103 STRCASEEQ('b','B',"bottom",value) ||
2104 STRCASEEQ('l','L',"left", value) ||
2105 STRCASEEQ('r','R',"right", value)) {
2110 else if (STRCASEEQ('c','C',"center", value)) {
2117 else if (strcasecmp(name, "alt" ) == 0 && value && *value) {
2118 /*--------------------------------------------------------------------*/
2120 /*--------------------------------------------------------------------*/
2129 if (strcasecmp(name, "width" ) == 0 && value && *value) {
2130 /*--------------------------------------------------------------------*/
2132 /*--------------------------------------------------------------------*/
2141 if (strcasecmp(name, "height") == 0 && value && *value) {
2142 /*--------------------------------------------------------------------*/
2144 /*--------------------------------------------------------------------*/
2149 else if (strcasecmp(name, "hspace") == 0 && value && *value) {
2150 /*--------------------------------------------------------------------*/
2152 /*--------------------------------------------------------------------*/
2161 if (strcasecmp(name, "vspace") == 0 && value && *value) {
2162 /*--------------------------------------------------------------------*/
2164 /*--------------------------------------------------------------------*/
2176 return chtml20->out;
2181 * It is a handler who processes the IMG tag.
2183 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2184 * destination is specified.
2185 * @param node [i] The IMG tag node is specified.
2186 * @return The conversion result is returned.
2189 s_chtml20_end_img_tag(void *pdoc, Node *UNUSED(child))
2191 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2193 return chtml20->out;
2198 * It is a handler who processes the SELECT tag.
2200 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2201 * destination is specified.
2202 * @param node [i] The SELECT tag node is specified.
2203 * @return The conversion result is returned.
2206 s_chtml20_start_select_tag(void *pdoc, Node *child)
2213 chtml20 = GET_CHTML20(pdoc);
2219 char *multiple = NULL;
2222 for (attr = qs_get_attr(doc,child);
2224 attr = qs_get_next_attr(doc,attr)) {
2225 char *nm = qs_get_attr_name(doc,attr);
2226 char *val = qs_get_attr_value(doc,attr);
2230 if (strcasecmp(nm, "size") == 0) {
2231 /*--------------------------------------------------------------------*/
2232 /* CHTML 1.0 version 2.0 */
2233 /*--------------------------------------------------------------------*/
2234 size = apr_pstrdup(doc->buf.pool, val);
2240 if (strcasecmp(nm, "name") == 0) {
2241 /*--------------------------------------------------------------------*/
2242 /* CHTML 1.0 version 2.0 */
2243 /*--------------------------------------------------------------------*/
2244 name = apr_pstrdup(doc->buf.pool, val);
2250 if (strcasecmp(nm, "multiple") == 0) {
2251 /*--------------------------------------------------------------------*/
2252 /* CHTML 1.0 version 2.0 */
2253 /*--------------------------------------------------------------------*/
2254 multiple = apr_pstrdup(doc->buf.pool, val);
2262 if (size && *size) {
2267 if (name && *name) {
2276 return chtml20->out;
2281 * It is a handler who processes the SELECT tag.
2283 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2284 * destination is specified.
2285 * @param node [i] The SELECT tag node is specified.
2286 * @return The conversion result is returned.
2289 s_chtml20_end_select_tag(void *pdoc, Node *UNUSED(child))
2294 chtml20 = GET_CHTML20(pdoc);
2298 return chtml20->out;
2303 * It is a handler who processes the OPTION tag.
2305 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2306 * destination is specified.
2307 * @param node [i] The OPTION tag node is specified.
2308 * @return The conversion result is returned.
2311 s_chtml20_start_option_tag(void *pdoc, Node *child)
2318 chtml20 = GET_CHTML20(pdoc);
2322 char *selected = NULL;
2326 for (attr = qs_get_attr(doc,child);
2328 attr = qs_get_next_attr(doc,attr)) {
2329 char *nm = qs_get_attr_name(doc,attr);
2330 char *val = qs_get_attr_value(doc,attr);
2334 if (strcasecmp(nm, "selected") == 0) {
2335 /*--------------------------------------------------------------------*/
2336 /* CHTML 1.0 version 2.0 */
2337 /*--------------------------------------------------------------------*/
2338 selected = apr_pstrdup(doc->buf.pool, val);
2344 if (strcasecmp(nm, "value") == 0) {
2345 /*--------------------------------------------------------------------*/
2346 /* CHTML 1.0 version 2.0 */
2347 /*--------------------------------------------------------------------*/
2348 value = apr_pstrdup(doc->buf.pool, val);
2357 if (value && *value) {
2367 return chtml20->out;
2372 * It is a handler who processes the OPTION tag.
2374 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2375 * destination is specified.
2376 * @param node [i] The OPTION tag node is specified.
2377 * @return The conversion result is returned.
2380 s_chtml20_end_option_tag(void *pdoc, Node *UNUSED(child))
2382 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2386 return chtml20->out;
2391 * It is a handler who processes the DIV tag.
2393 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2394 * destination is specified.
2395 * @param node [i] The DIV tag node is specified.
2396 * @return The conversion result is returned.
2399 s_chtml20_start_div_tag(void *pdoc, Node *child)
2406 chtml20 = GET_CHTML20(pdoc);
2414 for (attr = qs_get_attr(doc,child);
2416 attr = qs_get_next_attr(doc,attr)) {
2417 char *nm = qs_get_attr_name(doc,attr);
2418 char *val = qs_get_attr_value(doc,attr);
2419 if (STRCASEEQ('a','A', "align", nm)) {
2420 /*----------------------------------------------------------------------*/
2421 /* CHTML 1.0 (W3C version 3.2) */
2422 /*----------------------------------------------------------------------*/
2423 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2424 align = apr_pstrdup(doc->buf.pool, val);
2434 return chtml20->out;
2439 * It is a handler who processes the DIV tag.
2441 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2442 * destination is specified.
2443 * @param node [i] The DIV tag node is specified.
2444 * @return The conversion result is returned.
2447 s_chtml20_end_div_tag(void *pdoc, Node *UNUSED(child))
2449 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2450 Doc *doc = chtml20->doc;
2453 return chtml20->out;
2458 * It is a handler who processes the H1 tag.
2460 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2461 * destination is specified.
2462 * @param node [i] The H1 tag node is specified.
2463 * @return The conversion result is returned.
2466 s_chtml20_start_h1_tag(void *pdoc, Node *node)
2473 chtml20 = GET_CHTML20(pdoc);
2478 for (attr = qs_get_attr(doc,node);
2480 attr = qs_get_next_attr(doc,attr)) {
2481 char *name = qs_get_attr_name(doc,attr);
2482 char *value = qs_get_attr_value(doc,attr);
2483 if (STRCASEEQ('a','A',"align", name)) {
2484 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2493 return chtml20->out;
2498 * It is a handler who processes the H1 tag.
2500 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2501 * destination is specified.
2502 * @param node [i] The H1 tag node is specified.
2503 * @return The conversion result is returned.
2506 s_chtml20_end_h1_tag(void *pdoc, Node *UNUSED(child))
2511 chtml20 = GET_CHTML20(pdoc);
2515 return chtml20->out;
2520 * It is a handler who processes the H2 tag.
2522 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2523 * destination is specified.
2524 * @param node [i] The H2 tag node is specified.
2525 * @return The conversion result is returned.
2528 s_chtml20_start_h2_tag(void *pdoc, Node *node)
2535 chtml20 = GET_CHTML20(pdoc);
2540 for (attr = qs_get_attr(doc,node);
2542 attr = qs_get_next_attr(doc,attr)) {
2543 char *name = qs_get_attr_name(doc,attr);
2544 char *value = qs_get_attr_value(doc,attr);
2545 if (STRCASEEQ('a','A',"align", name)) {
2546 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2555 return chtml20->out;
2560 * It is a handler who processes the H2 tag.
2562 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2563 * destination is specified.
2564 * @param node [i] The H2 tag node is specified.
2565 * @return The conversion result is returned.
2568 s_chtml20_end_h2_tag(void *pdoc, Node *UNUSED(child))
2570 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2571 Doc *doc = chtml20->doc;
2575 return chtml20->out;
2580 * It is a handler who processes the H3 tag.
2582 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2583 * destination is specified.
2584 * @param node [i] The H3 tag node is specified.
2585 * @return The conversion result is returned.
2588 s_chtml20_start_h3_tag(void *pdoc, Node *node)
2595 chtml20 = GET_CHTML20(pdoc);
2600 for (attr = qs_get_attr(doc,node);
2602 attr = qs_get_next_attr(doc,attr)) {
2603 char *name = qs_get_attr_name(doc,attr);
2604 char *value = qs_get_attr_value(doc,attr);
2605 if (STRCASEEQ('a','A',"align", name)) {
2606 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2615 return chtml20->out;
2620 * It is a handler who processes the H3 tag.
2622 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2623 * destination is specified.
2624 * @param node [i] The H3 tag node is specified.
2625 * @return The conversion result is returned.
2628 s_chtml20_end_h3_tag(void *pdoc, Node *UNUSED(child))
2630 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2631 Doc *doc = chtml20->doc;
2634 return chtml20->out;
2639 * It is a handler who processes the H4 tag.
2641 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2642 * destination is specified.
2643 * @param node [i] The H4 tag node is specified.
2644 * @return The conversion result is returned.
2647 s_chtml20_start_h4_tag(void *pdoc, Node *node)
2654 chtml20 = GET_CHTML20(pdoc);
2659 for (attr = qs_get_attr(doc,node);
2661 attr = qs_get_next_attr(doc,attr)) {
2662 char *name = qs_get_attr_name(doc,attr);
2663 char *value = qs_get_attr_value(doc,attr);
2664 if (STRCASEEQ('a','A',"align", name)) {
2665 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2674 return chtml20->out;
2679 * It is a handler who processes the H4 tag.
2681 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2682 * destination is specified.
2683 * @param node [i] The H4 tag node is specified.
2684 * @return The conversion result is returned.
2687 s_chtml20_end_h4_tag(void *pdoc, Node *UNUSED(child))
2689 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2690 Doc *doc = chtml20->doc;
2693 return chtml20->out;
2698 * It is a handler who processes the H5 tag.
2700 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2701 * destination is specified.
2702 * @param node [i] The H5 tag node is specified.
2703 * @return The conversion result is returned.
2706 s_chtml20_start_h5_tag(void *pdoc, Node *node)
2713 chtml20 = GET_CHTML20(pdoc);
2718 for (attr = qs_get_attr(doc,node);
2720 attr = qs_get_next_attr(doc,attr)) {
2721 char *name = qs_get_attr_name(doc,attr);
2722 char *value = qs_get_attr_value(doc,attr);
2723 if (STRCASEEQ('a','A',"align", name)) {
2724 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2733 return chtml20->out;
2738 * It is a handler who processes the H5 tag.
2740 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2741 * destination is specified.
2742 * @param node [i] The H5 tag node is specified.
2743 * @return The conversion result is returned.
2746 s_chtml20_end_h5_tag(void *pdoc, Node *UNUSED(child))
2748 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2749 Doc *doc = chtml20->doc;
2752 return chtml20->out;
2757 * It is a handler who processes the H6 tag.
2759 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2760 * destination is specified.
2761 * @param node [i] The H6 tag node is specified.
2762 * @return The conversion result is returned.
2765 s_chtml20_start_h6_tag(void *pdoc, Node *node)
2772 chtml20 = GET_CHTML20(pdoc);
2777 for (attr = qs_get_attr(doc,node);
2779 attr = qs_get_next_attr(doc,attr)) {
2780 char *name = qs_get_attr_name(doc,attr);
2781 char *value = qs_get_attr_value(doc,attr);
2782 if (STRCASEEQ('a','A',"align", name)) {
2783 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2792 return chtml20->out;
2797 * It is a handler who processes the H6 tag.
2799 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2800 * destination is specified.
2801 * @param node [i] The H6 tag node is specified.
2802 * @return The conversion result is returned.
2805 s_chtml20_end_h6_tag(void *pdoc, Node *UNUSED(child))
2807 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2808 Doc *doc = chtml20->doc;
2811 return chtml20->out;
2816 * It is a handler who processes the PRE tag.
2818 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2819 * destination is specified.
2820 * @param node [i] The PRE tag node is specified.
2821 * @return The conversion result is returned.
2824 s_chtml20_start_pre_tag(void *pdoc, Node *UNUSED(node))
2826 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2827 Doc *doc = chtml20->doc;
2829 chtml20->pre_flag++;
2831 return chtml20->out;
2836 * It is a handler who processes the PRE tag.
2838 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2839 * destination is specified.
2840 * @param node [i] The PRE tag node is specified.
2841 * @return The conversion result is returned.
2844 s_chtml20_end_pre_tag(void *pdoc, Node *UNUSED(child))
2846 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2847 Doc *doc = chtml20->doc;
2850 chtml20->pre_flag--;
2852 return chtml20->out;
2857 * It is a handler who processes the P tag.
2859 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2860 * destination is specified.
2861 * @param node [i] The P tag node is specified.
2862 * @return The conversion result is returned.
2865 s_chtml20_start_p_tag(void *pdoc, Node *node)
2873 chtml20 = GET_CHTML20(pdoc);
2878 for (attr = qs_get_attr(doc,node);
2880 attr = qs_get_next_attr(doc,attr)) {
2881 char *nm = qs_get_attr_name(doc,attr);
2882 char *val = qs_get_attr_value(doc,attr);
2883 if (STRCASEEQ('a','A',"align", nm)) {
2884 /*----------------------------------------------------------------------*/
2885 /* CHTML 1.0 (W3C version 3.2) */
2886 /*----------------------------------------------------------------------*/
2887 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2888 align = apr_pstrdup(doc->buf.pool, val);
2899 return chtml20->out;
2904 * It is a handler who processes the P tag.
2906 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2907 * destination is specified.
2908 * @param node [i] The P tag node is specified.
2909 * @return The conversion result is returned.
2912 s_chtml20_end_p_tag(void *pdoc, Node *UNUSED(child))
2918 chtml20 = GET_CHTML20(pdoc);
2923 return chtml20->out;
2928 s_chtml20_chxjif_tag(void *pdoc, Node *node)
2935 chtml20 = GET_CHTML20(pdoc);
2939 for (child = qs_get_child_node(doc, node);
2941 child = qs_get_next_node(doc, child)) {
2944 s_chtml20_chxjif_tag(pdoc, child);
2952 * It is a handler who processes the TEXTARE tag.
2954 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2955 * destination is specified.
2956 * @param node [i] The TEXTAREA tag node is specified.
2957 * @return The conversion result is returned.
2960 s_chtml20_start_textarea_tag(void *pdoc, Node *node)
2967 chtml20 = GET_CHTML20(pdoc);
2971 chtml20->textarea_flag++;
2973 for (attr = qs_get_attr(doc,node);
2975 attr = qs_get_next_attr(doc,attr)) {
2976 char *name = qs_get_attr_name(doc,attr);
2977 char *value = qs_get_attr_value(doc,attr);
2981 if (strcasecmp(name, "accesskey") == 0 && value && *value != 0) {
2982 W_L(" accesskey=\"");
2990 if (strcasecmp(name, "name") == 0 && value && *value != 0) {
2999 if (strcasecmp(name, "rows") == 0 && value && *value != 0) {
3008 if (strcasecmp(name, "cols") == 0 && value && *value != 0) {
3017 if (strcasecmp(name, "istyle") == 0 && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
3029 return chtml20->out;
3034 * It is a handler who processes the TEXTAREA tag.
3036 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3037 * destination is specified.
3038 * @param node [i] The TEXTAREA tag node is specified.
3039 * @return The conversion result is returned.
3042 s_chtml20_end_textarea_tag(void *pdoc, Node *UNUSED(child))
3044 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3045 Doc *doc = chtml20->doc;
3048 chtml20->textarea_flag--;
3050 return chtml20->out;
3055 s_chtml20_text_tag(void *pdoc, Node *child)
3067 chtml20 = GET_CHTML20(pdoc);
3071 textval = qs_get_node_value(doc,child);
3072 if (strlen(textval) == 0) {
3073 return chtml20->out;
3076 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
3077 memset(tmp, 0, qs_get_node_size(doc,child)+1);
3079 tdst = qs_alloc_zero_byte_string(doc->buf.pool);
3080 memset(one_byte, 0, sizeof(one_byte));
3083 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
3085 int rtn = s_chtml20_search_emoji(chtml20, &textval[ii], &out);
3087 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
3091 if (is_sjis_kanji(textval[ii])) {
3092 one_byte[0] = textval[ii+0];
3093 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3094 one_byte[0] = textval[ii+1];
3095 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3099 if (chtml20->pre_flag) {
3100 one_byte[0] = textval[ii+0];
3101 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3104 if (chtml20->textarea_flag) {
3105 one_byte[0] = textval[ii+0];
3106 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3109 if (textval[ii] != '\r' && textval[ii] != '\n') {
3110 one_byte[0] = textval[ii+0];
3111 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3115 return chtml20->out;
3120 * It is a handler who processes the BLOCKQUOTE tag.
3122 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3123 * destination is specified.
3124 * @param node [i] The BLOCKQUOTE tag node is specified.
3125 * @return The conversion result is returned.
3128 s_chtml20_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
3130 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3131 Doc *doc = chtml20->doc;
3132 W_L("<blockquote>");
3133 return chtml20->out;
3138 * It is a handler who processes the BLOCKQUOTE tag.
3140 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3141 * destination is specified.
3142 * @param node [i] The BLOCKQUOTE tag node is specified.
3143 * @return The conversion result is returned.
3146 s_chtml20_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
3148 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3149 Doc *doc = chtml20->doc;
3150 W_L("</blockquote>");
3151 return chtml20->out;
3156 * It is a handler who processes the DIR tag.
3158 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3159 * destination is specified.
3160 * @param node [i] The DIR tag node is specified.
3161 * @return The conversion result is returned.
3164 s_chtml20_start_dir_tag(void *pdoc, Node *UNUSED(child))
3166 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3167 Doc *doc = chtml20->doc;
3169 return chtml20->out;
3174 * It is a handler who processes the DIR tag.
3176 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3177 * destination is specified.
3178 * @param node [i] The DIR tag node is specified.
3179 * @return The conversion result is returned.
3182 s_chtml20_end_dir_tag(void *pdoc, Node *UNUSED(child))
3184 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3185 Doc *doc = chtml20->doc;
3188 return chtml20->out;
3193 * It is a handler who processes the DL tag.
3195 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3196 * destination is specified.
3197 * @param node [i] The DL tag node is specified.
3198 * @return The conversion result is returned.
3201 s_chtml20_start_dl_tag(void *pdoc, Node *UNUSED(child))
3203 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3204 Doc *doc = chtml20->doc;
3206 return chtml20->out;
3211 * It is a handler who processes the DL tag.
3213 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3214 * destination is specified.
3215 * @param node [i] The DL tag node is specified.
3216 * @return The conversion result is returned.
3219 s_chtml20_end_dl_tag(void *pdoc, Node *UNUSED(child))
3221 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3222 Doc *doc = chtml20->doc;
3224 return chtml20->out;
3229 * It is a handter who processes the DT tag.
3231 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3232 * destination is specified.
3233 * @param node [i] The DT tag node is specified.
3234 * @return The conversion result is returned.
3237 s_chtml20_start_dt_tag(void *pdoc, Node *UNUSED(child))
3239 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3240 Doc *doc = chtml20->doc;
3242 return chtml20->out;
3247 * It is a handter who processes the DT tag.
3249 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3250 * destination is specified.
3251 * @param node [i] The DT tag node is specified.
3252 * @return The conversion result is returned.
3255 s_chtml20_end_dt_tag(void *pdoc, Node *UNUSED(child))
3257 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3259 return chtml20->out;
3264 * It is a handder who processes the DD tag.
3266 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3267 * destination is specified.
3268 * @param node [i] The DD tag node is specified.
3269 * @return The conversion result is returned.
3272 s_chtml20_start_dd_tag(void *pdoc, Node *UNUSED(child))
3274 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3275 Doc *doc = chtml20->doc;
3277 return chtml20->out;
3282 * It is a handder who processes the DD tag.
3284 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3285 * destination is specified.
3286 * @param node [i] The DD tag node is specified.
3287 * @return The conversion result is returned.
3290 s_chtml20_end_dd_tag(void *pdoc, Node *UNUSED(child))
3292 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3294 return chtml20->out;
3299 * It is a hanmenuer who processes the MENU tag.
3301 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3302 * destination is specified.
3303 * @param node [i] The MENU tag node is specified.
3304 * @return The conversion result is returned.
3307 s_chtml20_start_menu_tag(void *pdoc, Node *UNUSED(child))
3309 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3310 Doc *doc = chtml20->doc;
3313 return chtml20->out;
3318 * It is a hanmenuer who processes the MENU tag.
3320 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3321 * destination is specified.
3322 * @param node [i] The MENU tag node is specified.
3323 * @return The conversion result is returned.
3326 s_chtml20_end_menu_tag(void *pdoc, Node *UNUSED(child))
3328 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3329 Doc *doc = chtml20->doc;
3332 return chtml20->out;
3337 * It is a hanplaintexter who processes the PLAINTEXT tag.
3339 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3340 * destination is specified.
3341 * @param node [i] The PLAINTEXT tag node is specified.
3342 * @return The conversion result is returned.
3345 s_chtml20_start_plaintext_tag(void *pdoc, Node *node)
3347 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3348 Doc *doc = chtml20->doc;
3351 s_chtml20_start_plaintext_tag_inner(pdoc,node);
3352 return chtml20->out;
3356 s_chtml20_start_plaintext_tag_inner(void *pdoc, Node *node)
3358 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3359 Doc *doc = chtml20->doc;
3362 for (child = qs_get_child_node(doc, node);
3364 child = qs_get_next_node(doc, child)) {
3366 s_chtml20_start_plaintext_tag_inner(pdoc, child);
3368 return chtml20->out;
3373 * It is a hanplaintexter who processes the PLAINTEXT tag.
3375 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3376 * destination is specified.
3377 * @param node [i] The PLAINTEXT tag node is specified.
3378 * @return The conversion result is returned.
3381 s_chtml20_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3383 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3384 return chtml20->out;
3388 * It is a hanblinker who processes the BLINK tag.
3390 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3391 * destination is specified.
3392 * @param node [i] The BLINK tag node is specified.
3393 * @return The conversion result is returned.
3396 s_chtml20_start_blink_tag(void *pdoc, Node *UNUSED(child))
3398 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3399 Doc *doc = chtml20->doc;
3401 return chtml20->out;
3406 * It is a hanblinker who processes the BLINK tag.
3408 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3409 * destination is specified.
3410 * @param node [i] The BLINK tag node is specified.
3411 * @return The conversion result is returned.
3414 s_chtml20_end_blink_tag(void *pdoc, Node *UNUSED(child))
3416 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3417 Doc *doc = chtml20->doc;
3419 return chtml20->out;
3424 * It is a hanmarqueeer who processes the MARQUEE tag.
3426 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3427 * destination is specified.
3428 * @param node [i] The MARQUEE tag node is specified.
3429 * @return The conversion result is returned.
3432 s_chtml20_start_marquee_tag(void *pdoc, Node *node)
3434 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3435 Doc *doc = chtml20->doc;
3438 /*--------------------------------------------------------------------------*/
3439 /* Get Attributes */
3440 /*--------------------------------------------------------------------------*/
3441 for (attr = qs_get_attr(doc,node);
3443 attr = qs_get_next_attr(doc,attr)) {
3444 char *name = qs_get_attr_name(doc,attr);
3445 char *value = qs_get_attr_value(doc,attr);
3446 if (STRCASEEQ('d','D',"direction", name)) {
3447 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3448 W_L(" direction=\"");
3453 else if (STRCASEEQ('b','B',"behavior",name)) {
3454 if (value && (STRCASEEQ('s','S',"scroll",value) || STRCASEEQ('s','S',"slide",value) || STRCASEEQ('a','A',"alternate",value))) {
3455 W_L(" behavior=\"");
3460 else if (STRCASEEQ('l','L',"loop",name)) {
3461 if (value && *value) {
3469 return chtml20->out;
3474 * It is a hanmarqueeer who processes the MARQUEE tag.
3476 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3477 * destination is specified.
3478 * @param node [i] The MARQUEE tag node is specified.
3479 * @return The conversion result is returned.
3482 s_chtml20_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3484 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3485 Doc *doc = chtml20->doc;
3487 return chtml20->out;
3492 * * It is handler who processes the New Line Code.
3495 s_chtml20_newline_mark(void *pdoc, Node *UNUSED(node))
3497 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3498 Doc *doc = chtml20->doc;
3500 return chtml20->out;