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_chtml30.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_CHTML30(X) ((chtml30_t *)(X))
29 #define W_L(X) do { chtml30->out = BUFFERED_WRITE_LITERAL(chtml30->out, &doc->buf, (X)); } while(0)
30 #define W_V(X) do { chtml30->out = (X) ? BUFFERED_WRITE_VALUE(chtml30->out, &doc->buf, (X)) \
31 : BUFFERED_WRITE_LITERAL(chtml30->out, &doc->buf, ""); } while(0)
33 static char *s_chtml30_start_html_tag (void *pdoc, Node *node);
34 static char *s_chtml30_end_html_tag (void *pdoc, Node *node);
35 static char *s_chtml30_start_meta_tag (void *pdoc, Node *node);
36 static char *s_chtml30_end_meta_tag (void *pdoc, Node *node);
37 static char *s_chtml30_start_textarea_tag (void *pdoc, Node *node);
38 static char *s_chtml30_end_textarea_tag (void *pdoc, Node *node);
39 static char *s_chtml30_start_p_tag (void *pdoc, Node *node);
40 static char *s_chtml30_end_p_tag (void *pdoc, Node *node);
41 static char *s_chtml30_start_pre_tag (void *pdoc, Node *node);
42 static char *s_chtml30_end_pre_tag (void *pdoc, Node *node);
43 static char *s_chtml30_start_h1_tag (void *pdoc, Node *node);
44 static char *s_chtml30_end_h1_tag (void *pdoc, Node *node);
45 static char *s_chtml30_start_h2_tag (void *pdoc, Node *node);
46 static char *s_chtml30_end_h2_tag (void *pdoc, Node *node);
47 static char *s_chtml30_start_h3_tag (void *pdoc, Node *node);
48 static char *s_chtml30_end_h3_tag (void *pdoc, Node *node);
49 static char *s_chtml30_start_h4_tag (void *pdoc, Node *node);
50 static char *s_chtml30_end_h4_tag (void *pdoc, Node *node);
51 static char *s_chtml30_start_h5_tag (void *pdoc, Node *node);
52 static char *s_chtml30_end_h5_tag (void *pdoc, Node *node);
53 static char *s_chtml30_start_h6_tag (void *pdoc, Node *node);
54 static char *s_chtml30_end_h6_tag (void *pdoc, Node *node);
55 static char *s_chtml30_start_ul_tag (void *pdoc, Node *node);
56 static char *s_chtml30_end_ul_tag (void *pdoc, Node *node);
57 static char *s_chtml30_start_ol_tag (void *pdoc, Node *node);
58 static char *s_chtml30_end_ol_tag (void *pdoc, Node *node);
59 static char *s_chtml30_start_li_tag (void *pdoc, Node *node);
60 static char *s_chtml30_end_li_tag (void *pdoc, Node *node);
61 static char *s_chtml30_start_head_tag (void *pdoc, Node *node);
62 static char *s_chtml30_end_head_tag (void *pdoc, Node *node);
63 static char *s_chtml30_start_title_tag (void *pdoc, Node *node);
64 static char *s_chtml30_end_title_tag (void *pdoc, Node *node);
65 static char *s_chtml30_start_base_tag (void *pdoc, Node *node);
66 static char *s_chtml30_end_base_tag (void *pdoc, Node *node);
67 static char *s_chtml30_start_body_tag (void *pdoc, Node *node);
68 static char *s_chtml30_end_body_tag (void *pdoc, Node *node);
69 static char *s_chtml30_start_a_tag (void *pdoc, Node *node);
70 static char *s_chtml30_end_a_tag (void *pdoc, Node *node);
71 static char *s_chtml30_start_br_tag (void *pdoc, Node *node);
72 static char *s_chtml30_end_br_tag (void *pdoc, Node *node);
73 static char *s_chtml30_start_tr_tag (void *pdoc, Node *node);
74 static char *s_chtml30_end_tr_tag (void *pdoc, Node *node);
75 static char *s_chtml30_start_font_tag (void *pdoc, Node *node);
76 static char *s_chtml30_end_font_tag (void *pdoc, Node *node);
77 static char *s_chtml30_start_form_tag (void *pdoc, Node *node);
78 static char *s_chtml30_end_form_tag (void *pdoc, Node *node);
79 static char *s_chtml30_start_input_tag (void *pdoc, Node *node);
80 static char *s_chtml30_end_input_tag (void *pdoc, Node *node);
81 static char *s_chtml30_start_center_tag (void *pdoc, Node *node);
82 static char *s_chtml30_end_center_tag (void *pdoc, Node *node);
83 static char *s_chtml30_start_hr_tag (void *pdoc, Node *node);
84 static char *s_chtml30_end_hr_tag (void *pdoc, Node *node);
85 static char *s_chtml30_start_img_tag (void *pdoc, Node *node);
86 static char *s_chtml30_end_img_tag (void *pdoc, Node *node);
87 static char *s_chtml30_start_select_tag (void *pdoc, Node *node);
88 static char *s_chtml30_end_select_tag (void *pdoc, Node *node);
89 static char *s_chtml30_start_option_tag (void *pdoc, Node *node);
90 static char *s_chtml30_end_option_tag (void *pdoc, Node *node);
91 static char *s_chtml30_start_div_tag (void *pdoc, Node *node);
92 static char *s_chtml30_end_div_tag (void *pdoc, Node *node);
93 static char *s_chtml30_chxjif_tag (void *pdoc, Node *node);
94 static char *s_chtml30_text_tag (void *pdoc, Node *node);
95 static char *s_chtml30_start_blockquote_tag(void *pdoc, Node *node);
96 static char *s_chtml30_end_blockquote_tag (void *pdoc, Node *node);
97 static char *s_chtml30_start_dir_tag (void *pdoc, Node *node);
98 static char *s_chtml30_end_dir_tag (void *pdoc, Node *node);
99 static char *s_chtml30_start_dl_tag (void *pdoc, Node *node);
100 static char *s_chtml30_end_dl_tag (void *pdoc, Node *node);
101 static char *s_chtml30_start_dt_tag (void *pdoc, Node *node);
102 static char *s_chtml30_end_dt_tag (void *pdoc, Node *node);
103 static char *s_chtml30_start_dd_tag (void *pdoc, Node *node);
104 static char *s_chtml30_end_dd_tag (void *pdoc, Node *node);
105 static char *s_chtml30_start_marquee_tag (void *pdoc, Node *node);
106 static char *s_chtml30_end_marquee_tag (void *pdoc, Node *node);
107 static char *s_chtml30_start_blink_tag (void *pdoc, Node *node);
108 static char *s_chtml30_end_blink_tag (void *pdoc, Node *node);
109 static char *s_chtml30_start_menu_tag (void *pdoc, Node *node);
110 static char *s_chtml30_end_menu_tag (void *pdoc, Node *node);
111 static char *s_chtml30_start_plaintext_tag (void *pdoc, Node *node);
112 static char *s_chtml30_start_plaintext_tag_inner (void *pdoc, Node *node);
113 static char *s_chtml30_end_plaintext_tag (void *pdoc, Node *node);
115 static void s_init_chtml30(chtml30_t *chtml, Doc *doc, request_rec *r, device_table *spec);
117 static int s_chtml30_search_emoji(chtml30_t *chtml, char *txt, char **rslt);
120 tag_handler chtml30_handler[] = {
123 s_chtml30_start_html_tag,
124 s_chtml30_end_html_tag,
128 s_chtml30_start_meta_tag,
129 s_chtml30_end_meta_tag,
133 s_chtml30_start_textarea_tag,
134 s_chtml30_end_textarea_tag,
138 s_chtml30_start_p_tag,
143 s_chtml30_start_pre_tag,
144 s_chtml30_end_pre_tag,
148 s_chtml30_start_ul_tag,
149 s_chtml30_end_ul_tag,
153 s_chtml30_start_li_tag,
154 s_chtml30_end_li_tag,
158 s_chtml30_start_ol_tag,
159 s_chtml30_end_ol_tag,
163 s_chtml30_start_h1_tag,
164 s_chtml30_end_h1_tag,
168 s_chtml30_start_h2_tag,
169 s_chtml30_end_h2_tag,
173 s_chtml30_start_h3_tag,
174 s_chtml30_end_h3_tag,
178 s_chtml30_start_h4_tag,
179 s_chtml30_end_h4_tag,
183 s_chtml30_start_h5_tag,
184 s_chtml30_end_h5_tag,
188 s_chtml30_start_h6_tag,
189 s_chtml30_end_h6_tag,
193 s_chtml30_start_head_tag,
194 s_chtml30_end_head_tag,
198 s_chtml30_start_title_tag,
199 s_chtml30_end_title_tag,
203 s_chtml30_start_base_tag,
204 s_chtml30_end_base_tag,
208 s_chtml30_start_body_tag,
209 s_chtml30_end_body_tag,
213 s_chtml30_start_a_tag,
218 s_chtml30_start_br_tag,
219 s_chtml30_end_br_tag,
228 s_chtml30_start_tr_tag,
229 s_chtml30_end_tr_tag,
243 s_chtml30_start_font_tag,
244 s_chtml30_end_font_tag,
248 s_chtml30_start_form_tag,
249 s_chtml30_end_form_tag,
253 s_chtml30_start_input_tag,
254 s_chtml30_end_input_tag,
258 s_chtml30_start_center_tag,
259 s_chtml30_end_center_tag,
263 s_chtml30_start_hr_tag,
264 s_chtml30_end_hr_tag,
268 s_chtml30_start_img_tag,
269 s_chtml30_end_img_tag,
273 s_chtml30_start_select_tag,
274 s_chtml30_end_select_tag,
278 s_chtml30_start_option_tag,
279 s_chtml30_end_option_tag,
283 s_chtml30_start_div_tag,
284 s_chtml30_end_div_tag,
288 s_chtml30_chxjif_tag,
333 s_chtml30_start_dt_tag,
334 s_chtml30_end_dt_tag,
348 s_chtml30_start_blockquote_tag,
349 s_chtml30_end_blockquote_tag,
353 s_chtml30_start_dir_tag,
354 s_chtml30_end_dir_tag,
358 s_chtml30_start_dl_tag,
359 s_chtml30_end_dl_tag,
363 s_chtml30_start_dd_tag,
364 s_chtml30_end_dd_tag,
368 s_chtml30_start_menu_tag,
369 s_chtml30_end_menu_tag,
373 s_chtml30_start_plaintext_tag,
374 s_chtml30_end_plaintext_tag,
378 s_chtml30_start_blink_tag,
379 s_chtml30_end_blink_tag,
383 s_chtml30_start_marquee_tag,
384 s_chtml30_end_marquee_tag,
390 * converts from CHTML5.0 to CHTML3.0.
392 * @param r [i] Requet_rec is appointed.
393 * @param spec [i] The result of the device specification processing which
394 * was done in advance is appointed.
395 * @param src [i] The character string before the converting is appointed.
396 * @return The character string after the converting is returned.
399 chxj_exchange_chtml30(
405 chxjconvrule_entry *entryp,
414 DBG(r, "start chxj_exchange_chtml30()");
416 /*--------------------------------------------------------------------------*/
418 /*--------------------------------------------------------------------------*/
420 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
422 DBG(r,"i found qrcode xml");
423 DBG(r, "end chxj_exchange_chtml30()");
426 DBG(r,"not found qrcode xml");
428 /*--------------------------------------------------------------------------*/
429 /* The CHTML structure is initialized. */
430 /*--------------------------------------------------------------------------*/
431 s_init_chtml30(&chtml30, &doc, r, spec);
433 chtml30.entryp = entryp;
434 chtml30.cookie = cookie;
436 chxj_set_content_type(r, "text/html; charset=Windows-31J");
438 /*--------------------------------------------------------------------------*/
439 /* The character string of the input is analyzed. */
440 /*--------------------------------------------------------------------------*/
441 qs_init_malloc(&doc);
442 qs_init_root_node(&doc);
444 ss = apr_pcalloc(r->pool, srclen + 1);
445 memset(ss, 0, srclen + 1);
446 memcpy(ss, src, srclen);
449 chxj_dump_out("[src] CHTML -> CHTML3.0", ss, srclen);
451 chxj_buffered_write_init(r->pool, &doc.buf);
453 qs_parse_string(&doc,ss, strlen(ss));
455 /*--------------------------------------------------------------------------*/
456 /* It converts it from CHTML to CHTML. */
457 /*--------------------------------------------------------------------------*/
458 chxj_node_exchange(spec,r,(void*)&chtml30, &doc, qs_get_root(&doc), 0);
459 chtml30.out = chxj_buffered_write_flush(chtml30.out, &doc.buf);
460 dst = apr_pstrdup(r->pool, chtml30.out);
461 chxj_buffered_write_terminate(&doc.buf);
463 qs_all_free(&doc,QX_LOGMARK);
466 dst = apr_pstrdup(r->pool,ss);
468 if (strlen(dst) == 0) {
469 dst = apr_psprintf(r->pool, "\n");
472 *dstlen = strlen(dst);
475 chxj_dump_out("[src] CHTML -> CHTML3.0", dst, *dstlen);
478 DBG(r, "end chxj_exchange_chtml30()");
484 * The CHTML structure is initialized.
486 * @param chtml30 [i/o] The pointer to the HDML structure that wants to be
487 * initialized is specified.
488 * @param doc [i] The Doc structure that should be set to the initialized
489 * HDML structure is specified.
490 * @param r [i] To use POOL, the pointer to request_rec is specified.
491 * @param spec [i] The pointer to the device_table
494 s_init_chtml30(chtml30_t *chtml30, Doc *doc, request_rec *r, device_table *spec)
496 memset(doc, 0, sizeof(Doc));
497 memset(chtml30, 0, sizeof(chtml30_t));
501 chtml30->spec = spec;
502 chtml30->out = qs_alloc_zero_byte_string(r);
503 chtml30->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
504 chtml30->doc->parse_mode = PARSE_MODE_CHTML;
509 * Corresponding EMOJI to a current character-code is retrieved.
510 * The substitution character string is stored in the rslt pointer if agreeing.
512 * @param chtml30 [i] The pointer to the CHTML structure is specified.
513 * @param txt [i] The character string to want to examine whether it is
514 * EMOJI is specified.
515 * @param rslt [o] The pointer to the pointer that stores the result is
517 * @return When corresponding EMOJI exists, it returns it excluding 0.
520 s_chtml30_search_emoji(chtml30_t *chtml30, char *txt, char **rslt)
527 spec = chtml30->spec;
533 DBG(r,"spec is NULL");
536 for (ee = chtml30->conf->emoji;
539 if (ee->imode == NULL) {
540 DBG(r, "emoji->imode is NULL");
544 if (ee->imode->string != NULL
545 && strlen(ee->imode->string) > 0
546 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
548 if (spec == NULL || spec->emoji_type == NULL) {
549 *rslt = apr_palloc(r->pool, 3);
550 (*rslt)[0] = ee->imode->hex1byte & 0xff;
551 (*rslt)[1] = ee->imode->hex2byte & 0xff;
553 return strlen(ee->imode->string);
565 * It is a handler who processes the HTML tag.
567 * @param pdoc [i/o] The pointer to the CHTML structure at the output
568 * destination is specified.
569 * @param node [i] The HTML tag node is specified.
570 * @return The conversion result is returned.
573 s_chtml30_start_html_tag(void *pdoc, Node *UNUSED(node))
575 chtml30_t *chtml30 = GET_CHTML30(pdoc);
576 Doc *doc = chtml30->doc;
578 /*--------------------------------------------------------------------------*/
580 /*--------------------------------------------------------------------------*/
588 * It is a handler who processes the HTML tag.
590 * @param pdoc [i/o] The pointer to the CHTML structure at the output
591 * destination is specified.
592 * @param node [i] The HTML tag node is specified.
593 * @return The conversion result is returned.
596 s_chtml30_end_html_tag(void *pdoc, Node *UNUSED(child))
598 chtml30_t *chtml30 = GET_CHTML30(pdoc);
599 Doc *doc = chtml30->doc;
607 * It is a handler who processes the META tag.
609 * @param pdoc [i/o] The pointer to the CHTML structure at the output
610 * destination is specified.
611 * @param node [i] The META tag node is specified.
612 * @return The conversion result is returned.
615 s_chtml30_start_meta_tag(void *pdoc, Node *node)
621 int content_type_flag;
624 chtml30 = GET_CHTML30(pdoc);
628 content_type_flag = 0;
632 /*--------------------------------------------------------------------------*/
634 /*--------------------------------------------------------------------------*/
635 for (attr = qs_get_attr(doc,node);
637 attr = qs_get_next_attr(doc,attr)) {
638 char *name = qs_get_attr_name(doc,attr);
639 char *value = qs_get_attr_value(doc,attr);
643 if (strcasecmp(name, "http-equiv") == 0 && value && *value) {
644 /*----------------------------------------------------------------------*/
646 /*----------------------------------------------------------------------*/
647 W_L(" http-equiv=\"");
650 if (STRCASEEQ('c','C',"content-type", value))
651 content_type_flag = 1;
653 if (STRCASEEQ('r','R',"refresh", value))
660 if (strcasecmp(name, "content") == 0 && value && *value) {
661 if (content_type_flag) {
664 W_L("=\"text/html; charset=Windows-31J\"");
671 buf = apr_pstrdup(r->pool, value);
672 url = strchr(buf, ';');
674 sec = apr_pstrdup(r->pool, buf);
677 url = chxj_encoding_parameter(r, url);
678 url = chxj_add_cookie_parameter(r, url, chtml30->cookie);
708 * It is a handler who processes the META tag.
710 * @param pdoc [i/o] The pointer to the CHTML structure at the output
711 * destination is specified.
712 * @param node [i] The META tag node is specified.
713 * @return The conversion result is returned.
716 s_chtml30_end_meta_tag(void* pdoc, Node* UNUSED(child))
718 chtml30_t *chtml30 = GET_CHTML30(pdoc);
725 * It is a handler who processes the HEAD tag.
727 * @param pdoc [i/o] The pointer to the CHTML structure at the output
728 * destination is specified.
729 * @param node [i] The HEAD tag node is specified.
730 * @return The conversion result is returned.
733 s_chtml30_start_head_tag(void* pdoc, Node* UNUSED(node))
735 chtml30_t *chtml30 = GET_CHTML30(pdoc);
736 Doc *doc = chtml30->doc;
745 * It is a handler who processes the HEAD tag.
747 * @param pdoc [i/o] The pointer to the CHTML structure at the output
748 * destination is specified.
749 * @param node [i] The HEAD tag node is specified.
750 * @return The conversion result is returned.
753 s_chtml30_end_head_tag(void *pdoc, Node *UNUSED(node))
755 chtml30_t *chtml30 = GET_CHTML30(pdoc);
756 Doc *doc = chtml30->doc;
765 * It is a handler who processes the TITLE tag.
767 * @param pdoc [i/o] The pointer to the CHTML structure at the output
768 * destination is specified.
769 * @param node [i] The TITLE tag node is specified.
770 * @return The conversion result is returned.
773 s_chtml30_start_title_tag(void *pdoc, Node *UNUSED(node))
775 chtml30_t *chtml30 = GET_CHTML30(pdoc);
776 Doc *doc = chtml30->doc;
785 * It is a handler who processes the TITLE tag.
787 * @param pdoc [i/o] The pointer to the CHTML structure at the output
788 * destination is specified.
789 * @param node [i] The TITLE tag node is specified.
790 * @return The conversion result is returned.
793 s_chtml30_end_title_tag(void *pdoc, Node *UNUSED(child))
795 chtml30_t *chtml30 = GET_CHTML30(pdoc);
796 Doc *doc = chtml30->doc;
805 * It is a handler who processes the BASE tag.
807 * @param pdoc [i/o] The pointer to the CHTML structure at the output
808 * destination is specified.
809 * @param node [i] The BASE tag node is specified.
810 * @return The conversion result is returned.
813 s_chtml30_start_base_tag(void *pdoc, Node *node)
820 chtml30 = GET_CHTML30(pdoc);
825 /*--------------------------------------------------------------------------*/
827 /*--------------------------------------------------------------------------*/
828 for (attr = qs_get_attr(doc,node);
830 attr = qs_get_next_attr(doc,attr)) {
831 char *name = qs_get_attr_name(doc,attr);
832 char *value = qs_get_attr_value(doc,attr);
833 if (STRCASEEQ('h','H',"href", name)) {
845 * It is a handler who processes the BASE tag.
847 * @param pdoc [i/o] The pointer to the CHTML structure at the output
848 * destination is specified.
849 * @param node [i] The BASE tag node is specified.
850 * @return The conversion result is returned.
853 s_chtml30_end_base_tag(void *pdoc, Node *UNUSED(child))
855 chtml30_t *chtml30 = GET_CHTML30(pdoc);
862 * It is a handler who processes the BODY tag.
864 * @param pdoc [i/o] The pointer to the CHTML structure at the output
865 * destination is specified.
866 * @param node [i] The BODY tag node is specified.
867 * @return The conversion result is returned.
870 s_chtml30_start_body_tag(void *pdoc, Node *node)
877 chtml30 = GET_CHTML30(pdoc);
882 /*--------------------------------------------------------------------------*/
884 /*--------------------------------------------------------------------------*/
885 for (attr = qs_get_attr(doc,node);
887 attr = qs_get_next_attr(doc,attr)) {
888 char *name = qs_get_attr_name(doc,attr);
889 char *value = qs_get_attr_value(doc,attr);
890 if (STRCASEEQ('b','B', "bgcolor", name) && value && *value) {
891 /*----------------------------------------------------------------------*/
893 /*----------------------------------------------------------------------*/
898 else if (STRCASEEQ('t','T', "text", name) && value && *value) {
899 /*----------------------------------------------------------------------*/
901 /*----------------------------------------------------------------------*/
906 else if (STRCASEEQ('l','L',"link", name) && value && *value) {
907 /*----------------------------------------------------------------------*/
909 /*----------------------------------------------------------------------*/
914 else if (STRCASEEQ('a','A',"alink", name)) {
915 /*----------------------------------------------------------------------*/
917 /*----------------------------------------------------------------------*/
920 else if (STRCASEEQ('v','V',"vlink", name)) {
921 /*----------------------------------------------------------------------*/
923 /*----------------------------------------------------------------------*/
933 * It is a handler who processes the BODY tag.
935 * @param pdoc [i/o] The pointer to the CHTML structure at the output
936 * destination is specified.
937 * @param node [i] The BODY tag node is specified.
938 * @return The conversion result is returned.
941 s_chtml30_end_body_tag(void *pdoc, Node *UNUSED(child))
946 chtml30 = GET_CHTML30(pdoc);
956 * It is a handler who processes the A tag.
958 * @param pdoc [i/o] The pointer to the CHTML structure at the output
959 * destination is specified.
960 * @param node [i] The A tag node is specified.
961 * @return The conversion result is returned.
964 s_chtml30_start_a_tag(void *pdoc, Node *node)
971 chtml30 = GET_CHTML30(pdoc);
976 /*--------------------------------------------------------------------------*/
978 /*--------------------------------------------------------------------------*/
979 for (attr = qs_get_attr(doc,node);
981 attr = qs_get_next_attr(doc,attr)) {
982 char *name = qs_get_attr_name(doc,attr);
983 char *value = qs_get_attr_value(doc,attr);
984 if (STRCASEEQ('n','N',"name", name)) {
985 /*----------------------------------------------------------------------*/
987 /*----------------------------------------------------------------------*/
992 else if (STRCASEEQ('h','H',"href", name)) {
993 /*----------------------------------------------------------------------*/
995 /*----------------------------------------------------------------------*/
996 value = chxj_encoding_parameter(r, value);
997 value = chxj_add_cookie_parameter(r, value, chtml30->cookie);
1002 else if (STRCASEEQ('a','A',"accesskey", name)) {
1003 /*----------------------------------------------------------------------*/
1005 /*----------------------------------------------------------------------*/
1006 W_L(" accesskey=\"");
1010 else if (STRCASEEQ('c','C',"cti", name)) {
1011 /*----------------------------------------------------------------------*/
1013 /*----------------------------------------------------------------------*/
1018 else if (STRCASEEQ('i','I',"ijam", name)) {
1019 /*----------------------------------------------------------------------*/
1021 /*----------------------------------------------------------------------*/
1024 else if (STRCASEEQ('u','U',"utn", name)) {
1025 /*----------------------------------------------------------------------*/
1027 /* It is special only for CHTML. */
1028 /*----------------------------------------------------------------------*/
1031 else if (STRCASEEQ('t','T',"telbook", name)) {
1032 /*----------------------------------------------------------------------*/
1034 /*----------------------------------------------------------------------*/
1037 else if (STRCASEEQ('k','K',"kana", name)) {
1038 /*----------------------------------------------------------------------*/
1040 /*----------------------------------------------------------------------*/
1043 else if (STRCASEEQ('e','E',"email", name)) {
1044 /*----------------------------------------------------------------------*/
1046 /*----------------------------------------------------------------------*/
1049 else if (STRCASEEQ('i','I',"ista", name)) {
1050 /*----------------------------------------------------------------------*/
1052 /*----------------------------------------------------------------------*/
1055 else if (STRCASEEQ('i','I',"ilet", name)) {
1056 /*----------------------------------------------------------------------*/
1058 /*----------------------------------------------------------------------*/
1061 else if (STRCASEEQ('i','I',"iswf", name)) {
1062 /*----------------------------------------------------------------------*/
1064 /*----------------------------------------------------------------------*/
1067 else if (STRCASEEQ('i','I',"irst", name)) {
1068 /*----------------------------------------------------------------------*/
1070 /*----------------------------------------------------------------------*/
1075 return chtml30->out;
1080 * It is a handler who processes the A tag.
1082 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1083 * destination is specified.
1084 * @param node [i] The A tag node is specified.
1085 * @return The conversion result is returned.
1088 s_chtml30_end_a_tag(void *pdoc, Node *UNUSED(child))
1093 chtml30 = GET_CHTML30(pdoc);
1098 return chtml30->out;
1103 * It is a handler who processes the BR tag.
1105 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1106 * destination is specified.
1107 * @param node [i] The BR tag node is specified.
1108 * @return The conversion result is returned.
1111 s_chtml30_start_br_tag(void *pdoc, Node *node)
1118 chtml30 = GET_CHTML30(pdoc);
1122 /*--------------------------------------------------------------------------*/
1123 /* Get Attributes */
1124 /*--------------------------------------------------------------------------*/
1125 for (attr = qs_get_attr(doc,node);
1127 attr = qs_get_next_attr(doc,attr)) {
1128 char *name = qs_get_attr_name(doc,attr);
1129 char *value = qs_get_attr_value(doc,attr);
1130 if (STRCASEEQ('c','C',"clear",name)) {
1131 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1139 return chtml30->out;
1144 * It is a handler who processes the BR tag.
1146 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1147 * destination is specified.
1148 * @param node [i] The BR tag node is specified.
1149 * @return The conversion result is returned.
1152 s_chtml30_end_br_tag(void *pdoc, Node *UNUSED(child))
1154 chtml30_t *chtml30 = GET_CHTML30(pdoc);
1156 return chtml30->out;
1161 * It is a handler who processes the TR tag.
1163 * @param chtml30 [i/o] The pointer to the CHTML structure at the output
1164 * destination is specified.
1165 * @param node [i] The TR tag node is specified.
1166 * @return The conversion result is returned.
1169 s_chtml30_start_tr_tag(void *pdoc, Node *UNUSED(node))
1171 chtml30_t *chtml30 = GET_CHTML30(pdoc);
1173 return chtml30->out;
1178 * It is a handler who processes the TR tag.
1180 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1181 * destination is specified.
1182 * @param node [i] The TR tag node is specified.
1183 * @return The conversion result is returned.
1186 s_chtml30_end_tr_tag(void *pdoc, Node *UNUSED(child))
1192 chtml30 = GET_CHTML30(pdoc);
1198 return chtml30->out;
1203 * It is a handler who processes the FONT tag.
1205 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1206 * destination is specified.
1207 * @param node [i] The FONT tag node is specified.
1208 * @return The conversion result is returned.
1211 s_chtml30_start_font_tag(void *pdoc, Node *node)
1218 chtml30 = GET_CHTML30(pdoc);
1223 /*--------------------------------------------------------------------------*/
1224 /* Get Attributes */
1225 /*--------------------------------------------------------------------------*/
1226 for (attr = qs_get_attr(doc,node);
1228 attr = qs_get_next_attr(doc,attr)) {
1229 char *name = qs_get_attr_name(doc,attr);
1230 char *value = qs_get_attr_value(doc,attr);
1231 if (STRCASEEQ('c','C',"color", name) && value && *value) {
1236 else if (STRCASEEQ('s','S',"size", name)) {
1237 /*----------------------------------------------------------------------*/
1239 /*----------------------------------------------------------------------*/
1244 return chtml30->out;
1249 * It is a handler who processes the FONT tag.
1251 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1252 * destination is specified.
1253 * @param node [i] The FONT tag node is specified.
1254 * @return The conversion result is returned.
1257 s_chtml30_end_font_tag(void *pdoc, Node *UNUSED(child))
1263 chtml30 = GET_CHTML30(pdoc);
1269 return chtml30->out;
1274 * It is a handler who processes the FORM tag.
1276 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1277 * destination is specified.
1278 * @param node [i] The FORM tag node is specified.
1279 * @return The conversion result is returned.
1282 s_chtml30_start_form_tag(void *pdoc, Node *node)
1289 chtml30 = GET_CHTML30(pdoc);
1294 /*--------------------------------------------------------------------------*/
1295 /* Get Attributes */
1296 /*--------------------------------------------------------------------------*/
1297 for (attr = qs_get_attr(doc,node);
1299 attr = qs_get_next_attr(doc,attr)) {
1300 char *name = qs_get_attr_name(doc,attr);
1301 char *value = qs_get_attr_value(doc,attr);
1302 if (STRCASEEQ('a','A',"action", name)) {
1303 /*----------------------------------------------------------------------*/
1305 /*----------------------------------------------------------------------*/
1306 value = chxj_encoding_parameter(r, value);
1307 value = chxj_add_cookie_parameter(r, value, chtml30->cookie);
1312 else if (STRCASEEQ('m','M',"method", name)) {
1313 /*----------------------------------------------------------------------*/
1315 /*----------------------------------------------------------------------*/
1320 else if (STRCASEEQ('u','U',"utn", name)) {
1321 /*----------------------------------------------------------------------*/
1323 /* It is special only for CHTML. */
1324 /*----------------------------------------------------------------------*/
1329 return chtml30->out;
1334 * It is a handler who processes the FORM tag.
1336 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1337 * destination is specified.
1338 * @param node [i] The FORM tag node is specified.
1339 * @return The conversion result is returned.
1342 s_chtml30_end_form_tag(void *pdoc, Node *UNUSED(child))
1347 chtml30 = GET_CHTML30(pdoc);
1352 return chtml30->out;
1357 * It is a handler who processes the INPUT tag.
1359 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1360 * destination is specified.
1361 * @param node [i] The INPUT tag node is specified.
1362 * @return The conversion result is returned.
1365 s_chtml30_start_input_tag(void *pdoc, Node *node)
1370 char *max_length = NULL;
1374 char *istyle = NULL;
1376 char *checked = NULL;
1377 char *accesskey = NULL;
1379 chtml30 = GET_CHTML30(pdoc);
1383 /*--------------------------------------------------------------------------*/
1384 /* Get Attributes */
1385 /*--------------------------------------------------------------------------*/
1386 type = qs_get_type_attr(doc, node, r);
1387 name = qs_get_name_attr(doc, node, r);
1388 value = qs_get_value_attr(doc,node,r);
1389 istyle = qs_get_istyle_attr(doc,node,r);
1390 max_length = qs_get_maxlength_attr(doc,node,r);
1391 checked = qs_get_checked_attr(doc,node,r);
1392 accesskey = qs_get_accesskey_attr(doc, node, r);
1393 size = qs_get_size_attr(doc, node, r);
1396 type = qs_trim_string(doc->buf.pool, type);
1397 if (type && (STRCASEEQ('t','T',"text", type) ||
1398 STRCASEEQ('p','P',"password",type) ||
1399 STRCASEEQ('c','C',"checkbox",type) ||
1400 STRCASEEQ('r','R',"radio", type) ||
1401 STRCASEEQ('h','H',"hidden", type) ||
1402 STRCASEEQ('s','S',"submit", type) ||
1403 STRCASEEQ('r','R',"reset", type))) {
1409 if (size && *size) {
1414 if (name && *name) {
1419 if (value && *value) {
1424 if (accesskey && *accesskey) {
1425 W_L(" accesskey=\"");
1430 /*------------------------------------------------------------------------*/
1432 /*------------------------------------------------------------------------*/
1433 if (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4') {
1440 /*--------------------------------------------------------------------------*/
1441 /* The figure is default for the password. */
1442 /*--------------------------------------------------------------------------*/
1443 if (max_length && *max_length) {
1444 if (chxj_chk_numeric(max_length) != 0) {
1445 max_length = apr_psprintf(r->pool, "0");
1447 if (istyle != NULL && *istyle == '1') {
1448 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length) * 2);
1452 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length));
1460 return chtml30->out;
1465 * It is a handler who processes the INPUT tag.
1467 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1468 * destination is specified.
1469 * @param node [i] The INPUT tag node is specified.
1470 * @return The conversion result is returned.
1473 s_chtml30_end_input_tag(void *pdoc, Node *UNUSED(child))
1475 chtml30_t *chtml30 = GET_CHTML30(pdoc);
1477 return chtml30->out;
1482 * It is a handler who processes the CENTER tag.
1484 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1485 * destination is specified.
1486 * @param node [i] The CENTER tag node is specified.
1487 * @return The conversion result is returned.
1490 s_chtml30_start_center_tag(void *pdoc, Node *UNUSED(node))
1495 chtml30 = GET_CHTML30(pdoc);
1500 return chtml30->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_chtml30_end_center_tag(void *pdoc, Node *UNUSED(child))
1518 chtml30 = GET_CHTML30(pdoc);
1523 return chtml30->out;
1528 * It is a handler who processes the HR tag.
1530 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1531 * destination is specified.
1532 * @param node [i] The HR tag node is specified.
1533 * @return The conversion result is returned.
1536 s_chtml30_start_hr_tag(void *pdoc, Node *node)
1543 chtml30 = GET_CHTML30(pdoc);
1549 for (attr = qs_get_attr(doc,node);
1551 attr = qs_get_next_attr(doc,attr)) {
1552 char *name = qs_get_attr_name(doc,attr);
1553 char *value = qs_get_attr_value(doc,attr);
1554 if (STRCASEEQ('a','A',"align", name)) {
1555 /*----------------------------------------------------------------------*/
1557 /*----------------------------------------------------------------------*/
1558 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1564 else if (STRCASEEQ('s','S',"size", name)) {
1565 /*----------------------------------------------------------------------*/
1567 /*----------------------------------------------------------------------*/
1568 if (value && *value) {
1574 else if (STRCASEEQ('w','W',"width", name)) {
1575 /*----------------------------------------------------------------------*/
1577 /*----------------------------------------------------------------------*/
1578 if (value && *value) {
1584 else if (STRCASEEQ('n','N',"noshade", name)) {
1585 /*----------------------------------------------------------------------*/
1587 /*----------------------------------------------------------------------*/
1590 else if (STRCASEEQ('c','C',"color", name)) {
1591 /*----------------------------------------------------------------------*/
1593 /*----------------------------------------------------------------------*/
1598 return chtml30->out;
1603 * It is a handler who processes the HR tag.
1605 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1606 * destination is specified.
1607 * @param node [i] The HR tag node is specified.
1608 * @return The conversion result is returned.
1611 s_chtml30_end_hr_tag(void *pdoc, Node *UNUSED(child))
1613 chtml30_t *chtml30 = GET_CHTML30(pdoc);
1615 return chtml30->out;
1620 * It is a handler who processes the IMG tag.
1622 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1623 * destination is specified.
1624 * @param node [i] The IMG tag node is specified.
1625 * @return The conversion result is returned.
1628 s_chtml30_start_img_tag(void *pdoc, Node *node)
1630 #ifndef IMG_NOT_CONVERT_FILENAME
1638 chtml30 = GET_CHTML30(pdoc);
1641 #ifndef IMG_NOT_CONVERT_FILENAME
1642 spec = chtml30->spec;
1646 /*--------------------------------------------------------------------------*/
1647 /* Get Attributes */
1648 /*--------------------------------------------------------------------------*/
1649 for (attr = qs_get_attr(doc,node);
1651 attr = qs_get_next_attr(doc,attr)) {
1652 char *name = qs_get_attr_name(doc,attr);
1653 char *value = qs_get_attr_value(doc,attr);
1654 if (STRCASEEQ('s','S',"src", name)) {
1655 /*----------------------------------------------------------------------*/
1657 /*----------------------------------------------------------------------*/
1658 #ifdef IMG_NOT_CONVERT_FILENAME
1659 value = chxj_encoding_parameter(r, value);
1660 value = chxj_add_cookie_parameter(r, value, chtml30->cookie);
1662 value = apr_psprintf(r->pool,
1665 (strchr(value, '?')) ? '&' : '?',
1666 CHXJ_COOKIE_NOUPDATE_PARAM);
1673 value = chxj_img_conv(r,spec,value);
1674 value = chxj_encoding_parameter(r, value);
1675 value = chxj_add_cookie_parameter(r, value, chtml30->cookie);
1677 value = apr_psprintf(r->pool,
1680 (strchr(value, '?')) ? '&' : '?',
1681 CHXJ_COOKIE_NOUPDATE_PARAM);
1688 else if (STRCASEEQ('a','A',"align", name)) {
1689 /*----------------------------------------------------------------------*/
1691 /*----------------------------------------------------------------------*/
1692 if (value && (STRCASEEQ('t','T',"top", value) ||
1693 STRCASEEQ('m','M',"middle",value) ||
1694 STRCASEEQ('b','B',"bottom",value) ||
1695 STRCASEEQ('l','L',"left", value) ||
1696 STRCASEEQ('r','R',"right", value))) {
1702 else if (STRCASEEQ('w','W',"width", name) && value && *value) {
1703 /*----------------------------------------------------------------------*/
1705 /*----------------------------------------------------------------------*/
1710 else if (STRCASEEQ('h','H', "height", name) && value && *value) {
1711 /*----------------------------------------------------------------------*/
1713 /*----------------------------------------------------------------------*/
1718 else if (STRCASEEQ('h','H',"hspace", name) && value && *value) {
1719 /*----------------------------------------------------------------------*/
1721 /*----------------------------------------------------------------------*/
1726 else if (STRCASEEQ('v','V',"vspace", name) && value && *value) {
1727 /*----------------------------------------------------------------------*/
1729 /*----------------------------------------------------------------------*/
1734 else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
1735 /*----------------------------------------------------------------------*/
1737 /*----------------------------------------------------------------------*/
1742 else if (STRCASEEQ('a','A',"align", name) && value && *value) {
1743 /*----------------------------------------------------------------------*/
1745 /*----------------------------------------------------------------------*/
1750 return chtml30->out;
1755 * It is a handler who processes the IMG tag.
1757 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1758 * destination is specified.
1759 * @param node [i] The IMG tag node is specified.
1760 * @return The conversion result is returned.
1763 s_chtml30_end_img_tag(void *pdoc, Node *UNUSED(child))
1765 chtml30_t *chtml30 = GET_CHTML30(pdoc);
1767 return chtml30->out;
1772 * It is a handler who processes the SELECT tag.
1774 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1775 * destination is specified.
1776 * @param node [i] The SELECT tag node is specified.
1777 * @return The conversion result is returned.
1780 s_chtml30_start_select_tag(void *pdoc, Node *child)
1782 chtml30_t *chtml30 = GET_CHTML30(pdoc);
1783 Doc *doc = chtml30->doc;
1786 char *multiple = NULL;
1790 for (attr = qs_get_attr(doc,child);
1792 attr = qs_get_next_attr(doc,attr)) {
1793 char *nm = qs_get_attr_name(doc,attr);
1794 char *val = qs_get_attr_value(doc,attr);
1795 if (STRCASEEQ('s','S',"size", nm)) {
1796 /*----------------------------------------------------------------------*/
1797 /* CHTML 1.0 version 2.0 */
1798 /*----------------------------------------------------------------------*/
1799 size = apr_pstrdup(doc->buf.pool, val);
1801 else if (STRCASEEQ('n','N',"name", nm)) {
1802 /*----------------------------------------------------------------------*/
1803 /* CHTML 1.0 version 2.0 */
1804 /*----------------------------------------------------------------------*/
1805 name = apr_pstrdup(doc->buf.pool, val);
1807 else if (STRCASEEQ('m','M',"multiple", nm)) {
1808 /*----------------------------------------------------------------------*/
1809 /* CHTML 1.0 version 2.0 */
1810 /*----------------------------------------------------------------------*/
1811 multiple = apr_pstrdup(doc->buf.pool, val);
1814 if (size && *size) {
1819 if (name && *name) {
1828 return chtml30->out;
1833 * It is a handler who processes the SELECT tag.
1835 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1836 * destination is specified.
1837 * @param node [i] The SELECT tag node is specified.
1838 * @return The conversion result is returned.
1841 s_chtml30_end_select_tag(void *pdoc, Node *UNUSED(child))
1843 chtml30_t *chtml30 = GET_CHTML30(pdoc);
1844 Doc *doc = chtml30->doc;
1847 return chtml30->out;
1852 * It is a handler who processes the OPTION tag.
1854 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1855 * destination is specified.
1856 * @param node [i] The OPTION tag node is specified.
1857 * @return The conversion result is returned.
1860 s_chtml30_start_option_tag(void *pdoc, Node *child)
1869 chtml30 = GET_CHTML30(pdoc);
1876 for (attr = qs_get_attr(doc,child);
1878 attr = qs_get_next_attr(doc,attr)) {
1879 char *nm = qs_get_attr_name(doc,attr);
1880 char *val = qs_get_attr_value(doc,attr);
1881 if (STRCASEEQ('s','S',"selected", nm)) {
1882 /*----------------------------------------------------------------------*/
1883 /* CHTML 1.0 version 2.0 */
1884 /*----------------------------------------------------------------------*/
1885 selected = apr_pstrdup(doc->buf.pool, val);
1887 else if (STRCASEEQ('v','V',"value", nm)) {
1888 /*----------------------------------------------------------------------*/
1889 /* CHTML 1.0 version 2.0 */
1890 /*----------------------------------------------------------------------*/
1891 value = apr_pstrdup(doc->buf.pool, val);
1894 if (value && *value) {
1903 return chtml30->out;
1908 * It is a handler who processes the OPTION tag.
1910 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1911 * destination is specified.
1912 * @param node [i] The OPTION tag node is specified.
1913 * @return The conversion result is returned.
1916 s_chtml30_end_option_tag(void *pdoc, Node *UNUSED(child))
1918 chtml30_t *chtml30 = GET_CHTML30(pdoc);
1922 return chtml30->out;
1927 * It is a handler who processes the DIV tag.
1929 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1930 * destination is specified.
1931 * @param node [i] The DIV tag node is specified.
1932 * @return The conversion result is returned.
1935 s_chtml30_start_div_tag(void *pdoc, Node *child)
1943 chtml30 = GET_CHTML30(pdoc);
1949 for (attr = qs_get_attr(doc,child);
1951 attr = qs_get_next_attr(doc,attr)) {
1952 char *nm = qs_get_attr_name(doc,attr);
1953 char *val = qs_get_attr_value(doc,attr);
1954 if (STRCASEEQ('a','A',"align", nm)) {
1955 /*----------------------------------------------------------------------*/
1956 /* CHTML 1.0 (W3C version 3.2) */
1957 /*----------------------------------------------------------------------*/
1958 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
1959 align = apr_pstrdup(doc->buf.pool, val);
1969 return chtml30->out;
1974 * It is a handler who processes the DIV tag.
1976 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1977 * destination is specified.
1978 * @param node [i] The DIV tag node is specified.
1979 * @return The conversion result is returned.
1982 s_chtml30_end_div_tag(void *pdoc, Node *UNUSED(node))
1984 chtml30_t *chtml30 = GET_CHTML30(pdoc);
1985 Doc *doc = chtml30->doc;
1989 return chtml30->out;
1994 * It is a handler who processes the UL tag.
1996 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1997 * destination is specified.
1998 * @param node [i] The UL tag node is specified.
1999 * @return The conversion result is returned.
2002 s_chtml30_start_ul_tag(void *pdoc, Node *UNUSED(node))
2004 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2005 Doc *doc = chtml30->doc;
2009 return chtml30->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_chtml30_end_ul_tag(void *pdoc, Node *UNUSED(child))
2024 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2025 Doc *doc = chtml30->doc;
2029 return chtml30->out;
2034 * It is a handler who processes the PRE tag.
2036 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2037 * destination is specified.
2038 * @param node [i] The PRE tag node is specified.
2039 * @return The conversion result is returned.
2042 s_chtml30_start_pre_tag(void *pdoc, Node *UNUSED(node))
2044 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2045 Doc *doc = chtml30->doc;
2047 chtml30->pre_flag++;
2050 return chtml30->out;
2055 * It is a handler who processes the PRE tag.
2057 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2058 * destination is specified.
2059 * @param node [i] The PRE tag node is specified.
2060 * @return The conversion result is returned.
2063 s_chtml30_end_pre_tag(void *pdoc, Node *UNUSED(child))
2065 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2066 Doc *doc = chtml30->doc;
2069 chtml30->pre_flag--;
2071 return chtml30->out;
2076 * It is a handler who processes the P tag.
2078 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2079 * destination is specified.
2080 * @param node [i] The P tag node is specified.
2081 * @return The conversion result is returned.
2084 s_chtml30_start_p_tag(void *pdoc, Node *node)
2092 chtml30 = GET_CHTML30(pdoc);
2097 for (attr = qs_get_attr(doc,node);
2099 attr = qs_get_next_attr(doc,attr)) {
2100 char *nm = qs_get_attr_name(doc,attr);
2101 char *val = qs_get_attr_value(doc,attr);
2102 if (STRCASEEQ('a','A',"align", nm)) {
2103 /*----------------------------------------------------------------------*/
2104 /* CHTML 1.0 (W3C version 3.2) */
2105 /*----------------------------------------------------------------------*/
2106 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2107 align = apr_pstrdup(doc->buf.pool, val);
2118 return chtml30->out;
2123 * It is a handler who processes the P tag.
2125 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2126 * destination is specified.
2127 * @param node [i] The P tag node is specified.
2128 * @return The conversion result is returned.
2131 s_chtml30_end_p_tag(void *pdoc, Node *UNUSED(child))
2136 chtml30 = GET_CHTML30(pdoc);
2141 return chtml30->out;
2146 * It is a handler who processes the OL tag.
2148 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2149 * destination is specified.
2150 * @param node [i] The OL tag node is specified.
2151 * @return The conversion result is returned.
2154 s_chtml30_start_ol_tag(void *pdoc, Node *node)
2161 chtml30 = GET_CHTML30(pdoc);
2166 /*--------------------------------------------------------------------------*/
2167 /* Get Attributes */
2168 /*--------------------------------------------------------------------------*/
2169 for (attr = qs_get_attr(doc,node);
2171 attr = qs_get_next_attr(doc,attr)) {
2172 char *name = qs_get_attr_name(doc,attr);
2173 char *value = qs_get_attr_value(doc,attr);
2174 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
2179 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
2187 return chtml30->out;
2192 * It is a handler who processes the OL tag.
2194 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2195 * destination is specified.
2196 * @param node [i] The OL tag node is specified.
2197 * @return The conversion result is returned.
2200 s_chtml30_end_ol_tag(void *pdoc, Node *UNUSED(node))
2202 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2203 Doc *doc = chtml30->doc;
2207 return chtml30->out;
2212 * It is a handler who processes the LI tag.
2214 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2215 * destination is specified.
2216 * @param node [i] The LI tag node is specified.
2217 * @return The conversion result is returned.
2220 s_chtml30_start_li_tag(void *pdoc, Node *node)
2222 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2223 Doc *doc = chtml30->doc;
2227 /*--------------------------------------------------------------------------*/
2228 /* Get Attributes */
2229 /*--------------------------------------------------------------------------*/
2230 for (attr = qs_get_attr(doc,node);
2232 attr = qs_get_next_attr(doc,attr)) {
2233 char *name = qs_get_attr_name(doc,attr);
2234 char *value = qs_get_attr_value(doc,attr);
2235 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
2240 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
2247 return chtml30->out;
2252 * It is a handler who processes the LI tag.
2254 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2255 * destination is specified.
2256 * @param node [i] The LI tag node is specified.
2257 * @return The conversion result is returned.
2260 s_chtml30_end_li_tag(void *pdoc, Node *UNUSED(child))
2262 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2264 return chtml30->out;
2269 * It is a handler who processes the H1 tag.
2271 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2272 * destination is specified.
2273 * @param node [i] The H1 tag node is specified.
2274 * @return The conversion result is returned.
2277 s_chtml30_start_h1_tag(void *pdoc, Node *node)
2284 chtml30 = GET_CHTML30(pdoc);
2289 for (attr = qs_get_attr(doc,node);
2291 attr = qs_get_next_attr(doc,attr)) {
2292 char *name = qs_get_attr_name(doc,attr);
2293 char *value = qs_get_attr_value(doc,attr);
2294 if (STRCASEEQ('a','A',"align", name)) {
2295 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2305 return chtml30->out;
2310 * It is a handler who processes the H1 tag.
2312 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2313 * destination is specified.
2314 * @param node [i] The H1 tag node is specified.
2315 * @return The conversion result is returned.
2318 s_chtml30_end_h1_tag(void *pdoc, Node *UNUSED(child))
2323 chtml30 = GET_CHTML30(pdoc);
2328 return chtml30->out;
2333 * It is a handler who processes the H2 tag.
2335 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2336 * destination is specified.
2337 * @param node [i] The H2 tag node is specified.
2338 * @return The conversion result is returned.
2341 s_chtml30_start_h2_tag(void *pdoc, Node *node)
2348 chtml30 = GET_CHTML30(pdoc);
2353 for (attr = qs_get_attr(doc,node);
2355 attr = qs_get_next_attr(doc,attr)) {
2356 char *name = qs_get_attr_name(doc,attr);
2357 char *value = qs_get_attr_value(doc,attr);
2358 if (STRCASEEQ('a','A',"align", name)) {
2359 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2368 return chtml30->out;
2373 * It is a handler who processes the H2 tag.
2375 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2376 * destination is specified.
2377 * @param node [i] The H2 tag node is specified.
2378 * @return The conversion result is returned.
2381 s_chtml30_end_h2_tag(void *pdoc, Node *UNUSED(child))
2383 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2384 Doc *doc = chtml30->doc;
2388 return chtml30->out;
2393 * It is a handler who processes the H3 tag.
2395 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2396 * destination is specified.
2397 * @param node [i] The H3 tag node is specified.
2398 * @return The conversion result is returned.
2401 s_chtml30_start_h3_tag(void *pdoc, Node *node)
2408 chtml30 = GET_CHTML30(pdoc);
2413 for (attr = qs_get_attr(doc,node);
2415 attr = qs_get_next_attr(doc,attr)) {
2416 char *name = qs_get_attr_name(doc,attr);
2417 char *value = qs_get_attr_value(doc,attr);
2418 if (STRCASEEQ('a','A',"align", name)) {
2419 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2429 return chtml30->out;
2434 * It is a handler who processes the H3 tag.
2436 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2437 * destination is specified.
2438 * @param node [i] The H3 tag node is specified.
2439 * @return The conversion result is returned.
2442 s_chtml30_end_h3_tag(void *pdoc, Node *UNUSED(child))
2444 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2445 Doc *doc = chtml30->doc;
2449 return chtml30->out;
2454 * It is a handler who processes the H4 tag.
2456 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2457 * destination is specified.
2458 * @param node [i] The H4 tag node is specified.
2459 * @return The conversion result is returned.
2462 s_chtml30_start_h4_tag(void *pdoc, Node *node)
2469 chtml30 = GET_CHTML30(pdoc);
2474 for (attr = qs_get_attr(doc,node);
2476 attr = qs_get_next_attr(doc,attr)) {
2477 char *name = qs_get_attr_name(doc,attr);
2478 char *value = qs_get_attr_value(doc,attr);
2479 if (STRCASEEQ('a','A',"align", name)) {
2480 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2489 return chtml30->out;
2494 * It is a handler who processes the H4 tag.
2496 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2497 * destination is specified.
2498 * @param node [i] The H4 tag node is specified.
2499 * @return The conversion result is returned.
2502 s_chtml30_end_h4_tag(void *pdoc, Node *UNUSED(child))
2504 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2505 Doc *doc = chtml30->doc;
2509 return chtml30->out;
2514 * It is a handler who processes the H5 tag.
2516 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2517 * destination is specified.
2518 * @param node [i] The H5 tag node is specified.
2519 * @return The conversion result is returned.
2522 s_chtml30_start_h5_tag(void *pdoc, Node *node)
2529 chtml30 = GET_CHTML30(pdoc);
2534 for (attr = qs_get_attr(doc,node);
2536 attr = qs_get_next_attr(doc,attr)) {
2537 char *name = qs_get_attr_name(doc,attr);
2538 char *value = qs_get_attr_value(doc,attr);
2539 if (STRCASEEQ('a','A',"align", name)) {
2540 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2549 return chtml30->out;
2554 * It is a handler who processes the H5 tag.
2556 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2557 * destination is specified.
2558 * @param node [i] The H5 tag node is specified.
2559 * @return The conversion result is returned.
2562 s_chtml30_end_h5_tag(void *pdoc, Node *UNUSED(child))
2564 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2565 Doc *doc = chtml30->doc;
2569 return chtml30->out;
2574 * It is a handler who processes the H6 tag.
2576 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2577 * destination is specified.
2578 * @param node [i] The H6 tag node is specified.
2579 * @return The conversion result is returned.
2582 s_chtml30_start_h6_tag(void *pdoc, Node *node)
2589 chtml30 = GET_CHTML30(pdoc);
2594 for (attr = qs_get_attr(doc,node);
2596 attr = qs_get_next_attr(doc,attr)) {
2597 char *name = qs_get_attr_name(doc,attr);
2598 char *value = qs_get_attr_value(doc,attr);
2599 if (STRCASEEQ('a','A',"align", name)) {
2600 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2609 return chtml30->out;
2614 * It is a handler who processes the H6 tag.
2616 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2617 * destination is specified.
2618 * @param node [i] The H6 tag node is specified.
2619 * @return The conversion result is returned.
2622 s_chtml30_end_h6_tag(void *pdoc, Node *UNUSED(child))
2624 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2625 Doc *doc = chtml30->doc;
2629 return chtml30->out;
2634 * It is a handler who processes the TEXTARE tag.
2636 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2637 * destination is specified.
2638 * @param node [i] The TEXTAREA tag node is specified.
2639 * @return The conversion result is returned.
2642 s_chtml30_start_textarea_tag(void *pdoc, Node *node)
2649 chtml30 = GET_CHTML30(pdoc);
2653 chtml30->textarea_flag++;
2656 for (attr = qs_get_attr(doc,node);
2658 attr = qs_get_next_attr(doc,attr)) {
2659 char *name = qs_get_attr_name(doc,attr);
2660 char *value = qs_get_attr_value(doc,attr);
2661 if (STRCASEEQ('a','A',"accesskey",name) && value && *value != 0) {
2662 W_L(" accesskey=\"");
2666 else if (STRCASEEQ('i','I',"istyle", name) && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
2671 else if (STRCASEEQ('n','N',"name", name) && value && *value) {
2676 else if (STRCASEEQ('r','R',"rows", name) && value && *value) {
2681 else if (STRCASEEQ('c','C',"cols", name) && value && *value) {
2688 return chtml30->out;
2693 * It is a handler who processes the TEXTAREA tag.
2695 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2696 * destination is specified.
2697 * @param node [i] The TEXTAREA tag node is specified.
2698 * @return The conversion result is returned.
2701 s_chtml30_end_textarea_tag(void *pdoc, Node *UNUSED(child))
2703 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2704 Doc *doc = chtml30->doc;
2707 chtml30->textarea_flag--;
2709 return chtml30->out;
2714 s_chtml30_chxjif_tag(void *pdoc, Node *node)
2721 chtml30 = GET_CHTML30(pdoc);
2725 for (child = qs_get_child_node(doc, node);
2727 child = qs_get_next_node(doc, child)) {
2729 s_chtml30_chxjif_tag(chtml30, child);
2737 s_chtml30_text_tag(void *pdoc, Node *child)
2750 chtml30 = GET_CHTML30(pdoc);
2754 textval = qs_get_node_value(doc,child);
2755 if (strlen(textval) == 0) {
2756 return chtml30->out;
2759 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
2760 memset(tmp, 0, qs_get_node_size(doc,child)+1);
2762 tdst = qs_alloc_zero_byte_string(r);
2763 memset(one_byte, 0, sizeof(one_byte));
2766 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
2768 int rtn = s_chtml30_search_emoji(chtml30, &textval[ii], &out);
2770 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
2775 if (is_sjis_kanji(textval[ii])) {
2776 one_byte[0] = textval[ii+0];
2777 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2778 one_byte[0] = textval[ii+1];
2779 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2782 else if (chtml30->pre_flag) {
2783 one_byte[0] = textval[ii+0];
2784 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2786 else if (chtml30->textarea_flag) {
2787 one_byte[0] = textval[ii+0];
2788 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2790 else if (textval[ii] != '\r' && textval[ii] != '\n') {
2791 one_byte[0] = textval[ii+0];
2792 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2796 return chtml30->out;
2801 * It is a handler who processes the BLOCKQUOTE tag.
2803 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2804 * destination is specified.
2805 * @param node [i] The BLOCKQUOTE tag node is specified.
2806 * @return The conversion result is returned.
2809 s_chtml30_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
2811 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2812 Doc *doc = chtml30->doc;
2813 W_L("<blockquote>");
2814 return chtml30->out;
2819 * It is a handler who processes the BLOCKQUOTE tag.
2821 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2822 * destination is specified.
2823 * @param node [i] The BLOCKQUOTE tag node is specified.
2824 * @return The conversion result is returned.
2827 s_chtml30_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
2829 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2830 Doc *doc = chtml30->doc;
2831 W_L("</blockquote>");
2832 return chtml30->out;
2837 * It is a handler who processes the DIR tag.
2839 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2840 * destination is specified.
2841 * @param node [i] The DIR tag node is specified.
2842 * @return The conversion result is returned.
2845 s_chtml30_start_dir_tag(void *pdoc, Node *UNUSED(child))
2847 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2848 Doc *doc = chtml30->doc;
2850 return chtml30->out;
2855 * It is a handler who processes the DIR tag.
2857 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2858 * destination is specified.
2859 * @param node [i] The DIR tag node is specified.
2860 * @return The conversion result is returned.
2863 s_chtml30_end_dir_tag(void *pdoc, Node *UNUSED(child))
2865 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2866 Doc *doc = chtml30->doc;
2868 return chtml30->out;
2873 * It is a handler who processes the DL tag.
2875 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2876 * destination is specified.
2877 * @param node [i] The DL tag node is specified.
2878 * @return The conversion result is returned.
2881 s_chtml30_start_dl_tag(void *pdoc, Node *UNUSED(child))
2883 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2884 Doc *doc = chtml30->doc;
2886 return chtml30->out;
2891 * It is a handler who processes the DL tag.
2893 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2894 * destination is specified.
2895 * @param node [i] The DL tag node is specified.
2896 * @return The conversion result is returned.
2899 s_chtml30_end_dl_tag(void *pdoc, Node *UNUSED(child))
2901 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2902 Doc *doc = chtml30->doc;
2904 return chtml30->out;
2909 * It is a handler who processes the DT tag.
2911 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2912 * destination is specified.
2913 * @param node [i] The DT tag node is specified.
2914 * @return The conversion result is returned.
2917 s_chtml30_start_dt_tag(void *pdoc, Node *UNUSED(child))
2919 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2920 Doc *doc = chtml30->doc;
2922 return chtml30->out;
2927 * It is a handler who processes the DT tag.
2929 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2930 * destination is specified.
2931 * @param node [i] The DT tag node is specified.
2932 * @return The conversion result is returned.
2935 s_chtml30_end_dt_tag(void *pdoc, Node *UNUSED(child))
2937 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2939 return chtml30->out;
2944 * It is a handler who processes the DD tag.
2946 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2947 * destination is specified.
2948 * @param node [i] The DD tag node is specified.
2949 * @return The conversion result is returned.
2952 s_chtml30_start_dd_tag(void *pdoc, Node *UNUSED(child))
2954 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2955 Doc *doc = chtml30->doc;
2959 return chtml30->out;
2964 * It is a handler who processes the DD tag.
2966 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2967 * destination is specified.
2968 * @param node [i] The DD tag node is specified.
2969 * @return The conversion result is returned.
2972 s_chtml30_end_dd_tag(void *pdoc, Node *UNUSED(child))
2974 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2976 return chtml30->out;
2981 * It is a handler who processes the MARQUEE tag.
2983 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2984 * destination is specified.
2985 * @param node [i] The MARQUEE tag node is specified.
2986 * @return The conversion result is returned.
2989 s_chtml30_start_marquee_tag(void *pdoc, Node *node)
2991 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2992 Doc *doc = chtml30->doc;
2995 /*--------------------------------------------------------------------------*/
2996 /* Get Attributes */
2997 /*--------------------------------------------------------------------------*/
2998 for (attr = qs_get_attr(doc,node);
3000 attr = qs_get_next_attr(doc,attr)) {
3001 char *name = qs_get_attr_name(doc,attr);
3002 char *value = qs_get_attr_value(doc,attr);
3003 if (STRCASEEQ('d','D',"direction", name)) {
3004 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3005 W_L(" direction=\"");
3010 else if (STRCASEEQ('b','B',"behavior",name)) {
3011 if (value && (STRCASEEQ('s','S',"scroll",value) || STRCASEEQ('s','S',"slide",value) || STRCASEEQ('a','A',"alternate",value))) {
3012 W_L(" behavior=\"");
3017 else if (STRCASEEQ('l','L',"loop",name)) {
3018 if (value && *value) {
3026 return chtml30->out;
3031 * It is a handler who processes the MARQUEE tag.
3033 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3034 * destination is specified.
3035 * @param node [i] The MARQUEE tag node is specified.
3036 * @return The conversion result is returned.
3039 s_chtml30_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3041 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3042 Doc *doc = chtml30->doc;
3044 return chtml30->out;
3049 * It is a handler who processes the BLINK tag.
3051 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3052 * destination is specified.
3053 * @param node [i] The BLINK tag node is specified.
3054 * @return The conversion result is returned.
3057 s_chtml30_start_blink_tag(void *pdoc, Node *UNUSED(child))
3059 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3060 Doc *doc = chtml30->doc;
3062 return chtml30->out;
3067 * It is a handler who processes the BLINK tag.
3069 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3070 * destination is specified.
3071 * @param node [i] The BLINK tag node is specified.
3072 * @return The conversion result is returned.
3075 s_chtml30_end_blink_tag(void *pdoc, Node *UNUSED(child))
3077 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3078 Doc *doc = chtml30->doc;
3080 return chtml30->out;
3085 * It is a handler who processes the MENU tag.
3087 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3088 * destination is specified.
3089 * @param node [i] The MENU tag node is specified.
3090 * @return The conversion result is returned.
3093 s_chtml30_start_menu_tag(void *pdoc, Node *UNUSED(child))
3095 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3096 Doc *doc = chtml30->doc;
3098 return chtml30->out;
3103 * It is a handler who processes the MENU tag.
3105 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3106 * destination is specified.
3107 * @param node [i] The MENU tag node is specified.
3108 * @return The conversion result is returned.
3111 s_chtml30_end_menu_tag(void *pdoc, Node *UNUSED(child))
3113 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3114 Doc *doc = chtml30->doc;
3116 return chtml30->out;
3121 * It is a handler who processes the PLAINTEXT tag.
3123 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3124 * destination is specified.
3125 * @param node [i] The PLAINTEXT tag node is specified.
3126 * @return The conversion result is returned.
3129 s_chtml30_start_plaintext_tag(void *pdoc, Node *node)
3131 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3132 Doc *doc = chtml30->doc;
3134 s_chtml30_start_plaintext_tag_inner(pdoc,node);
3135 return chtml30->out;
3139 s_chtml30_start_plaintext_tag_inner(void *pdoc, Node *node)
3141 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3142 Doc *doc = chtml30->doc;
3144 for (child = qs_get_child_node(doc, node);
3146 child = qs_get_next_node(doc, child)) {
3148 s_chtml30_start_plaintext_tag_inner(pdoc, child);
3150 return chtml30->out;
3155 * It is a handler who processes the PLAINTEXT tag.
3157 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3158 * destination is specified.
3159 * @param node [i] The PLAINTEXT tag node is specified.
3160 * @return The conversion result is returned.
3163 s_chtml30_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3165 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3166 return chtml30->out;