2 * Copyright (C) 2005-2008 Atsushi Konno All rights reserved.
3 * Copyright (C) 2005 QSDN,Inc. All rights reserved.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 #include "chxj_chtml40.h"
19 #include "chxj_hdml.h"
20 #include "chxj_str_util.h"
21 #include "chxj_dump.h"
22 #include "chxj_img_conv.h"
23 #include "chxj_qr_code.h"
24 #include "chxj_encoding.h"
26 #define GET_CHTML40(X) ((chtml40_t *)(X))
29 #define W_L(X) do { chtml40->out = BUFFERED_WRITE_LITERAL(chtml40->out, &doc->buf, (X)); } while(0)
30 #define W_V(X) do { chtml40->out = (X) ? BUFFERED_WRITE_VALUE(chtml40->out, &doc->buf, (X)) \
31 : BUFFERED_WRITE_LITERAL(chtml40->out, &doc->buf, ""); } while(0)
33 #define W_NLCODE() do { char *nlcode = TO_NLCODE(chtml40->conf); W_V(nlcode); } while (0)
35 static char *s_chtml40_start_html_tag (void *pdoc, Node *node);
36 static char *s_chtml40_end_html_tag (void *pdoc, Node *node);
37 static char *s_chtml40_start_meta_tag (void *pdoc, Node *node);
38 static char *s_chtml40_end_meta_tag (void *pdoc, Node *node);
39 static char *s_chtml40_start_textarea_tag (void *pdoc, Node *node);
40 static char *s_chtml40_end_textarea_tag (void *pdoc, Node *node);
41 static char *s_chtml40_start_p_tag (void *pdoc, Node *node);
42 static char *s_chtml40_end_p_tag (void *pdoc, Node *node);
43 static char *s_chtml40_start_pre_tag (void *pdoc, Node *node);
44 static char *s_chtml40_end_pre_tag (void *pdoc, Node *node);
45 static char *s_chtml40_start_h1_tag (void *pdoc, Node *node);
46 static char *s_chtml40_end_h1_tag (void *pdoc, Node *node);
47 static char *s_chtml40_start_h2_tag (void *pdoc, Node *node);
48 static char *s_chtml40_end_h2_tag (void *pdoc, Node *node);
49 static char *s_chtml40_start_h3_tag (void *pdoc, Node *node);
50 static char *s_chtml40_end_h3_tag (void *pdoc, Node *node);
51 static char *s_chtml40_start_h4_tag (void *pdoc, Node *node);
52 static char *s_chtml40_end_h4_tag (void *pdoc, Node *node);
53 static char *s_chtml40_start_h5_tag (void *pdoc, Node *node);
54 static char *s_chtml40_end_h5_tag (void *pdoc, Node *node);
55 static char *s_chtml40_start_h6_tag (void *pdoc, Node *node);
56 static char *s_chtml40_end_h6_tag (void *pdoc, Node *node);
57 static char *s_chtml40_start_ul_tag (void *pdoc, Node *node);
58 static char *s_chtml40_end_ul_tag (void *pdoc, Node *node);
59 static char *s_chtml40_start_ol_tag (void *pdoc, Node *node);
60 static char *s_chtml40_end_ol_tag (void *pdoc, Node *node);
61 static char *s_chtml40_start_li_tag (void *pdoc, Node *node);
62 static char *s_chtml40_end_li_tag (void *pdoc, Node *node);
63 static char *s_chtml40_start_head_tag (void *pdoc, Node *node);
64 static char *s_chtml40_end_head_tag (void *pdoc, Node *node);
65 static char *s_chtml40_start_title_tag (void *pdoc, Node *node);
66 static char *s_chtml40_end_title_tag (void *pdoc, Node *node);
67 static char *s_chtml40_start_base_tag (void *pdoc, Node *node);
68 static char *s_chtml40_end_base_tag (void *pdoc, Node *node);
69 static char *s_chtml40_start_body_tag (void *pdoc, Node *node);
70 static char *s_chtml40_end_body_tag (void *pdoc, Node *node);
71 static char *s_chtml40_start_a_tag (void *pdoc, Node *node);
72 static char *s_chtml40_end_a_tag (void *pdoc, Node *node);
73 static char *s_chtml40_start_br_tag (void *pdoc, Node *node);
74 static char *s_chtml40_end_br_tag (void *pdoc, Node *node);
75 static char *s_chtml40_start_tr_tag (void *pdoc, Node *node);
76 static char *s_chtml40_end_tr_tag (void *pdoc, Node *node);
77 static char *s_chtml40_start_font_tag (void *pdoc, Node *node);
78 static char *s_chtml40_end_font_tag (void *pdoc, Node *node);
79 static char *s_chtml40_start_form_tag (void *pdoc, Node *node);
80 static char *s_chtml40_end_form_tag (void *pdoc, Node *node);
81 static char *s_chtml40_start_input_tag (void *pdoc, Node *node);
82 static char *s_chtml40_end_input_tag (void *pdoc, Node *node);
83 static char *s_chtml40_start_center_tag (void *pdoc, Node *node);
84 static char *s_chtml40_end_center_tag (void *pdoc, Node *node);
85 static char *s_chtml40_start_hr_tag (void *pdoc, Node *node);
86 static char *s_chtml40_end_hr_tag (void *pdoc, Node *node);
87 static char *s_chtml40_start_img_tag (void *pdoc, Node *node);
88 static char *s_chtml40_end_img_tag (void *pdoc, Node *node);
89 static char *s_chtml40_start_select_tag (void *pdoc, Node *node);
90 static char *s_chtml40_end_select_tag (void *pdoc, Node *node);
91 static char *s_chtml40_start_option_tag (void *pdoc, Node *node);
92 static char *s_chtml40_end_option_tag (void *pdoc, Node *node);
93 static char *s_chtml40_start_div_tag (void *pdoc, Node *node);
94 static char *s_chtml40_end_div_tag (void *pdoc, Node *node);
95 static char *s_chtml40_chxjif_tag (void *pdoc, Node *node);
96 static char *s_chtml40_text_tag (void *pdoc, Node *node);
97 static char *s_chtml40_start_blockquote_tag(void *pdoc, Node *node);
98 static char *s_chtml40_end_blockquote_tag (void *pdoc, Node *node);
99 static char *s_chtml40_start_dir_tag (void *pdoc, Node *node);
100 static char *s_chtml40_end_dir_tag (void *pdoc, Node *node);
101 static char *s_chtml40_start_dl_tag (void *pdoc, Node *node);
102 static char *s_chtml40_end_dl_tag (void *pdoc, Node *node);
103 static char *s_chtml40_start_dt_tag (void *pdoc, Node *node);
104 static char *s_chtml40_end_dt_tag (void *pdoc, Node *node);
105 static char *s_chtml40_start_dd_tag (void *pdoc, Node *node);
106 static char *s_chtml40_end_dd_tag (void *pdoc, Node *node);
107 static char *s_chtml40_start_marquee_tag (void *pdoc, Node *node);
108 static char *s_chtml40_end_marquee_tag (void *pdoc, Node *node);
109 static char *s_chtml40_start_blink_tag (void *pdoc, Node *node);
110 static char *s_chtml40_end_blink_tag (void *pdoc, Node *node);
111 static char *s_chtml40_start_menu_tag (void *pdoc, Node *node);
112 static char *s_chtml40_end_menu_tag (void *pdoc, Node *node);
113 static char *s_chtml40_start_plaintext_tag (void *pdoc, Node *node);
114 static char *s_chtml40_start_plaintext_tag_inner (void *pdoc, Node *node);
115 static char *s_chtml40_end_plaintext_tag (void *pdoc, Node *node);
116 static char *s_chtml40_newline_mark (void *pdoc, Node *node);
118 static void s_init_chtml40(chtml40_t *chtml, Doc *doc, request_rec *r, device_table *spec);
120 static int s_chtml40_search_emoji(chtml40_t *chtml, char *txt, char **rslt);
123 tag_handler chtml40_handler[] = {
126 s_chtml40_start_html_tag,
127 s_chtml40_end_html_tag,
131 s_chtml40_start_meta_tag,
132 s_chtml40_end_meta_tag,
136 s_chtml40_start_textarea_tag,
137 s_chtml40_end_textarea_tag,
141 s_chtml40_start_p_tag,
146 s_chtml40_start_pre_tag,
147 s_chtml40_end_pre_tag,
151 s_chtml40_start_ul_tag,
152 s_chtml40_end_ul_tag,
156 s_chtml40_start_li_tag,
157 s_chtml40_end_li_tag,
161 s_chtml40_start_ol_tag,
162 s_chtml40_end_ol_tag,
166 s_chtml40_start_h1_tag,
167 s_chtml40_end_h1_tag,
171 s_chtml40_start_h2_tag,
172 s_chtml40_end_h2_tag,
176 s_chtml40_start_h3_tag,
177 s_chtml40_end_h3_tag,
181 s_chtml40_start_h4_tag,
182 s_chtml40_end_h4_tag,
186 s_chtml40_start_h5_tag,
187 s_chtml40_end_h5_tag,
191 s_chtml40_start_h6_tag,
192 s_chtml40_end_h6_tag,
196 s_chtml40_start_head_tag,
197 s_chtml40_end_head_tag,
201 s_chtml40_start_title_tag,
202 s_chtml40_end_title_tag,
206 s_chtml40_start_base_tag,
207 s_chtml40_end_base_tag,
211 s_chtml40_start_body_tag,
212 s_chtml40_end_body_tag,
216 s_chtml40_start_a_tag,
221 s_chtml40_start_br_tag,
222 s_chtml40_end_br_tag,
231 s_chtml40_start_tr_tag,
232 s_chtml40_end_tr_tag,
246 s_chtml40_start_font_tag,
247 s_chtml40_end_font_tag,
251 s_chtml40_start_form_tag,
252 s_chtml40_end_form_tag,
256 s_chtml40_start_input_tag,
257 s_chtml40_end_input_tag,
261 s_chtml40_start_center_tag,
262 s_chtml40_end_center_tag,
266 s_chtml40_start_hr_tag,
267 s_chtml40_end_hr_tag,
271 s_chtml40_start_img_tag,
272 s_chtml40_end_img_tag,
276 s_chtml40_start_select_tag,
277 s_chtml40_end_select_tag,
281 s_chtml40_start_option_tag,
282 s_chtml40_end_option_tag,
286 s_chtml40_start_div_tag,
287 s_chtml40_end_div_tag,
291 s_chtml40_chxjif_tag,
336 s_chtml40_start_dt_tag,
337 s_chtml40_end_dt_tag,
351 s_chtml40_start_blockquote_tag,
352 s_chtml40_end_blockquote_tag,
356 s_chtml40_start_dir_tag,
357 s_chtml40_end_dir_tag,
361 s_chtml40_start_dl_tag,
362 s_chtml40_end_dl_tag,
366 s_chtml40_start_dd_tag,
367 s_chtml40_end_dd_tag,
371 s_chtml40_start_menu_tag,
372 s_chtml40_end_menu_tag,
376 s_chtml40_start_plaintext_tag,
377 s_chtml40_end_plaintext_tag,
381 s_chtml40_start_blink_tag,
382 s_chtml40_end_blink_tag,
386 s_chtml40_start_marquee_tag,
387 s_chtml40_end_marquee_tag,
391 s_chtml40_newline_mark,
398 * converts from CHTML5.0 to CHTML3.0.
400 * @param r [i] Requet_rec is appointed.
401 * @param spec [i] The result of the device specification processing which
402 * was done in advance is appointed.
403 * @param src [i] The character string before the converting is appointed.
404 * @return The character string after the converting is returned.
407 chxj_convert_chtml40(
413 chxjconvrule_entry *entryp,
422 DBG(r, "start chxj_convert_chtml40()");
424 /*--------------------------------------------------------------------------*/
426 /*--------------------------------------------------------------------------*/
428 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
430 DBG(r,"i found qrcode xml");
431 DBG(r, "end chxj_convert_chtml40()");
434 DBG(r,"not found qrcode xml");
436 /*--------------------------------------------------------------------------*/
437 /* The CHTML structure is initialized. */
438 /*--------------------------------------------------------------------------*/
439 s_init_chtml40(&chtml40, &doc, r, spec);
441 chtml40.entryp = entryp;
442 chtml40.cookie = cookie;
444 chxj_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 -> CHTML4.0", ss, srclen);
459 chxj_buffered_write_init(r->pool, &doc.buf);
461 qs_parse_string(&doc,ss, strlen(ss));
463 /*--------------------------------------------------------------------------*/
464 /* It converts it from CHTML to CHTML. */
465 /*--------------------------------------------------------------------------*/
466 chxj_node_convert(spec,r,(void*)&chtml40, &doc, qs_get_root(&doc), 0);
467 chtml40.out = chxj_buffered_write_flush(chtml40.out, &doc.buf);
468 dst = apr_pstrdup(r->pool, chtml40.out);
469 chxj_buffered_write_terminate(&doc.buf);
471 qs_all_free(&doc,QX_LOGMARK);
474 dst = apr_pstrdup(r->pool,ss);
476 if (strlen(dst) == 0) {
477 dst = apr_psprintf(r->pool, "\n");
480 *dstlen = strlen(dst);
483 chxj_dump_out("[src] CHTML -> CHTML4.0", dst, *dstlen);
486 DBG(r, "end chxj_convert_chtml40()");
492 * The CHTML structure is initialized.
494 * @param chtml40 [i/o] The pointer to the HDML structure that wants to be
495 * initialized is specified.
496 * @param doc [i] The Doc structure that should be set to the initialized
497 * HDML structure is specified.
498 * @param r [i] To use POOL, the pointer to request_rec is specified.
499 * @param spec [i] The pointer to the device_table
502 s_init_chtml40(chtml40_t *chtml40, Doc *doc, request_rec *r, device_table *spec)
504 memset(doc, 0, sizeof(Doc));
505 memset(chtml40, 0, sizeof(chtml40_t));
509 chtml40->spec = spec;
510 chtml40->out = qs_alloc_zero_byte_string(r->pool);
511 chtml40->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
512 chtml40->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 chtml40 [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_chtml40_search_emoji(chtml40_t *chtml40, char *txt, char **rslt)
535 spec = chtml40->spec;
541 DBG(r,"spec is NULL");
544 for (ee = chtml40->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) {
556 if (spec == NULL || spec->emoji_type == NULL) {
557 *rslt = apr_palloc(r->pool, 3);
558 (*rslt)[0] = ee->imode->hex1byte & 0xff;
559 (*rslt)[1] = ee->imode->hex2byte & 0xff;
561 return strlen(ee->imode->string);
573 * It is a handler who processes the HTML tag.
575 * @param pdoc [i/o] The pointer to the CHTML structure at the output
576 * destination is specified.
577 * @param node [i] The HTML tag node is specified.
578 * @return The conversion result is returned.
581 s_chtml40_start_html_tag(void *pdoc, Node *UNUSED(node))
583 chtml40_t *chtml40 = GET_CHTML40(pdoc);
584 Doc *doc = chtml40->doc;
586 /*--------------------------------------------------------------------------*/
588 /*--------------------------------------------------------------------------*/
596 * It is a handler who processes the HTML tag.
598 * @param pdoc [i/o] The pointer to the CHTML structure at the output
599 * destination is specified.
600 * @param node [i] The HTML tag node is specified.
601 * @return The conversion result is returned.
604 s_chtml40_end_html_tag(void *pdoc, Node *UNUSED(child))
606 chtml40_t *chtml40 = GET_CHTML40(pdoc);
607 Doc *doc = chtml40->doc;
615 * It is a handler who processes the META tag.
617 * @param pdoc [i/o] The pointer to the CHTML structure at the output
618 * destination is specified.
619 * @param node [i] The META tag node is specified.
620 * @return The conversion result is returned.
623 s_chtml40_start_meta_tag(void *pdoc, Node *node)
629 int content_type_flag;
632 chtml40 = GET_CHTML40(pdoc);
636 content_type_flag = 0;
640 /*--------------------------------------------------------------------------*/
642 /*--------------------------------------------------------------------------*/
643 for (attr = qs_get_attr(doc,node);
645 attr = qs_get_next_attr(doc,attr)) {
646 char *name = qs_get_attr_name(doc,attr);
647 char *value = qs_get_attr_value(doc,attr);
651 if (strcasecmp(name, "http-equiv") == 0 && value && *value) {
652 /*----------------------------------------------------------------------*/
654 /*----------------------------------------------------------------------*/
655 W_L(" http-equiv=\"");
658 if (STRCASEEQ('c','C',"content-type", value))
659 content_type_flag = 1;
661 if (STRCASEEQ('r','R',"refresh", value))
668 if (strcasecmp(name, "content") == 0 && value && *value) {
669 if (content_type_flag) {
672 W_L("=\"text/html; charset=Windows-31J\"");
679 buf = apr_pstrdup(r->pool, value);
680 url = strchr(buf, ';');
682 sec = apr_pstrdup(r->pool, buf);
685 url = chxj_encoding_parameter(r, url);
686 url = chxj_add_cookie_parameter(r, url, chtml40->cookie);
716 * It is a handler who processes the META tag.
718 * @param pdoc [i/o] The pointer to the CHTML structure at the output
719 * destination is specified.
720 * @param node [i] The META tag node is specified.
721 * @return The conversion result is returned.
724 s_chtml40_end_meta_tag(void* pdoc, Node* UNUSED(child))
726 chtml40_t *chtml40 = GET_CHTML40(pdoc);
733 * It is a handler who processes the HEAD tag.
735 * @param pdoc [i/o] The pointer to the CHTML structure at the output
736 * destination is specified.
737 * @param node [i] The HEAD tag node is specified.
738 * @return The conversion result is returned.
741 s_chtml40_start_head_tag(void* pdoc, Node* UNUSED(node))
743 chtml40_t *chtml40 = GET_CHTML40(pdoc);
744 Doc *doc = chtml40->doc;
753 * It is a handler who processes the HEAD tag.
755 * @param pdoc [i/o] The pointer to the CHTML structure at the output
756 * destination is specified.
757 * @param node [i] The HEAD tag node is specified.
758 * @return The conversion result is returned.
761 s_chtml40_end_head_tag(void *pdoc, Node *UNUSED(node))
763 chtml40_t *chtml40 = GET_CHTML40(pdoc);
764 Doc *doc = chtml40->doc;
773 * It is a handler who processes the TITLE tag.
775 * @param pdoc [i/o] The pointer to the CHTML structure at the output
776 * destination is specified.
777 * @param node [i] The TITLE tag node is specified.
778 * @return The conversion result is returned.
781 s_chtml40_start_title_tag(void *pdoc, Node *UNUSED(node))
783 chtml40_t *chtml40 = GET_CHTML40(pdoc);
784 Doc *doc = chtml40->doc;
793 * It is a handler who processes the TITLE tag.
795 * @param pdoc [i/o] The pointer to the CHTML structure at the output
796 * destination is specified.
797 * @param node [i] The TITLE tag node is specified.
798 * @return The conversion result is returned.
801 s_chtml40_end_title_tag(void *pdoc, Node *UNUSED(child))
803 chtml40_t *chtml40 = GET_CHTML40(pdoc);
804 Doc *doc = chtml40->doc;
813 * It is a handler who processes the BASE tag.
815 * @param pdoc [i/o] The pointer to the CHTML structure at the output
816 * destination is specified.
817 * @param node [i] The BASE tag node is specified.
818 * @return The conversion result is returned.
821 s_chtml40_start_base_tag(void *pdoc, Node *node)
828 chtml40 = GET_CHTML40(pdoc);
833 /*--------------------------------------------------------------------------*/
835 /*--------------------------------------------------------------------------*/
836 for (attr = qs_get_attr(doc,node);
838 attr = qs_get_next_attr(doc,attr)) {
839 char *name = qs_get_attr_name(doc,attr);
840 char *value = qs_get_attr_value(doc,attr);
841 if (STRCASEEQ('h','H',"href", name)) {
854 * It is a handler who processes the BASE tag.
856 * @param pdoc [i/o] The pointer to the CHTML structure at the output
857 * destination is specified.
858 * @param node [i] The BASE tag node is specified.
859 * @return The conversion result is returned.
862 s_chtml40_end_base_tag(void *pdoc, Node *UNUSED(child))
864 chtml40_t *chtml40 = GET_CHTML40(pdoc);
871 * It is a handler who processes the BODY tag.
873 * @param pdoc [i/o] The pointer to the CHTML structure at the output
874 * destination is specified.
875 * @param node [i] The BODY tag node is specified.
876 * @return The conversion result is returned.
879 s_chtml40_start_body_tag(void *pdoc, Node *node)
886 chtml40 = GET_CHTML40(pdoc);
891 /*--------------------------------------------------------------------------*/
893 /*--------------------------------------------------------------------------*/
894 for (attr = qs_get_attr(doc,node);
896 attr = qs_get_next_attr(doc,attr)) {
897 char *name = qs_get_attr_name(doc,attr);
898 char *value = qs_get_attr_value(doc,attr);
899 if (STRCASEEQ('b','B', "bgcolor", name) && value && *value) {
900 /*----------------------------------------------------------------------*/
902 /*----------------------------------------------------------------------*/
907 else if (STRCASEEQ('t','T', "text", name) && value && *value) {
908 /*----------------------------------------------------------------------*/
910 /*----------------------------------------------------------------------*/
915 else if (STRCASEEQ('l','L',"link", name) && value && *value) {
916 /*----------------------------------------------------------------------*/
918 /*----------------------------------------------------------------------*/
923 else if (STRCASEEQ('a','A',"alink", name) && value && *value) {
924 /*----------------------------------------------------------------------*/
926 /*----------------------------------------------------------------------*/
931 else if (STRCASEEQ('v','V',"vlink", name) && value && *value) {
932 /*----------------------------------------------------------------------*/
934 /*----------------------------------------------------------------------*/
947 * It is a handler who processes the BODY tag.
949 * @param pdoc [i/o] The pointer to the CHTML structure at the output
950 * destination is specified.
951 * @param node [i] The BODY tag node is specified.
952 * @return The conversion result is returned.
955 s_chtml40_end_body_tag(void *pdoc, Node *UNUSED(child))
960 chtml40 = GET_CHTML40(pdoc);
970 * It is a handler who processes the A tag.
972 * @param pdoc [i/o] The pointer to the CHTML structure at the output
973 * destination is specified.
974 * @param node [i] The A tag node is specified.
975 * @return The conversion result is returned.
978 s_chtml40_start_a_tag(void *pdoc, Node *node)
985 chtml40 = GET_CHTML40(pdoc);
990 /*--------------------------------------------------------------------------*/
992 /*--------------------------------------------------------------------------*/
993 for (attr = qs_get_attr(doc,node);
995 attr = qs_get_next_attr(doc,attr)) {
996 char *name = qs_get_attr_name(doc,attr);
997 char *value = qs_get_attr_value(doc,attr);
998 if (STRCASEEQ('n','N',"name", name)) {
999 /*----------------------------------------------------------------------*/
1001 /*----------------------------------------------------------------------*/
1006 else if (STRCASEEQ('h','H',"href", name)) {
1007 /*----------------------------------------------------------------------*/
1009 /*----------------------------------------------------------------------*/
1010 value = chxj_encoding_parameter(r, value);
1011 value = chxj_add_cookie_parameter(r, value, chtml40->cookie);
1016 else if (STRCASEEQ('a','A',"accesskey", name)) {
1017 /*----------------------------------------------------------------------*/
1019 /*----------------------------------------------------------------------*/
1020 W_L(" accesskey=\"");
1024 else if (STRCASEEQ('c','C',"cti", name)) {
1025 /*----------------------------------------------------------------------*/
1027 /*----------------------------------------------------------------------*/
1032 else if (STRCASEEQ('i','I',"ijam", name)) {
1033 /*----------------------------------------------------------------------*/
1035 /*----------------------------------------------------------------------*/
1038 else if (STRCASEEQ('u','U',"utn", name)) {
1039 /*----------------------------------------------------------------------*/
1041 /* It is special only for CHTML. */
1042 /*----------------------------------------------------------------------*/
1045 else if (STRCASEEQ('t','T',"telbook", name)) {
1046 /*----------------------------------------------------------------------*/
1048 /*----------------------------------------------------------------------*/
1051 else if (STRCASEEQ('k','K',"kana", name)) {
1052 /*----------------------------------------------------------------------*/
1054 /*----------------------------------------------------------------------*/
1057 else if (STRCASEEQ('e','E',"email", name)) {
1058 /*----------------------------------------------------------------------*/
1060 /*----------------------------------------------------------------------*/
1063 else if (STRCASEEQ('i','I',"ista", name)) {
1064 /*----------------------------------------------------------------------*/
1066 /*----------------------------------------------------------------------*/
1069 else if (STRCASEEQ('i','I',"ilet", name)) {
1070 /*----------------------------------------------------------------------*/
1072 /*----------------------------------------------------------------------*/
1075 else if (STRCASEEQ('i','I',"iswf", name)) {
1076 /*----------------------------------------------------------------------*/
1078 /*----------------------------------------------------------------------*/
1081 else if (STRCASEEQ('i','I',"irst", name)) {
1082 /*----------------------------------------------------------------------*/
1084 /*----------------------------------------------------------------------*/
1089 return chtml40->out;
1094 * It is a handler who processes the A tag.
1096 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1097 * destination is specified.
1098 * @param node [i] The A tag node is specified.
1099 * @return The conversion result is returned.
1102 s_chtml40_end_a_tag(void *pdoc, Node *UNUSED(child))
1107 chtml40 = GET_CHTML40(pdoc);
1112 return chtml40->out;
1117 * It is a handler who processes the BR tag.
1119 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1120 * destination is specified.
1121 * @param node [i] The BR tag node is specified.
1122 * @return The conversion result is returned.
1125 s_chtml40_start_br_tag(void *pdoc, Node *node)
1132 chtml40 = GET_CHTML40(pdoc);
1136 /*--------------------------------------------------------------------------*/
1137 /* Get Attributes */
1138 /*--------------------------------------------------------------------------*/
1139 for (attr = qs_get_attr(doc,node);
1141 attr = qs_get_next_attr(doc,attr)) {
1142 char *name = qs_get_attr_name(doc,attr);
1143 char *value = qs_get_attr_value(doc,attr);
1144 if (STRCASEEQ('c','C',"clear",name)) {
1145 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1154 return chtml40->out;
1159 * It is a handler who processes the BR tag.
1161 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1162 * destination is specified.
1163 * @param node [i] The BR tag node is specified.
1164 * @return The conversion result is returned.
1167 s_chtml40_end_br_tag(void *pdoc, Node *UNUSED(child))
1169 chtml40_t *chtml40 = GET_CHTML40(pdoc);
1171 return chtml40->out;
1176 * It is a handler who processes the TR tag.
1178 * @param chtml40 [i/o] The pointer to the CHTML structure at the output
1179 * destination is specified.
1180 * @param node [i] The TR tag node is specified.
1181 * @return The conversion result is returned.
1184 s_chtml40_start_tr_tag(void *pdoc, Node *UNUSED(node))
1186 chtml40_t *chtml40 = GET_CHTML40(pdoc);
1188 return chtml40->out;
1193 * It is a handler who processes the TR tag.
1195 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1196 * destination is specified.
1197 * @param node [i] The TR tag node is specified.
1198 * @return The conversion result is returned.
1201 s_chtml40_end_tr_tag(void *pdoc, Node *UNUSED(child))
1207 chtml40 = GET_CHTML40(pdoc);
1213 return chtml40->out;
1218 * It is a handler who processes the FONT tag.
1220 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1221 * destination is specified.
1222 * @param node [i] The FONT tag node is specified.
1223 * @return The conversion result is returned.
1226 s_chtml40_start_font_tag(void *pdoc, Node *node)
1234 chtml40 = GET_CHTML40(pdoc);
1238 /*--------------------------------------------------------------------------*/
1239 /* Get Attributes */
1240 /*--------------------------------------------------------------------------*/
1241 for (attr = qs_get_attr(doc,node);
1242 attr && color == NULL;
1243 attr = qs_get_next_attr(doc,attr)) {
1244 char *name = qs_get_attr_name(doc,attr);
1245 char *value = qs_get_attr_value(doc,attr);
1246 if (STRCASEEQ('c','C',"color", name) && value && *value) {
1247 color = apr_pstrdup(doc->buf.pool, value);
1250 else if (STRCASEEQ('s','S',"size", name)) {
1251 /*----------------------------------------------------------------------*/
1253 /*----------------------------------------------------------------------*/
1258 W_L("<font color=\"");
1261 chtml40->font_flag++;
1263 return chtml40->out;
1268 * It is a handler who processes the FONT tag.
1270 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1271 * destination is specified.
1272 * @param node [i] The FONT tag node is specified.
1273 * @return The conversion result is returned.
1276 s_chtml40_end_font_tag(void *pdoc, Node *UNUSED(child))
1282 chtml40 = GET_CHTML40(pdoc);
1286 if (chtml40->font_flag) {
1288 chtml40->font_flag--;
1291 return chtml40->out;
1296 * It is a handler who processes the FORM tag.
1298 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1299 * destination is specified.
1300 * @param node [i] The FORM tag node is specified.
1301 * @return The conversion result is returned.
1304 s_chtml40_start_form_tag(void *pdoc, Node *node)
1311 chtml40 = GET_CHTML40(pdoc);
1316 /*--------------------------------------------------------------------------*/
1317 /* Get Attributes */
1318 /*--------------------------------------------------------------------------*/
1319 for (attr = qs_get_attr(doc,node);
1321 attr = qs_get_next_attr(doc,attr)) {
1322 char *name = qs_get_attr_name(doc,attr);
1323 char *value = qs_get_attr_value(doc,attr);
1324 if (STRCASEEQ('a','A',"action", name)) {
1325 /*----------------------------------------------------------------------*/
1327 /*----------------------------------------------------------------------*/
1328 value = chxj_encoding_parameter(r, value);
1329 value = chxj_add_cookie_parameter(r, value, chtml40->cookie);
1334 else if (STRCASEEQ('m','M',"method", name)) {
1335 /*----------------------------------------------------------------------*/
1337 /*----------------------------------------------------------------------*/
1342 else if (STRCASEEQ('u','U',"utn", name)) {
1343 /*----------------------------------------------------------------------*/
1345 /* It is special only for CHTML. */
1346 /*----------------------------------------------------------------------*/
1352 return chtml40->out;
1357 * It is a handler who processes the FORM tag.
1359 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1360 * destination is specified.
1361 * @param node [i] The FORM tag node is specified.
1362 * @return The conversion result is returned.
1365 s_chtml40_end_form_tag(void *pdoc, Node *UNUSED(child))
1370 chtml40 = GET_CHTML40(pdoc);
1375 return chtml40->out;
1380 * It is a handler who processes the INPUT tag.
1382 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1383 * destination is specified.
1384 * @param node [i] The INPUT tag node is specified.
1385 * @return The conversion result is returned.
1388 s_chtml40_start_input_tag(void *pdoc, Node *node)
1393 char *max_length = NULL;
1397 char *istyle = NULL;
1399 char *checked = NULL;
1400 char *accesskey = NULL;
1402 chtml40 = GET_CHTML40(pdoc);
1406 /*--------------------------------------------------------------------------*/
1407 /* Get Attributes */
1408 /*--------------------------------------------------------------------------*/
1409 type = qs_get_type_attr(doc, node, doc->buf.pool);
1410 name = qs_get_name_attr(doc, node, doc->buf.pool);
1411 value = qs_get_value_attr(doc,node, doc->buf.pool);
1412 istyle = qs_get_istyle_attr(doc,node,doc->buf.pool);
1413 max_length = qs_get_maxlength_attr(doc,node,doc->buf.pool);
1414 checked = qs_get_checked_attr(doc,node,doc->buf.pool);
1415 accesskey = qs_get_accesskey_attr(doc, node, doc->buf.pool);
1416 size = qs_get_size_attr(doc, node, doc->buf.pool);
1419 type = qs_trim_string(doc->buf.pool, type);
1420 if (type && (STRCASEEQ('t','T',"text", type) ||
1421 STRCASEEQ('p','P',"password",type) ||
1422 STRCASEEQ('c','C',"checkbox",type) ||
1423 STRCASEEQ('r','R',"radio", type) ||
1424 STRCASEEQ('h','H',"hidden", type) ||
1425 STRCASEEQ('s','S',"submit", type) ||
1426 STRCASEEQ('r','R',"reset", type))) {
1432 if (size && *size) {
1437 if (name && *name) {
1442 if (value && *value) {
1444 W_V(chxj_add_slash_to_doublequote(doc->pool, value));
1447 if (accesskey && *accesskey) {
1448 W_L(" accesskey=\"");
1453 /*------------------------------------------------------------------------*/
1455 /*------------------------------------------------------------------------*/
1456 if (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4') {
1463 /*--------------------------------------------------------------------------*/
1464 /* The figure is default for the password. */
1465 /*--------------------------------------------------------------------------*/
1466 if (max_length && *max_length) {
1467 if (chxj_chk_numeric(max_length) != 0) {
1468 max_length = apr_psprintf(r->pool, "0");
1470 if (istyle != NULL && *istyle == '1') {
1471 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length) * 2);
1475 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length));
1483 return chtml40->out;
1488 * It is a handler who processes the INPUT tag.
1490 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1491 * destination is specified.
1492 * @param node [i] The INPUT tag node is specified.
1493 * @return The conversion result is returned.
1496 s_chtml40_end_input_tag(void *pdoc, Node *UNUSED(child))
1498 chtml40_t *chtml40 = GET_CHTML40(pdoc);
1500 return chtml40->out;
1505 * It is a handler who processes the CENTER tag.
1507 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1508 * destination is specified.
1509 * @param node [i] The CENTER tag node is specified.
1510 * @return The conversion result is returned.
1513 s_chtml40_start_center_tag(void *pdoc, Node *UNUSED(node))
1518 chtml40 = GET_CHTML40(pdoc);
1523 return chtml40->out;
1528 * It is a handler who processes the CENTER tag.
1530 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1531 * destination is specified.
1532 * @param node [i] The CENTER tag node is specified.
1533 * @return The conversion result is returned.
1536 s_chtml40_end_center_tag(void *pdoc, Node *UNUSED(child))
1541 chtml40 = GET_CHTML40(pdoc);
1546 return chtml40->out;
1551 * It is a handler who processes the HR tag.
1553 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1554 * destination is specified.
1555 * @param node [i] The HR tag node is specified.
1556 * @return The conversion result is returned.
1559 s_chtml40_start_hr_tag(void *pdoc, Node *node)
1566 chtml40 = GET_CHTML40(pdoc);
1572 for (attr = qs_get_attr(doc,node);
1574 attr = qs_get_next_attr(doc,attr)) {
1575 char *name = qs_get_attr_name(doc,attr);
1576 char *value = qs_get_attr_value(doc,attr);
1577 if (STRCASEEQ('a','A',"align", name)) {
1578 /*----------------------------------------------------------------------*/
1580 /*----------------------------------------------------------------------*/
1581 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1587 else if (STRCASEEQ('s','S',"size", name)) {
1588 /*----------------------------------------------------------------------*/
1590 /*----------------------------------------------------------------------*/
1591 if (value && *value) {
1597 else if (STRCASEEQ('w','W',"width", name)) {
1598 /*----------------------------------------------------------------------*/
1600 /*----------------------------------------------------------------------*/
1601 if (value && *value) {
1607 else if (STRCASEEQ('n','N',"noshade", name)) {
1608 /*----------------------------------------------------------------------*/
1610 /*----------------------------------------------------------------------*/
1613 else if (STRCASEEQ('c','C',"color", name) && value && *value) {
1614 /*----------------------------------------------------------------------*/
1616 /*----------------------------------------------------------------------*/
1623 return chtml40->out;
1628 * It is a handler who processes the HR tag.
1630 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1631 * destination is specified.
1632 * @param node [i] The HR tag node is specified.
1633 * @return The conversion result is returned.
1636 s_chtml40_end_hr_tag(void *pdoc, Node *UNUSED(child))
1638 chtml40_t *chtml40 = GET_CHTML40(pdoc);
1640 return chtml40->out;
1645 * It is a handler who processes the IMG tag.
1647 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1648 * destination is specified.
1649 * @param node [i] The IMG tag node is specified.
1650 * @return The conversion result is returned.
1653 s_chtml40_start_img_tag(void *pdoc, Node *node)
1655 #ifndef IMG_NOT_CONVERT_FILENAME
1663 chtml40 = GET_CHTML40(pdoc);
1666 #ifndef IMG_NOT_CONVERT_FILENAME
1667 spec = chtml40->spec;
1671 /*--------------------------------------------------------------------------*/
1672 /* Get Attributes */
1673 /*--------------------------------------------------------------------------*/
1674 for (attr = qs_get_attr(doc,node);
1676 attr = qs_get_next_attr(doc,attr)) {
1677 char *name = qs_get_attr_name(doc,attr);
1678 char *value = qs_get_attr_value(doc,attr);
1679 if (STRCASEEQ('s','S',"src", name)) {
1680 /*----------------------------------------------------------------------*/
1682 /*----------------------------------------------------------------------*/
1683 #ifdef IMG_NOT_CONVERT_FILENAME
1684 value = chxj_encoding_parameter(r, value);
1685 value = chxj_add_cookie_parameter(r, value, chtml40->cookie);
1687 value = apr_psprintf(r->pool,
1690 (strchr(value, '?')) ? '&' : '?',
1691 CHXJ_COOKIE_NOUPDATE_PARAM);
1698 value = chxj_img_conv(r,spec,value);
1699 value = chxj_encoding_parameter(r, value);
1700 value = chxj_add_cookie_parameter(r, value, chtml40->cookie);
1702 value = apr_psprintf(r->pool,
1705 (strchr(value, '?')) ? '&' : '?',
1706 CHXJ_COOKIE_NOUPDATE_PARAM);
1713 else if (STRCASEEQ('a','A',"align", name)) {
1714 /*----------------------------------------------------------------------*/
1716 /*----------------------------------------------------------------------*/
1717 if (value && (STRCASEEQ('t','T',"top", value) ||
1718 STRCASEEQ('m','M',"middle", value) ||
1719 STRCASEEQ('b','B',"bottom", value) ||
1720 STRCASEEQ('l','L',"left", value) ||
1721 STRCASEEQ('c','C',"center", value) ||
1722 STRCASEEQ('r','R',"right", value))) {
1728 else if (STRCASEEQ('w','W',"width", name) && value && *value) {
1729 /*----------------------------------------------------------------------*/
1731 /*----------------------------------------------------------------------*/
1736 else if (STRCASEEQ('h','H', "height", name) && value && *value) {
1737 /*----------------------------------------------------------------------*/
1739 /*----------------------------------------------------------------------*/
1744 else if (STRCASEEQ('h','H',"hspace", name) && value && *value) {
1745 /*----------------------------------------------------------------------*/
1747 /*----------------------------------------------------------------------*/
1752 else if (STRCASEEQ('v','V',"vspace", name) && value && *value) {
1753 /*----------------------------------------------------------------------*/
1755 /*----------------------------------------------------------------------*/
1760 else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
1761 /*----------------------------------------------------------------------*/
1763 /*----------------------------------------------------------------------*/
1770 return chtml40->out;
1775 * It is a handler who processes the IMG tag.
1777 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1778 * destination is specified.
1779 * @param node [i] The IMG tag node is specified.
1780 * @return The conversion result is returned.
1783 s_chtml40_end_img_tag(void *pdoc, Node *UNUSED(child))
1785 chtml40_t *chtml40 = GET_CHTML40(pdoc);
1787 return chtml40->out;
1792 * It is a handler who processes the SELECT tag.
1794 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1795 * destination is specified.
1796 * @param node [i] The SELECT tag node is specified.
1797 * @return The conversion result is returned.
1800 s_chtml40_start_select_tag(void *pdoc, Node *child)
1802 chtml40_t *chtml40 = GET_CHTML40(pdoc);
1803 Doc *doc = chtml40->doc;
1806 char *multiple = NULL;
1810 for (attr = qs_get_attr(doc,child);
1812 attr = qs_get_next_attr(doc,attr)) {
1813 char *nm = qs_get_attr_name(doc,attr);
1814 char *val = qs_get_attr_value(doc,attr);
1815 if (STRCASEEQ('s','S',"size", nm)) {
1816 /*----------------------------------------------------------------------*/
1817 /* CHTML 1.0 version 2.0 */
1818 /*----------------------------------------------------------------------*/
1819 size = apr_pstrdup(doc->buf.pool, val);
1821 else if (STRCASEEQ('n','N',"name", nm)) {
1822 /*----------------------------------------------------------------------*/
1823 /* CHTML 1.0 version 2.0 */
1824 /*----------------------------------------------------------------------*/
1825 name = apr_pstrdup(doc->buf.pool, val);
1827 else if (STRCASEEQ('m','M',"multiple", nm)) {
1828 /*----------------------------------------------------------------------*/
1829 /* CHTML 1.0 version 2.0 */
1830 /*----------------------------------------------------------------------*/
1831 multiple = apr_pstrdup(doc->buf.pool, val);
1834 if (size && *size) {
1839 if (name && *name) {
1848 return chtml40->out;
1853 * It is a handler who processes the SELECT tag.
1855 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1856 * destination is specified.
1857 * @param node [i] The SELECT tag node is specified.
1858 * @return The conversion result is returned.
1861 s_chtml40_end_select_tag(void *pdoc, Node *UNUSED(child))
1863 chtml40_t *chtml40 = GET_CHTML40(pdoc);
1864 Doc *doc = chtml40->doc;
1867 return chtml40->out;
1872 * It is a handler who processes the OPTION tag.
1874 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1875 * destination is specified.
1876 * @param node [i] The OPTION tag node is specified.
1877 * @return The conversion result is returned.
1880 s_chtml40_start_option_tag(void *pdoc, Node *child)
1889 chtml40 = GET_CHTML40(pdoc);
1896 for (attr = qs_get_attr(doc,child);
1898 attr = qs_get_next_attr(doc,attr)) {
1899 char *nm = qs_get_attr_name(doc,attr);
1900 char *val = qs_get_attr_value(doc,attr);
1901 if (STRCASEEQ('s','S',"selected", nm)) {
1902 /*----------------------------------------------------------------------*/
1903 /* CHTML 1.0 version 2.0 */
1904 /*----------------------------------------------------------------------*/
1905 selected = apr_pstrdup(doc->buf.pool, val);
1907 else if (STRCASEEQ('v','V',"value", nm)) {
1908 /*----------------------------------------------------------------------*/
1909 /* CHTML 1.0 version 2.0 */
1910 /*----------------------------------------------------------------------*/
1911 value = apr_pstrdup(doc->buf.pool, val);
1914 if (value && *value) {
1923 return chtml40->out;
1928 * It is a handler who processes the OPTION tag.
1930 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1931 * destination is specified.
1932 * @param node [i] The OPTION tag node is specified.
1933 * @return The conversion result is returned.
1936 s_chtml40_end_option_tag(void *pdoc, Node *UNUSED(child))
1938 chtml40_t *chtml40 = GET_CHTML40(pdoc);
1942 return chtml40->out;
1947 * It is a handler who processes the DIV tag.
1949 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1950 * destination is specified.
1951 * @param node [i] The DIV tag node is specified.
1952 * @return The conversion result is returned.
1955 s_chtml40_start_div_tag(void *pdoc, Node *child)
1963 chtml40 = GET_CHTML40(pdoc);
1969 for (attr = qs_get_attr(doc,child);
1971 attr = qs_get_next_attr(doc,attr)) {
1972 char *nm = qs_get_attr_name(doc,attr);
1973 char *val = qs_get_attr_value(doc,attr);
1974 if (STRCASEEQ('a','A',"align", nm)) {
1975 /*----------------------------------------------------------------------*/
1976 /* CHTML 1.0 (W3C version 3.2) */
1977 /*----------------------------------------------------------------------*/
1978 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
1979 align = apr_pstrdup(doc->buf.pool, val);
1989 return chtml40->out;
1994 * It is a handler who processes the DIV tag.
1996 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1997 * destination is specified.
1998 * @param node [i] The DIV tag node is specified.
1999 * @return The conversion result is returned.
2002 s_chtml40_end_div_tag(void *pdoc, Node *UNUSED(node))
2004 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2005 Doc *doc = chtml40->doc;
2009 return chtml40->out;
2014 * It is a handler who processes the UL tag.
2016 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2017 * destination is specified.
2018 * @param node [i] The UL tag node is specified.
2019 * @return The conversion result is returned.
2022 s_chtml40_start_ul_tag(void *pdoc, Node *node)
2024 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2025 Doc *doc = chtml40->doc;
2028 /*--------------------------------------------------------------------------*/
2029 /* Get Attributes */
2030 /*--------------------------------------------------------------------------*/
2031 for (attr = qs_get_attr(doc,node);
2033 attr = qs_get_next_attr(doc,attr)) {
2034 char *name = qs_get_attr_name(doc,attr);
2035 char *value = qs_get_attr_value(doc,attr);
2036 if (STRCASEEQ('t','T',"type",name)) {
2037 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
2046 return chtml40->out;
2051 * It is a handler who processes the UL tag.
2053 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2054 * destination is specified.
2055 * @param node [i] The UL tag node is specified.
2056 * @return The conversion result is returned.
2059 s_chtml40_end_ul_tag(void *pdoc, Node *UNUSED(child))
2061 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2062 Doc *doc = chtml40->doc;
2066 return chtml40->out;
2071 * It is a handler who processes the PRE tag.
2073 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2074 * destination is specified.
2075 * @param node [i] The PRE tag node is specified.
2076 * @return The conversion result is returned.
2079 s_chtml40_start_pre_tag(void *pdoc, Node *UNUSED(node))
2081 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2082 Doc *doc = chtml40->doc;
2084 chtml40->pre_flag++;
2087 return chtml40->out;
2092 * It is a handler who processes the PRE tag.
2094 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2095 * destination is specified.
2096 * @param node [i] The PRE tag node is specified.
2097 * @return The conversion result is returned.
2100 s_chtml40_end_pre_tag(void *pdoc, Node *UNUSED(child))
2102 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2103 Doc *doc = chtml40->doc;
2106 chtml40->pre_flag--;
2108 return chtml40->out;
2113 * It is a handler who processes the P tag.
2115 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2116 * destination is specified.
2117 * @param node [i] The P tag node is specified.
2118 * @return The conversion result is returned.
2121 s_chtml40_start_p_tag(void *pdoc, Node *node)
2129 chtml40 = GET_CHTML40(pdoc);
2134 for (attr = qs_get_attr(doc,node);
2136 attr = qs_get_next_attr(doc,attr)) {
2137 char *nm = qs_get_attr_name(doc,attr);
2138 char *val = qs_get_attr_value(doc,attr);
2139 if (STRCASEEQ('a','A',"align", nm)) {
2140 /*----------------------------------------------------------------------*/
2141 /* CHTML 1.0 (W3C version 3.2) */
2142 /*----------------------------------------------------------------------*/
2143 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2144 align = apr_pstrdup(doc->buf.pool, val);
2155 return chtml40->out;
2160 * It is a handler who processes the P tag.
2162 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2163 * destination is specified.
2164 * @param node [i] The P tag node is specified.
2165 * @return The conversion result is returned.
2168 s_chtml40_end_p_tag(void *pdoc, Node *UNUSED(child))
2173 chtml40 = GET_CHTML40(pdoc);
2178 return chtml40->out;
2183 * It is a handler who processes the OL tag.
2185 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2186 * destination is specified.
2187 * @param node [i] The OL tag node is specified.
2188 * @return The conversion result is returned.
2191 s_chtml40_start_ol_tag(void *pdoc, Node *node)
2198 chtml40 = GET_CHTML40(pdoc);
2203 /*--------------------------------------------------------------------------*/
2204 /* Get Attributes */
2205 /*--------------------------------------------------------------------------*/
2206 for (attr = qs_get_attr(doc,node);
2208 attr = qs_get_next_attr(doc,attr)) {
2209 char *name = qs_get_attr_name(doc,attr);
2210 char *value = qs_get_attr_value(doc,attr);
2211 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
2216 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
2224 return chtml40->out;
2229 * It is a handler who processes the OL tag.
2231 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2232 * destination is specified.
2233 * @param node [i] The OL tag node is specified.
2234 * @return The conversion result is returned.
2237 s_chtml40_end_ol_tag(void *pdoc, Node *UNUSED(node))
2239 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2240 Doc *doc = chtml40->doc;
2244 return chtml40->out;
2249 * It is a handler who processes the LI tag.
2251 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2252 * destination is specified.
2253 * @param node [i] The LI tag node is specified.
2254 * @return The conversion result is returned.
2257 s_chtml40_start_li_tag(void *pdoc, Node *node)
2259 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2260 Doc *doc = chtml40->doc;
2264 /*--------------------------------------------------------------------------*/
2265 /* Get Attributes */
2266 /*--------------------------------------------------------------------------*/
2267 for (attr = qs_get_attr(doc,node);
2269 attr = qs_get_next_attr(doc,attr)) {
2270 char *name = qs_get_attr_name(doc,attr);
2271 char *value = qs_get_attr_value(doc,attr);
2272 if (STRCASEEQ('t','T',"type",name)) {
2273 if (value && (*value == '1' || *value == 'a' || *value == 'A' || STRCASEEQ('d','D',"disc",value) || STRCASEEQ('s','S',"square",value) || STRCASEEQ('c','C',"circle",value))) {
2279 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
2286 return chtml40->out;
2291 * It is a handler who processes the LI tag.
2293 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2294 * destination is specified.
2295 * @param node [i] The LI tag node is specified.
2296 * @return The conversion result is returned.
2299 s_chtml40_end_li_tag(void *pdoc, Node *UNUSED(child))
2301 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2303 return chtml40->out;
2308 * It is a handler who processes the H1 tag.
2310 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2311 * destination is specified.
2312 * @param node [i] The H1 tag node is specified.
2313 * @return The conversion result is returned.
2316 s_chtml40_start_h1_tag(void *pdoc, Node *node)
2323 chtml40 = GET_CHTML40(pdoc);
2328 for (attr = qs_get_attr(doc,node);
2330 attr = qs_get_next_attr(doc,attr)) {
2331 char *name = qs_get_attr_name(doc,attr);
2332 char *value = qs_get_attr_value(doc,attr);
2333 if (STRCASEEQ('a','A',"align", name)) {
2334 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2344 return chtml40->out;
2349 * It is a handler who processes the H1 tag.
2351 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2352 * destination is specified.
2353 * @param node [i] The H1 tag node is specified.
2354 * @return The conversion result is returned.
2357 s_chtml40_end_h1_tag(void *pdoc, Node *UNUSED(child))
2362 chtml40 = GET_CHTML40(pdoc);
2367 return chtml40->out;
2372 * It is a handler who processes the H2 tag.
2374 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2375 * destination is specified.
2376 * @param node [i] The H2 tag node is specified.
2377 * @return The conversion result is returned.
2380 s_chtml40_start_h2_tag(void *pdoc, Node *node)
2387 chtml40 = GET_CHTML40(pdoc);
2392 for (attr = qs_get_attr(doc,node);
2394 attr = qs_get_next_attr(doc,attr)) {
2395 char *name = qs_get_attr_name(doc,attr);
2396 char *value = qs_get_attr_value(doc,attr);
2397 if (STRCASEEQ('a','A',"align", name)) {
2398 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2407 return chtml40->out;
2412 * It is a handler who processes the H2 tag.
2414 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2415 * destination is specified.
2416 * @param node [i] The H2 tag node is specified.
2417 * @return The conversion result is returned.
2420 s_chtml40_end_h2_tag(void *pdoc, Node *UNUSED(child))
2422 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2423 Doc *doc = chtml40->doc;
2427 return chtml40->out;
2432 * It is a handler who processes the H3 tag.
2434 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2435 * destination is specified.
2436 * @param node [i] The H3 tag node is specified.
2437 * @return The conversion result is returned.
2440 s_chtml40_start_h3_tag(void *pdoc, Node *node)
2447 chtml40 = GET_CHTML40(pdoc);
2452 for (attr = qs_get_attr(doc,node);
2454 attr = qs_get_next_attr(doc,attr)) {
2455 char *name = qs_get_attr_name(doc,attr);
2456 char *value = qs_get_attr_value(doc,attr);
2457 if (STRCASEEQ('a','A',"align", name)) {
2458 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2468 return chtml40->out;
2473 * It is a handler who processes the H3 tag.
2475 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2476 * destination is specified.
2477 * @param node [i] The H3 tag node is specified.
2478 * @return The conversion result is returned.
2481 s_chtml40_end_h3_tag(void *pdoc, Node *UNUSED(child))
2483 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2484 Doc *doc = chtml40->doc;
2488 return chtml40->out;
2493 * It is a handler who processes the H4 tag.
2495 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2496 * destination is specified.
2497 * @param node [i] The H4 tag node is specified.
2498 * @return The conversion result is returned.
2501 s_chtml40_start_h4_tag(void *pdoc, Node *node)
2508 chtml40 = GET_CHTML40(pdoc);
2513 for (attr = qs_get_attr(doc,node);
2515 attr = qs_get_next_attr(doc,attr)) {
2516 char *name = qs_get_attr_name(doc,attr);
2517 char *value = qs_get_attr_value(doc,attr);
2518 if (STRCASEEQ('a','A',"align", name)) {
2519 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2528 return chtml40->out;
2533 * It is a handler who processes the H4 tag.
2535 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2536 * destination is specified.
2537 * @param node [i] The H4 tag node is specified.
2538 * @return The conversion result is returned.
2541 s_chtml40_end_h4_tag(void *pdoc, Node *UNUSED(child))
2543 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2544 Doc *doc = chtml40->doc;
2548 return chtml40->out;
2553 * It is a handler who processes the H5 tag.
2555 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2556 * destination is specified.
2557 * @param node [i] The H5 tag node is specified.
2558 * @return The conversion result is returned.
2561 s_chtml40_start_h5_tag(void *pdoc, Node *node)
2568 chtml40 = GET_CHTML40(pdoc);
2573 for (attr = qs_get_attr(doc,node);
2575 attr = qs_get_next_attr(doc,attr)) {
2576 char *name = qs_get_attr_name(doc,attr);
2577 char *value = qs_get_attr_value(doc,attr);
2578 if (STRCASEEQ('a','A',"align", name)) {
2579 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2588 return chtml40->out;
2593 * It is a handler who processes the H5 tag.
2595 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2596 * destination is specified.
2597 * @param node [i] The H5 tag node is specified.
2598 * @return The conversion result is returned.
2601 s_chtml40_end_h5_tag(void *pdoc, Node *UNUSED(child))
2603 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2604 Doc *doc = chtml40->doc;
2608 return chtml40->out;
2613 * It is a handler who processes the H6 tag.
2615 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2616 * destination is specified.
2617 * @param node [i] The H6 tag node is specified.
2618 * @return The conversion result is returned.
2621 s_chtml40_start_h6_tag(void *pdoc, Node *node)
2628 chtml40 = GET_CHTML40(pdoc);
2633 for (attr = qs_get_attr(doc,node);
2635 attr = qs_get_next_attr(doc,attr)) {
2636 char *name = qs_get_attr_name(doc,attr);
2637 char *value = qs_get_attr_value(doc,attr);
2638 if (STRCASEEQ('a','A',"align", name)) {
2639 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2648 return chtml40->out;
2653 * It is a handler who processes the H6 tag.
2655 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2656 * destination is specified.
2657 * @param node [i] The H6 tag node is specified.
2658 * @return The conversion result is returned.
2661 s_chtml40_end_h6_tag(void *pdoc, Node *UNUSED(child))
2663 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2664 Doc *doc = chtml40->doc;
2668 return chtml40->out;
2673 * It is a handler who processes the TEXTARE tag.
2675 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2676 * destination is specified.
2677 * @param node [i] The TEXTAREA tag node is specified.
2678 * @return The conversion result is returned.
2681 s_chtml40_start_textarea_tag(void *pdoc, Node *node)
2688 chtml40 = GET_CHTML40(pdoc);
2692 chtml40->textarea_flag++;
2695 for (attr = qs_get_attr(doc,node);
2697 attr = qs_get_next_attr(doc,attr)) {
2698 char *name = qs_get_attr_name(doc,attr);
2699 char *value = qs_get_attr_value(doc,attr);
2700 if (STRCASEEQ('a','A',"accesskey",name) && value && *value != 0) {
2701 W_L(" accesskey=\"");
2705 else if (STRCASEEQ('i','I',"istyle", name) && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
2710 else if (STRCASEEQ('n','N',"name", name) && value && *value) {
2715 else if (STRCASEEQ('r','R',"rows", name) && value && *value) {
2720 else if (STRCASEEQ('c','C',"cols", name) && value && *value) {
2727 return chtml40->out;
2732 * It is a handler who processes the TEXTAREA tag.
2734 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2735 * destination is specified.
2736 * @param node [i] The TEXTAREA tag node is specified.
2737 * @return The conversion result is returned.
2740 s_chtml40_end_textarea_tag(void *pdoc, Node *UNUSED(child))
2742 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2743 Doc *doc = chtml40->doc;
2746 chtml40->textarea_flag--;
2748 return chtml40->out;
2753 s_chtml40_chxjif_tag(void *pdoc, Node *node)
2760 chtml40 = GET_CHTML40(pdoc);
2764 for (child = qs_get_child_node(doc, node);
2766 child = qs_get_next_node(doc, child)) {
2768 s_chtml40_chxjif_tag(chtml40, child);
2776 s_chtml40_text_tag(void *pdoc, Node *child)
2789 chtml40 = GET_CHTML40(pdoc);
2793 textval = qs_get_node_value(doc,child);
2794 if (strlen(textval) == 0) {
2795 return chtml40->out;
2798 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
2799 memset(tmp, 0, qs_get_node_size(doc,child)+1);
2801 tdst = qs_alloc_zero_byte_string(doc->buf.pool);
2802 memset(one_byte, 0, sizeof(one_byte));
2805 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
2807 int rtn = s_chtml40_search_emoji(chtml40, &textval[ii], &out);
2809 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
2814 if (is_sjis_kanji(textval[ii])) {
2815 one_byte[0] = textval[ii+0];
2816 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2817 one_byte[0] = textval[ii+1];
2818 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2821 else if (chtml40->pre_flag) {
2822 one_byte[0] = textval[ii+0];
2823 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2825 else if (chtml40->textarea_flag) {
2826 one_byte[0] = textval[ii+0];
2827 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2829 else if (textval[ii] != '\r' && textval[ii] != '\n') {
2830 one_byte[0] = textval[ii+0];
2831 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2835 return chtml40->out;
2840 * It is a handler who processes the BLOCKQUOTE tag.
2842 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2843 * destination is specified.
2844 * @param node [i] The BLOCKQUOTE tag node is specified.
2845 * @return The conversion result is returned.
2848 s_chtml40_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
2850 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2851 Doc *doc = chtml40->doc;
2852 W_L("<blockquote>");
2853 return chtml40->out;
2858 * It is a handler who processes the BLOCKQUOTE tag.
2860 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2861 * destination is specified.
2862 * @param node [i] The BLOCKQUOTE tag node is specified.
2863 * @return The conversion result is returned.
2866 s_chtml40_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
2868 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2869 Doc *doc = chtml40->doc;
2870 W_L("</blockquote>");
2871 return chtml40->out;
2876 * It is a handler who processes the DIR tag.
2878 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2879 * destination is specified.
2880 * @param node [i] The DIR tag node is specified.
2881 * @return The conversion result is returned.
2884 s_chtml40_start_dir_tag(void *pdoc, Node *node)
2886 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2887 Doc *doc = chtml40->doc;
2890 for (attr = qs_get_attr(doc,node);
2892 attr = qs_get_next_attr(doc,attr)) {
2893 char *name = qs_get_attr_name(doc,attr);
2894 char *value = qs_get_attr_value(doc,attr);
2895 if (STRCASEEQ('t','T',"type",name)) {
2896 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
2904 return chtml40->out;
2909 * It is a handler who processes the DIR tag.
2911 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2912 * destination is specified.
2913 * @param node [i] The DIR tag node is specified.
2914 * @return The conversion result is returned.
2917 s_chtml40_end_dir_tag(void *pdoc, Node *UNUSED(child))
2919 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2920 Doc *doc = chtml40->doc;
2922 return chtml40->out;
2927 * It is a handler who processes the DL tag.
2929 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2930 * destination is specified.
2931 * @param node [i] The DL tag node is specified.
2932 * @return The conversion result is returned.
2935 s_chtml40_start_dl_tag(void *pdoc, Node *UNUSED(child))
2937 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2938 Doc *doc = chtml40->doc;
2940 return chtml40->out;
2945 * It is a handler who processes the DL tag.
2947 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2948 * destination is specified.
2949 * @param node [i] The DL tag node is specified.
2950 * @return The conversion result is returned.
2953 s_chtml40_end_dl_tag(void *pdoc, Node *UNUSED(child))
2955 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2956 Doc *doc = chtml40->doc;
2958 return chtml40->out;
2963 * It is a handler who processes the DT tag.
2965 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2966 * destination is specified.
2967 * @param node [i] The DT tag node is specified.
2968 * @return The conversion result is returned.
2971 s_chtml40_start_dt_tag(void *pdoc, Node *UNUSED(child))
2973 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2974 Doc *doc = chtml40->doc;
2976 return chtml40->out;
2981 * It is a handler who processes the DT tag.
2983 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2984 * destination is specified.
2985 * @param node [i] The DT tag node is specified.
2986 * @return The conversion result is returned.
2989 s_chtml40_end_dt_tag(void *pdoc, Node *UNUSED(child))
2991 chtml40_t *chtml40 = GET_CHTML40(pdoc);
2993 return chtml40->out;
2998 * It is a handler who processes the DD tag.
3000 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3001 * destination is specified.
3002 * @param node [i] The DD tag node is specified.
3003 * @return The conversion result is returned.
3006 s_chtml40_start_dd_tag(void *pdoc, Node *UNUSED(child))
3008 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3009 Doc *doc = chtml40->doc;
3013 return chtml40->out;
3018 * It is a handler who processes the DD tag.
3020 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3021 * destination is specified.
3022 * @param node [i] The DD tag node is specified.
3023 * @return The conversion result is returned.
3026 s_chtml40_end_dd_tag(void *pdoc, Node *UNUSED(child))
3028 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3030 return chtml40->out;
3035 * It is a handler who processes the MARQUEE tag.
3037 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3038 * destination is specified.
3039 * @param node [i] The MARQUEE tag node is specified.
3040 * @return The conversion result is returned.
3043 s_chtml40_start_marquee_tag(void *pdoc, Node *node)
3045 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3046 Doc *doc = chtml40->doc;
3049 /*--------------------------------------------------------------------------*/
3050 /* Get Attributes */
3051 /*--------------------------------------------------------------------------*/
3052 for (attr = qs_get_attr(doc,node);
3054 attr = qs_get_next_attr(doc,attr)) {
3055 char *name = qs_get_attr_name(doc,attr);
3056 char *value = qs_get_attr_value(doc,attr);
3057 if (STRCASEEQ('d','D',"direction", name)) {
3058 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3059 W_L(" direction=\"");
3064 else if (STRCASEEQ('b','B',"behavior",name)) {
3065 if (value && (STRCASEEQ('s','S',"scroll",value) || STRCASEEQ('s','S',"slide",value) || STRCASEEQ('a','A',"alternate",value))) {
3066 W_L(" behavior=\"");
3071 else if (STRCASEEQ('l','L',"loop",name)) {
3072 if (value && *value) {
3080 return chtml40->out;
3085 * It is a handler who processes the MARQUEE tag.
3087 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3088 * destination is specified.
3089 * @param node [i] The MARQUEE tag node is specified.
3090 * @return The conversion result is returned.
3093 s_chtml40_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3095 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3096 Doc *doc = chtml40->doc;
3098 return chtml40->out;
3103 * It is a handler who processes the BLINK tag.
3105 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3106 * destination is specified.
3107 * @param node [i] The BLINK tag node is specified.
3108 * @return The conversion result is returned.
3111 s_chtml40_start_blink_tag(void *pdoc, Node *UNUSED(child))
3113 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3114 Doc *doc = chtml40->doc;
3116 return chtml40->out;
3121 * It is a handler who processes the BLINK tag.
3123 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3124 * destination is specified.
3125 * @param node [i] The BLINK tag node is specified.
3126 * @return The conversion result is returned.
3129 s_chtml40_end_blink_tag(void *pdoc, Node *UNUSED(child))
3131 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3132 Doc *doc = chtml40->doc;
3134 return chtml40->out;
3139 * It is a handler who processes the MENU tag.
3141 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3142 * destination is specified.
3143 * @param node [i] The MENU tag node is specified.
3144 * @return The conversion result is returned.
3147 s_chtml40_start_menu_tag(void *pdoc, Node *node)
3149 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3150 Doc *doc = chtml40->doc;
3153 /*--------------------------------------------------------------------------*/
3154 /* Get Attributes */
3155 /*--------------------------------------------------------------------------*/
3156 for (attr = qs_get_attr(doc,node);
3158 attr = qs_get_next_attr(doc,attr)) {
3159 char *name = qs_get_attr_name(doc,attr);
3160 char *value = qs_get_attr_value(doc,attr);
3161 if (STRCASEEQ('t','T',"type",name)) {
3162 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
3170 return chtml40->out;
3175 * It is a handler who processes the MENU tag.
3177 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3178 * destination is specified.
3179 * @param node [i] The MENU tag node is specified.
3180 * @return The conversion result is returned.
3183 s_chtml40_end_menu_tag(void *pdoc, Node *UNUSED(child))
3185 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3186 Doc *doc = chtml40->doc;
3188 return chtml40->out;
3193 * It is a handler who processes the PLAINTEXT tag.
3195 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3196 * destination is specified.
3197 * @param node [i] The PLAINTEXT tag node is specified.
3198 * @return The conversion result is returned.
3201 s_chtml40_start_plaintext_tag(void *pdoc, Node *node)
3203 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3204 Doc *doc = chtml40->doc;
3206 s_chtml40_start_plaintext_tag_inner(pdoc,node);
3207 return chtml40->out;
3211 s_chtml40_start_plaintext_tag_inner(void *pdoc, Node *node)
3213 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3214 Doc *doc = chtml40->doc;
3216 for (child = qs_get_child_node(doc, node);
3218 child = qs_get_next_node(doc, child)) {
3220 s_chtml40_start_plaintext_tag_inner(pdoc, child);
3222 return chtml40->out;
3227 * It is a handler who processes the PLAINTEXT tag.
3229 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3230 * destination is specified.
3231 * @param node [i] The PLAINTEXT tag node is specified.
3232 * @return The conversion result is returned.
3235 s_chtml40_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3237 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3238 return chtml40->out;
3243 * * It is handler who processes the New Line Code.
3246 s_chtml40_newline_mark(void *pdoc, Node *UNUSED(node))
3248 chtml40_t *chtml40 = GET_CHTML40(pdoc);
3249 Doc *doc = chtml40->doc;
3251 return chtml40->out;