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"
25 #include "chxj_header_inf.h"
27 #define GET_CHTML30(X) ((chtml30_t *)(X))
30 #define W_L(X) do { chtml30->out = BUFFERED_WRITE_LITERAL(chtml30->out, &doc->buf, (X)); } while(0)
31 #define W_V(X) do { chtml30->out = (X) ? BUFFERED_WRITE_VALUE(chtml30->out, &doc->buf, (X)) \
32 : BUFFERED_WRITE_LITERAL(chtml30->out, &doc->buf, ""); } while(0)
34 #define W_NLCODE() do { char *nlcode = TO_NLCODE(chtml30->conf); W_V(nlcode); } while (0)
36 static char *s_chtml30_start_html_tag (void *pdoc, Node *node);
37 static char *s_chtml30_end_html_tag (void *pdoc, Node *node);
38 static char *s_chtml30_start_meta_tag (void *pdoc, Node *node);
39 static char *s_chtml30_end_meta_tag (void *pdoc, Node *node);
40 static char *s_chtml30_start_textarea_tag (void *pdoc, Node *node);
41 static char *s_chtml30_end_textarea_tag (void *pdoc, Node *node);
42 static char *s_chtml30_start_p_tag (void *pdoc, Node *node);
43 static char *s_chtml30_end_p_tag (void *pdoc, Node *node);
44 static char *s_chtml30_start_pre_tag (void *pdoc, Node *node);
45 static char *s_chtml30_end_pre_tag (void *pdoc, Node *node);
46 static char *s_chtml30_start_h1_tag (void *pdoc, Node *node);
47 static char *s_chtml30_end_h1_tag (void *pdoc, Node *node);
48 static char *s_chtml30_start_h2_tag (void *pdoc, Node *node);
49 static char *s_chtml30_end_h2_tag (void *pdoc, Node *node);
50 static char *s_chtml30_start_h3_tag (void *pdoc, Node *node);
51 static char *s_chtml30_end_h3_tag (void *pdoc, Node *node);
52 static char *s_chtml30_start_h4_tag (void *pdoc, Node *node);
53 static char *s_chtml30_end_h4_tag (void *pdoc, Node *node);
54 static char *s_chtml30_start_h5_tag (void *pdoc, Node *node);
55 static char *s_chtml30_end_h5_tag (void *pdoc, Node *node);
56 static char *s_chtml30_start_h6_tag (void *pdoc, Node *node);
57 static char *s_chtml30_end_h6_tag (void *pdoc, Node *node);
58 static char *s_chtml30_start_ul_tag (void *pdoc, Node *node);
59 static char *s_chtml30_end_ul_tag (void *pdoc, Node *node);
60 static char *s_chtml30_start_ol_tag (void *pdoc, Node *node);
61 static char *s_chtml30_end_ol_tag (void *pdoc, Node *node);
62 static char *s_chtml30_start_li_tag (void *pdoc, Node *node);
63 static char *s_chtml30_end_li_tag (void *pdoc, Node *node);
64 static char *s_chtml30_start_head_tag (void *pdoc, Node *node);
65 static char *s_chtml30_end_head_tag (void *pdoc, Node *node);
66 static char *s_chtml30_start_title_tag (void *pdoc, Node *node);
67 static char *s_chtml30_end_title_tag (void *pdoc, Node *node);
68 static char *s_chtml30_start_base_tag (void *pdoc, Node *node);
69 static char *s_chtml30_end_base_tag (void *pdoc, Node *node);
70 static char *s_chtml30_start_body_tag (void *pdoc, Node *node);
71 static char *s_chtml30_end_body_tag (void *pdoc, Node *node);
72 static char *s_chtml30_start_a_tag (void *pdoc, Node *node);
73 static char *s_chtml30_end_a_tag (void *pdoc, Node *node);
74 static char *s_chtml30_start_br_tag (void *pdoc, Node *node);
75 static char *s_chtml30_end_br_tag (void *pdoc, Node *node);
76 static char *s_chtml30_start_tr_tag (void *pdoc, Node *node);
77 static char *s_chtml30_end_tr_tag (void *pdoc, Node *node);
78 static char *s_chtml30_start_font_tag (void *pdoc, Node *node);
79 static char *s_chtml30_end_font_tag (void *pdoc, Node *node);
80 static char *s_chtml30_start_form_tag (void *pdoc, Node *node);
81 static char *s_chtml30_end_form_tag (void *pdoc, Node *node);
82 static char *s_chtml30_start_input_tag (void *pdoc, Node *node);
83 static char *s_chtml30_end_input_tag (void *pdoc, Node *node);
84 static char *s_chtml30_start_center_tag (void *pdoc, Node *node);
85 static char *s_chtml30_end_center_tag (void *pdoc, Node *node);
86 static char *s_chtml30_start_hr_tag (void *pdoc, Node *node);
87 static char *s_chtml30_end_hr_tag (void *pdoc, Node *node);
88 static char *s_chtml30_start_img_tag (void *pdoc, Node *node);
89 static char *s_chtml30_end_img_tag (void *pdoc, Node *node);
90 static char *s_chtml30_start_select_tag (void *pdoc, Node *node);
91 static char *s_chtml30_end_select_tag (void *pdoc, Node *node);
92 static char *s_chtml30_start_option_tag (void *pdoc, Node *node);
93 static char *s_chtml30_end_option_tag (void *pdoc, Node *node);
94 static char *s_chtml30_start_div_tag (void *pdoc, Node *node);
95 static char *s_chtml30_end_div_tag (void *pdoc, Node *node);
96 static char *s_chtml30_chxjif_tag (void *pdoc, Node *node);
97 static char *s_chtml30_text_tag (void *pdoc, Node *node);
98 static char *s_chtml30_start_blockquote_tag(void *pdoc, Node *node);
99 static char *s_chtml30_end_blockquote_tag (void *pdoc, Node *node);
100 static char *s_chtml30_start_dir_tag (void *pdoc, Node *node);
101 static char *s_chtml30_end_dir_tag (void *pdoc, Node *node);
102 static char *s_chtml30_start_dl_tag (void *pdoc, Node *node);
103 static char *s_chtml30_end_dl_tag (void *pdoc, Node *node);
104 static char *s_chtml30_start_dt_tag (void *pdoc, Node *node);
105 static char *s_chtml30_end_dt_tag (void *pdoc, Node *node);
106 static char *s_chtml30_start_dd_tag (void *pdoc, Node *node);
107 static char *s_chtml30_end_dd_tag (void *pdoc, Node *node);
108 static char *s_chtml30_start_marquee_tag (void *pdoc, Node *node);
109 static char *s_chtml30_end_marquee_tag (void *pdoc, Node *node);
110 static char *s_chtml30_start_blink_tag (void *pdoc, Node *node);
111 static char *s_chtml30_end_blink_tag (void *pdoc, Node *node);
112 static char *s_chtml30_start_menu_tag (void *pdoc, Node *node);
113 static char *s_chtml30_end_menu_tag (void *pdoc, Node *node);
114 static char *s_chtml30_start_plaintext_tag (void *pdoc, Node *node);
115 static char *s_chtml30_start_plaintext_tag_inner (void *pdoc, Node *node);
116 static char *s_chtml30_end_plaintext_tag (void *pdoc, Node *node);
117 static char *s_chtml30_newline_mark (void *pdoc, Node *node);
119 static void s_init_chtml30(chtml30_t *chtml, Doc *doc, request_rec *r, device_table *spec);
121 static int s_chtml30_search_emoji(chtml30_t *chtml, char *txt, char **rslt);
124 tag_handler chtml30_handler[] = {
127 s_chtml30_start_html_tag,
128 s_chtml30_end_html_tag,
132 s_chtml30_start_meta_tag,
133 s_chtml30_end_meta_tag,
137 s_chtml30_start_textarea_tag,
138 s_chtml30_end_textarea_tag,
142 s_chtml30_start_p_tag,
147 s_chtml30_start_pre_tag,
148 s_chtml30_end_pre_tag,
152 s_chtml30_start_ul_tag,
153 s_chtml30_end_ul_tag,
157 s_chtml30_start_li_tag,
158 s_chtml30_end_li_tag,
162 s_chtml30_start_ol_tag,
163 s_chtml30_end_ol_tag,
167 s_chtml30_start_h1_tag,
168 s_chtml30_end_h1_tag,
172 s_chtml30_start_h2_tag,
173 s_chtml30_end_h2_tag,
177 s_chtml30_start_h3_tag,
178 s_chtml30_end_h3_tag,
182 s_chtml30_start_h4_tag,
183 s_chtml30_end_h4_tag,
187 s_chtml30_start_h5_tag,
188 s_chtml30_end_h5_tag,
192 s_chtml30_start_h6_tag,
193 s_chtml30_end_h6_tag,
197 s_chtml30_start_head_tag,
198 s_chtml30_end_head_tag,
202 s_chtml30_start_title_tag,
203 s_chtml30_end_title_tag,
207 s_chtml30_start_base_tag,
208 s_chtml30_end_base_tag,
212 s_chtml30_start_body_tag,
213 s_chtml30_end_body_tag,
217 s_chtml30_start_a_tag,
222 s_chtml30_start_br_tag,
223 s_chtml30_end_br_tag,
232 s_chtml30_start_tr_tag,
233 s_chtml30_end_tr_tag,
247 s_chtml30_start_font_tag,
248 s_chtml30_end_font_tag,
252 s_chtml30_start_form_tag,
253 s_chtml30_end_form_tag,
257 s_chtml30_start_input_tag,
258 s_chtml30_end_input_tag,
262 s_chtml30_start_center_tag,
263 s_chtml30_end_center_tag,
267 s_chtml30_start_hr_tag,
268 s_chtml30_end_hr_tag,
272 s_chtml30_start_img_tag,
273 s_chtml30_end_img_tag,
277 s_chtml30_start_select_tag,
278 s_chtml30_end_select_tag,
282 s_chtml30_start_option_tag,
283 s_chtml30_end_option_tag,
287 s_chtml30_start_div_tag,
288 s_chtml30_end_div_tag,
292 s_chtml30_chxjif_tag,
337 s_chtml30_start_dt_tag,
338 s_chtml30_end_dt_tag,
352 s_chtml30_start_blockquote_tag,
353 s_chtml30_end_blockquote_tag,
357 s_chtml30_start_dir_tag,
358 s_chtml30_end_dir_tag,
362 s_chtml30_start_dl_tag,
363 s_chtml30_end_dl_tag,
367 s_chtml30_start_dd_tag,
368 s_chtml30_end_dd_tag,
372 s_chtml30_start_menu_tag,
373 s_chtml30_end_menu_tag,
377 s_chtml30_start_plaintext_tag,
378 s_chtml30_end_plaintext_tag,
382 s_chtml30_start_blink_tag,
383 s_chtml30_end_blink_tag,
387 s_chtml30_start_marquee_tag,
388 s_chtml30_end_marquee_tag,
392 s_chtml30_newline_mark,
399 * converts from CHTML5.0 to CHTML3.0.
401 * @param r [i] Requet_rec is appointed.
402 * @param spec [i] The result of the device specification processing which
403 * was done in advance is appointed.
404 * @param src [i] The character string before the converting is appointed.
405 * @return The character string after the converting is returned.
408 chxj_convert_chtml30(
414 chxjconvrule_entry *entryp,
423 DBG(r, "start chxj_convert_chtml30()");
425 /*--------------------------------------------------------------------------*/
427 /*--------------------------------------------------------------------------*/
429 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
431 DBG(r,"i found qrcode xml");
432 DBG(r, "end chxj_convert_chtml30()");
435 DBG(r,"not found qrcode xml");
437 /*--------------------------------------------------------------------------*/
438 /* The CHTML structure is initialized. */
439 /*--------------------------------------------------------------------------*/
440 s_init_chtml30(&chtml30, &doc, r, spec);
442 chtml30.entryp = entryp;
443 chtml30.cookie = cookie;
445 chxj_set_content_type(r, chxj_header_inf_set_content_type(r, "text/html; charset=Windows-31J"));
447 /*--------------------------------------------------------------------------*/
448 /* The character string of the input is analyzed. */
449 /*--------------------------------------------------------------------------*/
450 qs_init_malloc(&doc);
451 qs_init_root_node(&doc);
453 ss = apr_pcalloc(r->pool, srclen + 1);
454 memset(ss, 0, srclen + 1);
455 memcpy(ss, src, srclen);
458 chxj_dump_out("[src] CHTML -> CHTML3.0", ss, srclen);
460 chxj_buffered_write_init(r->pool, &doc.buf);
462 qs_parse_string(&doc,ss, strlen(ss));
464 /*--------------------------------------------------------------------------*/
465 /* It converts it from CHTML to CHTML. */
466 /*--------------------------------------------------------------------------*/
467 chxj_node_convert(spec,r,(void*)&chtml30, &doc, qs_get_root(&doc), 0);
468 chtml30.out = chxj_buffered_write_flush(chtml30.out, &doc.buf);
469 dst = apr_pstrdup(r->pool, chtml30.out);
470 chxj_buffered_write_terminate(&doc.buf);
472 qs_all_free(&doc,QX_LOGMARK);
475 dst = apr_pstrdup(r->pool,ss);
477 if (strlen(dst) == 0) {
478 dst = apr_psprintf(r->pool, "\n");
481 *dstlen = strlen(dst);
484 chxj_dump_out("[src] CHTML -> CHTML3.0", dst, *dstlen);
487 DBG(r, "end chxj_convert_chtml30()");
493 * The CHTML structure is initialized.
495 * @param chtml30 [i/o] The pointer to the HDML structure that wants to be
496 * initialized is specified.
497 * @param doc [i] The Doc structure that should be set to the initialized
498 * HDML structure is specified.
499 * @param r [i] To use POOL, the pointer to request_rec is specified.
500 * @param spec [i] The pointer to the device_table
503 s_init_chtml30(chtml30_t *chtml30, Doc *doc, request_rec *r, device_table *spec)
505 memset(doc, 0, sizeof(Doc));
506 memset(chtml30, 0, sizeof(chtml30_t));
510 chtml30->spec = spec;
511 chtml30->out = qs_alloc_zero_byte_string(r->pool);
512 chtml30->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
513 chtml30->doc->parse_mode = PARSE_MODE_CHTML;
518 * Corresponding EMOJI to a current character-code is retrieved.
519 * The substitution character string is stored in the rslt pointer if agreeing.
521 * @param chtml30 [i] The pointer to the CHTML structure is specified.
522 * @param txt [i] The character string to want to examine whether it is
523 * EMOJI is specified.
524 * @param rslt [o] The pointer to the pointer that stores the result is
526 * @return When corresponding EMOJI exists, it returns it excluding 0.
529 s_chtml30_search_emoji(chtml30_t *chtml30, char *txt, char **rslt)
536 spec = chtml30->spec;
542 DBG(r,"spec is NULL");
545 for (ee = chtml30->conf->emoji;
548 if (ee->imode == NULL) {
549 DBG(r, "emoji->imode is NULL");
553 if (ee->imode->string != NULL
554 && strlen(ee->imode->string) > 0
555 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
557 if (spec == NULL || spec->emoji_type == NULL) {
558 *rslt = apr_palloc(r->pool, 3);
559 (*rslt)[0] = ee->imode->hex1byte & 0xff;
560 (*rslt)[1] = ee->imode->hex2byte & 0xff;
562 return strlen(ee->imode->string);
574 * It is a handler who processes the HTML tag.
576 * @param pdoc [i/o] The pointer to the CHTML structure at the output
577 * destination is specified.
578 * @param node [i] The HTML tag node is specified.
579 * @return The conversion result is returned.
582 s_chtml30_start_html_tag(void *pdoc, Node *UNUSED(node))
584 chtml30_t *chtml30 = GET_CHTML30(pdoc);
585 Doc *doc = chtml30->doc;
587 /*--------------------------------------------------------------------------*/
589 /*--------------------------------------------------------------------------*/
597 * It is a handler who processes the HTML tag.
599 * @param pdoc [i/o] The pointer to the CHTML structure at the output
600 * destination is specified.
601 * @param node [i] The HTML tag node is specified.
602 * @return The conversion result is returned.
605 s_chtml30_end_html_tag(void *pdoc, Node *UNUSED(child))
607 chtml30_t *chtml30 = GET_CHTML30(pdoc);
608 Doc *doc = chtml30->doc;
617 * It is a handler who processes the META tag.
619 * @param pdoc [i/o] The pointer to the CHTML structure at the output
620 * destination is specified.
621 * @param node [i] The META tag node is specified.
622 * @return The conversion result is returned.
625 s_chtml30_start_meta_tag(void *pdoc, Node *node)
631 int content_type_flag;
634 chtml30 = GET_CHTML30(pdoc);
638 content_type_flag = 0;
642 /*--------------------------------------------------------------------------*/
644 /*--------------------------------------------------------------------------*/
645 for (attr = qs_get_attr(doc,node);
647 attr = qs_get_next_attr(doc,attr)) {
648 char *name = qs_get_attr_name(doc,attr);
649 char *value = qs_get_attr_value(doc,attr);
653 if (strcasecmp(name, "http-equiv") == 0 && value && *value) {
654 /*----------------------------------------------------------------------*/
656 /*----------------------------------------------------------------------*/
657 W_L(" http-equiv=\"");
660 if (STRCASEEQ('c','C',"content-type", value))
661 content_type_flag = 1;
663 if (STRCASEEQ('r','R',"refresh", value))
670 if (strcasecmp(name, "content") == 0 && value && *value) {
671 if (content_type_flag) {
675 W_V(chxj_header_inf_set_content_type(r, "text/html; charset=SHIFT_JIS"));
683 buf = apr_pstrdup(r->pool, value);
684 url = strchr(buf, ';');
686 sec = apr_pstrdup(r->pool, buf);
689 url = chxj_encoding_parameter(r, url);
690 url = chxj_add_cookie_parameter(r, url, chtml30->cookie);
720 * It is a handler who processes the META tag.
722 * @param pdoc [i/o] The pointer to the CHTML structure at the output
723 * destination is specified.
724 * @param node [i] The META tag node is specified.
725 * @return The conversion result is returned.
728 s_chtml30_end_meta_tag(void* pdoc, Node* UNUSED(child))
730 chtml30_t *chtml30 = GET_CHTML30(pdoc);
737 * It is a handler who processes the HEAD tag.
739 * @param pdoc [i/o] The pointer to the CHTML structure at the output
740 * destination is specified.
741 * @param node [i] The HEAD tag node is specified.
742 * @return The conversion result is returned.
745 s_chtml30_start_head_tag(void* pdoc, Node* UNUSED(node))
747 chtml30_t *chtml30 = GET_CHTML30(pdoc);
748 Doc *doc = chtml30->doc;
757 * It is a handler who processes the HEAD tag.
759 * @param pdoc [i/o] The pointer to the CHTML structure at the output
760 * destination is specified.
761 * @param node [i] The HEAD tag node is specified.
762 * @return The conversion result is returned.
765 s_chtml30_end_head_tag(void *pdoc, Node *UNUSED(node))
767 chtml30_t *chtml30 = GET_CHTML30(pdoc);
768 Doc *doc = chtml30->doc;
777 * It is a handler who processes the TITLE tag.
779 * @param pdoc [i/o] The pointer to the CHTML structure at the output
780 * destination is specified.
781 * @param node [i] The TITLE tag node is specified.
782 * @return The conversion result is returned.
785 s_chtml30_start_title_tag(void *pdoc, Node *UNUSED(node))
787 chtml30_t *chtml30 = GET_CHTML30(pdoc);
788 Doc *doc = chtml30->doc;
797 * It is a handler who processes the TITLE tag.
799 * @param pdoc [i/o] The pointer to the CHTML structure at the output
800 * destination is specified.
801 * @param node [i] The TITLE tag node is specified.
802 * @return The conversion result is returned.
805 s_chtml30_end_title_tag(void *pdoc, Node *UNUSED(child))
807 chtml30_t *chtml30 = GET_CHTML30(pdoc);
808 Doc *doc = chtml30->doc;
817 * It is a handler who processes the BASE tag.
819 * @param pdoc [i/o] The pointer to the CHTML structure at the output
820 * destination is specified.
821 * @param node [i] The BASE tag node is specified.
822 * @return The conversion result is returned.
825 s_chtml30_start_base_tag(void *pdoc, Node *node)
832 chtml30 = GET_CHTML30(pdoc);
837 /*--------------------------------------------------------------------------*/
839 /*--------------------------------------------------------------------------*/
840 for (attr = qs_get_attr(doc,node);
842 attr = qs_get_next_attr(doc,attr)) {
843 char *name = qs_get_attr_name(doc,attr);
844 char *value = qs_get_attr_value(doc,attr);
845 if (STRCASEEQ('h','H',"href", name)) {
857 * It is a handler who processes the BASE tag.
859 * @param pdoc [i/o] The pointer to the CHTML structure at the output
860 * destination is specified.
861 * @param node [i] The BASE tag node is specified.
862 * @return The conversion result is returned.
865 s_chtml30_end_base_tag(void *pdoc, Node *UNUSED(child))
867 chtml30_t *chtml30 = GET_CHTML30(pdoc);
874 * It is a handler who processes the BODY tag.
876 * @param pdoc [i/o] The pointer to the CHTML structure at the output
877 * destination is specified.
878 * @param node [i] The BODY tag node is specified.
879 * @return The conversion result is returned.
882 s_chtml30_start_body_tag(void *pdoc, Node *node)
889 chtml30 = GET_CHTML30(pdoc);
894 /*--------------------------------------------------------------------------*/
896 /*--------------------------------------------------------------------------*/
897 for (attr = qs_get_attr(doc,node);
899 attr = qs_get_next_attr(doc,attr)) {
900 char *name = qs_get_attr_name(doc,attr);
901 char *value = qs_get_attr_value(doc,attr);
902 if (STRCASEEQ('b','B', "bgcolor", name) && value && *value) {
903 /*----------------------------------------------------------------------*/
905 /*----------------------------------------------------------------------*/
910 else if (STRCASEEQ('t','T', "text", name) && value && *value) {
911 /*----------------------------------------------------------------------*/
913 /*----------------------------------------------------------------------*/
918 else if (STRCASEEQ('l','L',"link", name) && value && *value) {
919 /*----------------------------------------------------------------------*/
921 /*----------------------------------------------------------------------*/
926 else if (STRCASEEQ('a','A',"alink", name)) {
927 /*----------------------------------------------------------------------*/
929 /*----------------------------------------------------------------------*/
932 else if (STRCASEEQ('v','V',"vlink", name)) {
933 /*----------------------------------------------------------------------*/
935 /*----------------------------------------------------------------------*/
945 * It is a handler who processes the BODY tag.
947 * @param pdoc [i/o] The pointer to the CHTML structure at the output
948 * destination is specified.
949 * @param node [i] The BODY tag node is specified.
950 * @return The conversion result is returned.
953 s_chtml30_end_body_tag(void *pdoc, Node *UNUSED(child))
958 chtml30 = GET_CHTML30(pdoc);
968 * It is a handler who processes the A tag.
970 * @param pdoc [i/o] The pointer to the CHTML structure at the output
971 * destination is specified.
972 * @param node [i] The A tag node is specified.
973 * @return The conversion result is returned.
976 s_chtml30_start_a_tag(void *pdoc, Node *node)
983 chtml30 = GET_CHTML30(pdoc);
988 /*--------------------------------------------------------------------------*/
990 /*--------------------------------------------------------------------------*/
991 for (attr = qs_get_attr(doc,node);
993 attr = qs_get_next_attr(doc,attr)) {
994 char *name = qs_get_attr_name(doc,attr);
995 char *value = qs_get_attr_value(doc,attr);
996 if (STRCASEEQ('n','N',"name", name)) {
997 /*----------------------------------------------------------------------*/
999 /*----------------------------------------------------------------------*/
1004 else if (STRCASEEQ('h','H',"href", name)) {
1005 /*----------------------------------------------------------------------*/
1007 /*----------------------------------------------------------------------*/
1008 value = chxj_encoding_parameter(r, value);
1009 if (! chxj_starts_with(value, "mailto:") && ! chxj_starts_with(value, "telto:")) {
1010 value = chxj_add_cookie_parameter(r, value, chtml30->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 chtml30->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_chtml30_end_a_tag(void *pdoc, Node *UNUSED(child))
1107 chtml30 = GET_CHTML30(pdoc);
1112 return chtml30->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_chtml30_start_br_tag(void *pdoc, Node *node)
1132 chtml30 = GET_CHTML30(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))) {
1153 return chtml30->out;
1158 * It is a handler who processes the BR tag.
1160 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1161 * destination is specified.
1162 * @param node [i] The BR tag node is specified.
1163 * @return The conversion result is returned.
1166 s_chtml30_end_br_tag(void *pdoc, Node *UNUSED(child))
1168 chtml30_t *chtml30 = GET_CHTML30(pdoc);
1170 return chtml30->out;
1175 * It is a handler who processes the TR tag.
1177 * @param chtml30 [i/o] The pointer to the CHTML structure at the output
1178 * destination is specified.
1179 * @param node [i] The TR tag node is specified.
1180 * @return The conversion result is returned.
1183 s_chtml30_start_tr_tag(void *pdoc, Node *UNUSED(node))
1185 chtml30_t *chtml30 = GET_CHTML30(pdoc);
1187 return chtml30->out;
1192 * It is a handler who processes the TR tag.
1194 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1195 * destination is specified.
1196 * @param node [i] The TR tag node is specified.
1197 * @return The conversion result is returned.
1200 s_chtml30_end_tr_tag(void *pdoc, Node *UNUSED(child))
1206 chtml30 = GET_CHTML30(pdoc);
1212 return chtml30->out;
1217 * It is a handler who processes the FONT tag.
1219 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1220 * destination is specified.
1221 * @param node [i] The FONT tag node is specified.
1222 * @return The conversion result is returned.
1225 s_chtml30_start_font_tag(void *pdoc, Node *node)
1233 chtml30 = GET_CHTML30(pdoc);
1237 /*--------------------------------------------------------------------------*/
1238 /* Get Attributes */
1239 /*--------------------------------------------------------------------------*/
1240 for (attr = qs_get_attr(doc,node);
1241 attr && color == NULL;
1242 attr = qs_get_next_attr(doc,attr)) {
1243 char *name = qs_get_attr_name(doc,attr);
1244 char *value = qs_get_attr_value(doc,attr);
1245 if (STRCASEEQ('c','C',"color", name) && value && *value) {
1246 color = apr_pstrdup(doc->buf.pool, value);
1249 else if (STRCASEEQ('s','S',"size", name)) {
1250 /*----------------------------------------------------------------------*/
1252 /*----------------------------------------------------------------------*/
1257 W_L("<font color=\"");
1260 chtml30->font_flag++;
1262 return chtml30->out;
1267 * It is a handler who processes the FONT tag.
1269 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1270 * destination is specified.
1271 * @param node [i] The FONT tag node is specified.
1272 * @return The conversion result is returned.
1275 s_chtml30_end_font_tag(void *pdoc, Node *UNUSED(child))
1281 chtml30 = GET_CHTML30(pdoc);
1285 if (chtml30->font_flag) {
1287 chtml30->font_flag--;
1290 return chtml30->out;
1295 * It is a handler who processes the FORM tag.
1297 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1298 * destination is specified.
1299 * @param node [i] The FORM tag node is specified.
1300 * @return The conversion result is returned.
1303 s_chtml30_start_form_tag(void *pdoc, Node *node)
1309 char *new_hidden_tag = NULL;
1310 char *attr_method = NULL;
1311 char *attr_action = NULL;
1312 char *attr_utn = NULL;
1314 chtml30 = GET_CHTML30(pdoc);
1318 /*--------------------------------------------------------------------------*/
1319 /* Get Attributes */
1320 /*--------------------------------------------------------------------------*/
1321 for (attr = qs_get_attr(doc,node);
1323 attr = qs_get_next_attr(doc,attr)) {
1324 char *name = qs_get_attr_name(doc,attr);
1325 char *value = qs_get_attr_value(doc,attr);
1326 if (STRCASEEQ('a','A',"action", name)) {
1327 /*----------------------------------------------------------------------*/
1329 /*----------------------------------------------------------------------*/
1330 attr_action = chxj_encoding_parameter(r, value);
1331 attr_action = chxj_add_cookie_parameter(r, attr_action, chtml30->cookie);
1333 else if (STRCASEEQ('m','M',"method", name)) {
1334 /*----------------------------------------------------------------------*/
1336 /*----------------------------------------------------------------------*/
1337 attr_method = apr_pstrdup(doc->pool, value);
1339 else if (STRCASEEQ('u','U',"utn", name)) {
1340 /*----------------------------------------------------------------------*/
1342 /* It is special only for CHTML. */
1343 /*----------------------------------------------------------------------*/
1348 int post_flag = (attr_method && strcasecmp(attr_method, "post") == 0) ? 1 : 0;
1353 char *new_query_string = NULL;
1354 q = strchr(attr_action, '?');
1356 new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 0, post_flag, &new_query_string, CHXJ_TRUE);
1357 if (new_hidden_tag) {
1363 if (new_query_string) {
1365 W_V(new_query_string);
1378 if (new_hidden_tag) {
1379 W_V(new_hidden_tag);
1381 return chtml30->out;
1386 * It is a handler who processes the FORM tag.
1388 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1389 * destination is specified.
1390 * @param node [i] The FORM tag node is specified.
1391 * @return The conversion result is returned.
1394 s_chtml30_end_form_tag(void *pdoc, Node *UNUSED(child))
1399 chtml30 = GET_CHTML30(pdoc);
1404 return chtml30->out;
1409 * It is a handler who processes the INPUT tag.
1411 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1412 * destination is specified.
1413 * @param node [i] The INPUT tag node is specified.
1414 * @return The conversion result is returned.
1417 s_chtml30_start_input_tag(void *pdoc, Node *node)
1422 char *max_length = NULL;
1426 char *istyle = NULL;
1428 char *checked = NULL;
1429 char *accesskey = NULL;
1431 chtml30 = GET_CHTML30(pdoc);
1435 /*--------------------------------------------------------------------------*/
1436 /* Get Attributes */
1437 /*--------------------------------------------------------------------------*/
1438 type = qs_get_type_attr(doc, node, doc->buf.pool);
1439 name = qs_get_name_attr(doc, node, doc->buf.pool);
1440 value = qs_get_value_attr(doc,node,doc->buf.pool);
1441 istyle = qs_get_istyle_attr(doc,node,doc->buf.pool);
1442 max_length = qs_get_maxlength_attr(doc,node,doc->buf.pool);
1443 checked = qs_get_checked_attr(doc,node,doc->buf.pool);
1444 accesskey = qs_get_accesskey_attr(doc, node, doc->buf.pool);
1445 size = qs_get_size_attr(doc, node, doc->buf.pool);
1448 type = qs_trim_string(doc->buf.pool, type);
1449 if (type && (STRCASEEQ('t','T',"text", type) ||
1450 STRCASEEQ('p','P',"password",type) ||
1451 STRCASEEQ('c','C',"checkbox",type) ||
1452 STRCASEEQ('r','R',"radio", type) ||
1453 STRCASEEQ('h','H',"hidden", type) ||
1454 STRCASEEQ('s','S',"submit", type) ||
1455 STRCASEEQ('r','R',"reset", type))) {
1461 if (size && *size) {
1466 if (name && *name) {
1471 if (value && *value) {
1473 W_V(chxj_add_slash_to_doublequote(doc->pool, value));
1476 if (accesskey && *accesskey) {
1477 W_L(" accesskey=\"");
1482 /*------------------------------------------------------------------------*/
1484 /*------------------------------------------------------------------------*/
1485 if (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4') {
1492 /*--------------------------------------------------------------------------*/
1493 /* The figure is default for the password. */
1494 /*--------------------------------------------------------------------------*/
1495 if (max_length && *max_length) {
1496 if (chxj_chk_numeric(max_length) != 0) {
1497 max_length = apr_psprintf(r->pool, "0");
1499 if (istyle != NULL && *istyle == '1') {
1500 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length) * 2);
1504 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length));
1512 return chtml30->out;
1517 * It is a handler who processes the INPUT tag.
1519 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1520 * destination is specified.
1521 * @param node [i] The INPUT tag node is specified.
1522 * @return The conversion result is returned.
1525 s_chtml30_end_input_tag(void *pdoc, Node *UNUSED(child))
1527 chtml30_t *chtml30 = GET_CHTML30(pdoc);
1529 return chtml30->out;
1534 * It is a handler who processes the CENTER tag.
1536 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1537 * destination is specified.
1538 * @param node [i] The CENTER tag node is specified.
1539 * @return The conversion result is returned.
1542 s_chtml30_start_center_tag(void *pdoc, Node *UNUSED(node))
1547 chtml30 = GET_CHTML30(pdoc);
1552 return chtml30->out;
1557 * It is a handler who processes the CENTER tag.
1559 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1560 * destination is specified.
1561 * @param node [i] The CENTER tag node is specified.
1562 * @return The conversion result is returned.
1565 s_chtml30_end_center_tag(void *pdoc, Node *UNUSED(child))
1570 chtml30 = GET_CHTML30(pdoc);
1575 return chtml30->out;
1580 * It is a handler who processes the HR tag.
1582 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1583 * destination is specified.
1584 * @param node [i] The HR tag node is specified.
1585 * @return The conversion result is returned.
1588 s_chtml30_start_hr_tag(void *pdoc, Node *node)
1595 chtml30 = GET_CHTML30(pdoc);
1601 for (attr = qs_get_attr(doc,node);
1603 attr = qs_get_next_attr(doc,attr)) {
1604 char *name = qs_get_attr_name(doc,attr);
1605 char *value = qs_get_attr_value(doc,attr);
1606 if (STRCASEEQ('a','A',"align", name)) {
1607 /*----------------------------------------------------------------------*/
1609 /*----------------------------------------------------------------------*/
1610 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1616 else if (STRCASEEQ('s','S',"size", name)) {
1617 /*----------------------------------------------------------------------*/
1619 /*----------------------------------------------------------------------*/
1620 if (value && *value) {
1626 else if (STRCASEEQ('w','W',"width", name)) {
1627 /*----------------------------------------------------------------------*/
1629 /*----------------------------------------------------------------------*/
1630 if (value && *value) {
1636 else if (STRCASEEQ('n','N',"noshade", name)) {
1637 /*----------------------------------------------------------------------*/
1639 /*----------------------------------------------------------------------*/
1642 else if (STRCASEEQ('c','C',"color", name)) {
1643 /*----------------------------------------------------------------------*/
1645 /*----------------------------------------------------------------------*/
1651 return chtml30->out;
1656 * It is a handler who processes the HR tag.
1658 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1659 * destination is specified.
1660 * @param node [i] The HR tag node is specified.
1661 * @return The conversion result is returned.
1664 s_chtml30_end_hr_tag(void *pdoc, Node *UNUSED(child))
1666 chtml30_t *chtml30 = GET_CHTML30(pdoc);
1668 return chtml30->out;
1673 * It is a handler who processes the IMG tag.
1675 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1676 * destination is specified.
1677 * @param node [i] The IMG tag node is specified.
1678 * @return The conversion result is returned.
1681 s_chtml30_start_img_tag(void *pdoc, Node *node)
1683 #ifndef IMG_NOT_CONVERT_FILENAME
1691 chtml30 = GET_CHTML30(pdoc);
1694 #ifndef IMG_NOT_CONVERT_FILENAME
1695 spec = chtml30->spec;
1699 /*--------------------------------------------------------------------------*/
1700 /* Get Attributes */
1701 /*--------------------------------------------------------------------------*/
1702 for (attr = qs_get_attr(doc,node);
1704 attr = qs_get_next_attr(doc,attr)) {
1705 char *name = qs_get_attr_name(doc,attr);
1706 char *value = qs_get_attr_value(doc,attr);
1707 if (STRCASEEQ('s','S',"src", name)) {
1708 /*----------------------------------------------------------------------*/
1710 /*----------------------------------------------------------------------*/
1711 #ifdef IMG_NOT_CONVERT_FILENAME
1712 value = chxj_encoding_parameter(r, value);
1713 value = chxj_add_cookie_parameter(r, value, chtml30->cookie);
1714 value = chxj_add_cookie_no_update_parameter(r, value);
1719 value = chxj_img_conv(r,spec,value);
1720 value = chxj_encoding_parameter(r, value);
1721 value = chxj_add_cookie_parameter(r, value, chtml30->cookie);
1722 value = chxj_add_cookie_no_update_parameter(r, value);
1728 else if (STRCASEEQ('a','A',"align", name)) {
1729 /*----------------------------------------------------------------------*/
1731 /*----------------------------------------------------------------------*/
1733 if (STRCASEEQ('t','T',"top", value) ||
1734 STRCASEEQ('m','M',"middle",value) ||
1735 STRCASEEQ('b','B',"bottom",value) ||
1736 STRCASEEQ('l','L',"left", value) ||
1737 STRCASEEQ('r','R',"right", value)) {
1742 else if (STRCASEEQ('c','C',"center", value)) {
1749 else if (STRCASEEQ('w','W',"width", name) && value && *value) {
1750 /*----------------------------------------------------------------------*/
1752 /*----------------------------------------------------------------------*/
1757 else if (STRCASEEQ('h','H', "height", name) && value && *value) {
1758 /*----------------------------------------------------------------------*/
1760 /*----------------------------------------------------------------------*/
1765 else if (STRCASEEQ('h','H',"hspace", name) && value && *value) {
1766 /*----------------------------------------------------------------------*/
1768 /*----------------------------------------------------------------------*/
1773 else if (STRCASEEQ('v','V',"vspace", name) && value && *value) {
1774 /*----------------------------------------------------------------------*/
1776 /*----------------------------------------------------------------------*/
1781 else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
1782 /*----------------------------------------------------------------------*/
1784 /*----------------------------------------------------------------------*/
1789 else if (STRCASEEQ('a','A',"align", name) && value && *value) {
1790 /*----------------------------------------------------------------------*/
1792 /*----------------------------------------------------------------------*/
1798 return chtml30->out;
1803 * It is a handler who processes the IMG tag.
1805 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1806 * destination is specified.
1807 * @param node [i] The IMG tag node is specified.
1808 * @return The conversion result is returned.
1811 s_chtml30_end_img_tag(void *pdoc, Node *UNUSED(child))
1813 chtml30_t *chtml30 = GET_CHTML30(pdoc);
1815 return chtml30->out;
1820 * It is a handler who processes the SELECT tag.
1822 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1823 * destination is specified.
1824 * @param node [i] The SELECT tag node is specified.
1825 * @return The conversion result is returned.
1828 s_chtml30_start_select_tag(void *pdoc, Node *child)
1830 chtml30_t *chtml30 = GET_CHTML30(pdoc);
1831 Doc *doc = chtml30->doc;
1834 char *multiple = NULL;
1838 for (attr = qs_get_attr(doc,child);
1840 attr = qs_get_next_attr(doc,attr)) {
1841 char *nm = qs_get_attr_name(doc,attr);
1842 char *val = qs_get_attr_value(doc,attr);
1843 if (STRCASEEQ('s','S',"size", nm)) {
1844 /*----------------------------------------------------------------------*/
1845 /* CHTML 1.0 version 2.0 */
1846 /*----------------------------------------------------------------------*/
1847 size = apr_pstrdup(doc->buf.pool, val);
1849 else if (STRCASEEQ('n','N',"name", nm)) {
1850 /*----------------------------------------------------------------------*/
1851 /* CHTML 1.0 version 2.0 */
1852 /*----------------------------------------------------------------------*/
1853 name = apr_pstrdup(doc->buf.pool, val);
1855 else if (STRCASEEQ('m','M',"multiple", nm)) {
1856 /*----------------------------------------------------------------------*/
1857 /* CHTML 1.0 version 2.0 */
1858 /*----------------------------------------------------------------------*/
1859 multiple = apr_pstrdup(doc->buf.pool, val);
1862 if (size && *size) {
1867 if (name && *name) {
1876 return chtml30->out;
1881 * It is a handler who processes the SELECT tag.
1883 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1884 * destination is specified.
1885 * @param node [i] The SELECT tag node is specified.
1886 * @return The conversion result is returned.
1889 s_chtml30_end_select_tag(void *pdoc, Node *UNUSED(child))
1891 chtml30_t *chtml30 = GET_CHTML30(pdoc);
1892 Doc *doc = chtml30->doc;
1895 return chtml30->out;
1900 * It is a handler who processes the OPTION tag.
1902 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1903 * destination is specified.
1904 * @param node [i] The OPTION tag node is specified.
1905 * @return The conversion result is returned.
1908 s_chtml30_start_option_tag(void *pdoc, Node *child)
1917 chtml30 = GET_CHTML30(pdoc);
1924 for (attr = qs_get_attr(doc,child);
1926 attr = qs_get_next_attr(doc,attr)) {
1927 char *nm = qs_get_attr_name(doc,attr);
1928 char *val = qs_get_attr_value(doc,attr);
1929 if (STRCASEEQ('s','S',"selected", nm)) {
1930 /*----------------------------------------------------------------------*/
1931 /* CHTML 1.0 version 2.0 */
1932 /*----------------------------------------------------------------------*/
1933 selected = apr_pstrdup(doc->buf.pool, val);
1935 else if (STRCASEEQ('v','V',"value", nm)) {
1936 /*----------------------------------------------------------------------*/
1937 /* CHTML 1.0 version 2.0 */
1938 /*----------------------------------------------------------------------*/
1939 value = apr_pstrdup(doc->buf.pool, val);
1942 if (value && *value) {
1951 return chtml30->out;
1956 * It is a handler who processes the OPTION tag.
1958 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1959 * destination is specified.
1960 * @param node [i] The OPTION tag node is specified.
1961 * @return The conversion result is returned.
1964 s_chtml30_end_option_tag(void *pdoc, Node *UNUSED(child))
1966 chtml30_t *chtml30 = GET_CHTML30(pdoc);
1970 return chtml30->out;
1975 * It is a handler who processes the DIV tag.
1977 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1978 * destination is specified.
1979 * @param node [i] The DIV tag node is specified.
1980 * @return The conversion result is returned.
1983 s_chtml30_start_div_tag(void *pdoc, Node *child)
1991 chtml30 = GET_CHTML30(pdoc);
1997 for (attr = qs_get_attr(doc,child);
1999 attr = qs_get_next_attr(doc,attr)) {
2000 char *nm = qs_get_attr_name(doc,attr);
2001 char *val = qs_get_attr_value(doc,attr);
2002 if (STRCASEEQ('a','A',"align", nm)) {
2003 /*----------------------------------------------------------------------*/
2004 /* CHTML 1.0 (W3C version 3.2) */
2005 /*----------------------------------------------------------------------*/
2006 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2007 align = apr_pstrdup(doc->buf.pool, val);
2017 return chtml30->out;
2022 * It is a handler who processes the DIV tag.
2024 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2025 * destination is specified.
2026 * @param node [i] The DIV tag node is specified.
2027 * @return The conversion result is returned.
2030 s_chtml30_end_div_tag(void *pdoc, Node *UNUSED(node))
2032 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2033 Doc *doc = chtml30->doc;
2037 return chtml30->out;
2042 * It is a handler who processes the UL tag.
2044 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2045 * destination is specified.
2046 * @param node [i] The UL tag node is specified.
2047 * @return The conversion result is returned.
2050 s_chtml30_start_ul_tag(void *pdoc, Node *UNUSED(node))
2052 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2053 Doc *doc = chtml30->doc;
2057 return chtml30->out;
2062 * It is a handler who processes the UL tag.
2064 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2065 * destination is specified.
2066 * @param node [i] The UL tag node is specified.
2067 * @return The conversion result is returned.
2070 s_chtml30_end_ul_tag(void *pdoc, Node *UNUSED(child))
2072 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2073 Doc *doc = chtml30->doc;
2077 return chtml30->out;
2082 * It is a handler who processes the PRE tag.
2084 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2085 * destination is specified.
2086 * @param node [i] The PRE tag node is specified.
2087 * @return The conversion result is returned.
2090 s_chtml30_start_pre_tag(void *pdoc, Node *UNUSED(node))
2092 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2093 Doc *doc = chtml30->doc;
2095 chtml30->pre_flag++;
2098 return chtml30->out;
2103 * It is a handler who processes the PRE tag.
2105 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2106 * destination is specified.
2107 * @param node [i] The PRE tag node is specified.
2108 * @return The conversion result is returned.
2111 s_chtml30_end_pre_tag(void *pdoc, Node *UNUSED(child))
2113 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2114 Doc *doc = chtml30->doc;
2117 chtml30->pre_flag--;
2119 return chtml30->out;
2124 * It is a handler who processes the P tag.
2126 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2127 * destination is specified.
2128 * @param node [i] The P tag node is specified.
2129 * @return The conversion result is returned.
2132 s_chtml30_start_p_tag(void *pdoc, Node *node)
2140 chtml30 = GET_CHTML30(pdoc);
2145 for (attr = qs_get_attr(doc,node);
2147 attr = qs_get_next_attr(doc,attr)) {
2148 char *nm = qs_get_attr_name(doc,attr);
2149 char *val = qs_get_attr_value(doc,attr);
2150 if (STRCASEEQ('a','A',"align", nm)) {
2151 /*----------------------------------------------------------------------*/
2152 /* CHTML 1.0 (W3C version 3.2) */
2153 /*----------------------------------------------------------------------*/
2154 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2155 align = apr_pstrdup(doc->buf.pool, val);
2166 return chtml30->out;
2171 * It is a handler who processes the P tag.
2173 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2174 * destination is specified.
2175 * @param node [i] The P tag node is specified.
2176 * @return The conversion result is returned.
2179 s_chtml30_end_p_tag(void *pdoc, Node *UNUSED(child))
2184 chtml30 = GET_CHTML30(pdoc);
2189 return chtml30->out;
2194 * It is a handler who processes the OL tag.
2196 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2197 * destination is specified.
2198 * @param node [i] The OL tag node is specified.
2199 * @return The conversion result is returned.
2202 s_chtml30_start_ol_tag(void *pdoc, Node *node)
2209 chtml30 = GET_CHTML30(pdoc);
2214 /*--------------------------------------------------------------------------*/
2215 /* Get Attributes */
2216 /*--------------------------------------------------------------------------*/
2217 for (attr = qs_get_attr(doc,node);
2219 attr = qs_get_next_attr(doc,attr)) {
2220 char *name = qs_get_attr_name(doc,attr);
2221 char *value = qs_get_attr_value(doc,attr);
2222 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
2227 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
2235 return chtml30->out;
2240 * It is a handler who processes the OL tag.
2242 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2243 * destination is specified.
2244 * @param node [i] The OL tag node is specified.
2245 * @return The conversion result is returned.
2248 s_chtml30_end_ol_tag(void *pdoc, Node *UNUSED(node))
2250 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2251 Doc *doc = chtml30->doc;
2255 return chtml30->out;
2260 * It is a handler who processes the LI tag.
2262 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2263 * destination is specified.
2264 * @param node [i] The LI tag node is specified.
2265 * @return The conversion result is returned.
2268 s_chtml30_start_li_tag(void *pdoc, Node *node)
2270 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2271 Doc *doc = chtml30->doc;
2275 /*--------------------------------------------------------------------------*/
2276 /* Get Attributes */
2277 /*--------------------------------------------------------------------------*/
2278 for (attr = qs_get_attr(doc,node);
2280 attr = qs_get_next_attr(doc,attr)) {
2281 char *name = qs_get_attr_name(doc,attr);
2282 char *value = qs_get_attr_value(doc,attr);
2283 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
2288 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
2295 return chtml30->out;
2300 * It is a handler who processes the LI tag.
2302 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2303 * destination is specified.
2304 * @param node [i] The LI tag node is specified.
2305 * @return The conversion result is returned.
2308 s_chtml30_end_li_tag(void *pdoc, Node *UNUSED(child))
2310 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2312 return chtml30->out;
2317 * It is a handler who processes the H1 tag.
2319 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2320 * destination is specified.
2321 * @param node [i] The H1 tag node is specified.
2322 * @return The conversion result is returned.
2325 s_chtml30_start_h1_tag(void *pdoc, Node *node)
2332 chtml30 = GET_CHTML30(pdoc);
2337 for (attr = qs_get_attr(doc,node);
2339 attr = qs_get_next_attr(doc,attr)) {
2340 char *name = qs_get_attr_name(doc,attr);
2341 char *value = qs_get_attr_value(doc,attr);
2342 if (STRCASEEQ('a','A',"align", name)) {
2343 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2353 return chtml30->out;
2358 * It is a handler who processes the H1 tag.
2360 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2361 * destination is specified.
2362 * @param node [i] The H1 tag node is specified.
2363 * @return The conversion result is returned.
2366 s_chtml30_end_h1_tag(void *pdoc, Node *UNUSED(child))
2371 chtml30 = GET_CHTML30(pdoc);
2376 return chtml30->out;
2381 * It is a handler who processes the H2 tag.
2383 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2384 * destination is specified.
2385 * @param node [i] The H2 tag node is specified.
2386 * @return The conversion result is returned.
2389 s_chtml30_start_h2_tag(void *pdoc, Node *node)
2396 chtml30 = GET_CHTML30(pdoc);
2401 for (attr = qs_get_attr(doc,node);
2403 attr = qs_get_next_attr(doc,attr)) {
2404 char *name = qs_get_attr_name(doc,attr);
2405 char *value = qs_get_attr_value(doc,attr);
2406 if (STRCASEEQ('a','A',"align", name)) {
2407 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2416 return chtml30->out;
2421 * It is a handler who processes the H2 tag.
2423 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2424 * destination is specified.
2425 * @param node [i] The H2 tag node is specified.
2426 * @return The conversion result is returned.
2429 s_chtml30_end_h2_tag(void *pdoc, Node *UNUSED(child))
2431 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2432 Doc *doc = chtml30->doc;
2436 return chtml30->out;
2441 * It is a handler who processes the H3 tag.
2443 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2444 * destination is specified.
2445 * @param node [i] The H3 tag node is specified.
2446 * @return The conversion result is returned.
2449 s_chtml30_start_h3_tag(void *pdoc, Node *node)
2456 chtml30 = GET_CHTML30(pdoc);
2461 for (attr = qs_get_attr(doc,node);
2463 attr = qs_get_next_attr(doc,attr)) {
2464 char *name = qs_get_attr_name(doc,attr);
2465 char *value = qs_get_attr_value(doc,attr);
2466 if (STRCASEEQ('a','A',"align", name)) {
2467 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2477 return chtml30->out;
2482 * It is a handler who processes the H3 tag.
2484 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2485 * destination is specified.
2486 * @param node [i] The H3 tag node is specified.
2487 * @return The conversion result is returned.
2490 s_chtml30_end_h3_tag(void *pdoc, Node *UNUSED(child))
2492 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2493 Doc *doc = chtml30->doc;
2497 return chtml30->out;
2502 * It is a handler who processes the H4 tag.
2504 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2505 * destination is specified.
2506 * @param node [i] The H4 tag node is specified.
2507 * @return The conversion result is returned.
2510 s_chtml30_start_h4_tag(void *pdoc, Node *node)
2517 chtml30 = GET_CHTML30(pdoc);
2522 for (attr = qs_get_attr(doc,node);
2524 attr = qs_get_next_attr(doc,attr)) {
2525 char *name = qs_get_attr_name(doc,attr);
2526 char *value = qs_get_attr_value(doc,attr);
2527 if (STRCASEEQ('a','A',"align", name)) {
2528 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2537 return chtml30->out;
2542 * It is a handler who processes the H4 tag.
2544 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2545 * destination is specified.
2546 * @param node [i] The H4 tag node is specified.
2547 * @return The conversion result is returned.
2550 s_chtml30_end_h4_tag(void *pdoc, Node *UNUSED(child))
2552 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2553 Doc *doc = chtml30->doc;
2557 return chtml30->out;
2562 * It is a handler who processes the H5 tag.
2564 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2565 * destination is specified.
2566 * @param node [i] The H5 tag node is specified.
2567 * @return The conversion result is returned.
2570 s_chtml30_start_h5_tag(void *pdoc, Node *node)
2577 chtml30 = GET_CHTML30(pdoc);
2582 for (attr = qs_get_attr(doc,node);
2584 attr = qs_get_next_attr(doc,attr)) {
2585 char *name = qs_get_attr_name(doc,attr);
2586 char *value = qs_get_attr_value(doc,attr);
2587 if (STRCASEEQ('a','A',"align", name)) {
2588 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2597 return chtml30->out;
2602 * It is a handler who processes the H5 tag.
2604 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2605 * destination is specified.
2606 * @param node [i] The H5 tag node is specified.
2607 * @return The conversion result is returned.
2610 s_chtml30_end_h5_tag(void *pdoc, Node *UNUSED(child))
2612 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2613 Doc *doc = chtml30->doc;
2617 return chtml30->out;
2622 * It is a handler who processes the H6 tag.
2624 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2625 * destination is specified.
2626 * @param node [i] The H6 tag node is specified.
2627 * @return The conversion result is returned.
2630 s_chtml30_start_h6_tag(void *pdoc, Node *node)
2637 chtml30 = GET_CHTML30(pdoc);
2642 for (attr = qs_get_attr(doc,node);
2644 attr = qs_get_next_attr(doc,attr)) {
2645 char *name = qs_get_attr_name(doc,attr);
2646 char *value = qs_get_attr_value(doc,attr);
2647 if (STRCASEEQ('a','A',"align", name)) {
2648 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2657 return chtml30->out;
2662 * It is a handler who processes the H6 tag.
2664 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2665 * destination is specified.
2666 * @param node [i] The H6 tag node is specified.
2667 * @return The conversion result is returned.
2670 s_chtml30_end_h6_tag(void *pdoc, Node *UNUSED(child))
2672 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2673 Doc *doc = chtml30->doc;
2677 return chtml30->out;
2682 * It is a handler who processes the TEXTARE tag.
2684 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2685 * destination is specified.
2686 * @param node [i] The TEXTAREA tag node is specified.
2687 * @return The conversion result is returned.
2690 s_chtml30_start_textarea_tag(void *pdoc, Node *node)
2697 chtml30 = GET_CHTML30(pdoc);
2701 chtml30->textarea_flag++;
2704 for (attr = qs_get_attr(doc,node);
2706 attr = qs_get_next_attr(doc,attr)) {
2707 char *name = qs_get_attr_name(doc,attr);
2708 char *value = qs_get_attr_value(doc,attr);
2709 if (STRCASEEQ('a','A',"accesskey",name) && value && *value != 0) {
2710 W_L(" accesskey=\"");
2714 else if (STRCASEEQ('i','I',"istyle", name) && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
2719 else if (STRCASEEQ('n','N',"name", name) && value && *value) {
2724 else if (STRCASEEQ('r','R',"rows", name) && value && *value) {
2729 else if (STRCASEEQ('c','C',"cols", name) && value && *value) {
2736 return chtml30->out;
2741 * It is a handler who processes the TEXTAREA tag.
2743 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2744 * destination is specified.
2745 * @param node [i] The TEXTAREA tag node is specified.
2746 * @return The conversion result is returned.
2749 s_chtml30_end_textarea_tag(void *pdoc, Node *UNUSED(child))
2751 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2752 Doc *doc = chtml30->doc;
2755 chtml30->textarea_flag--;
2757 return chtml30->out;
2762 s_chtml30_chxjif_tag(void *pdoc, Node *node)
2769 chtml30 = GET_CHTML30(pdoc);
2773 for (child = qs_get_child_node(doc, node);
2775 child = qs_get_next_node(doc, child)) {
2777 s_chtml30_chxjif_tag(chtml30, child);
2785 s_chtml30_text_tag(void *pdoc, Node *child)
2798 chtml30 = GET_CHTML30(pdoc);
2802 textval = qs_get_node_value(doc,child);
2803 if (strlen(textval) == 0) {
2804 return chtml30->out;
2807 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
2808 memset(tmp, 0, qs_get_node_size(doc,child)+1);
2810 tdst = qs_alloc_zero_byte_string(doc->buf.pool);
2811 memset(one_byte, 0, sizeof(one_byte));
2814 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
2816 int rtn = s_chtml30_search_emoji(chtml30, &textval[ii], &out);
2818 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
2823 if (is_sjis_kanji(textval[ii])) {
2824 one_byte[0] = textval[ii+0];
2825 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2826 one_byte[0] = textval[ii+1];
2827 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2830 else if (chtml30->pre_flag) {
2831 one_byte[0] = textval[ii+0];
2832 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2834 else if (chtml30->textarea_flag) {
2835 one_byte[0] = textval[ii+0];
2836 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2838 else if (textval[ii] != '\r' && textval[ii] != '\n') {
2839 one_byte[0] = textval[ii+0];
2840 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2844 return chtml30->out;
2849 * It is a handler who processes the BLOCKQUOTE tag.
2851 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2852 * destination is specified.
2853 * @param node [i] The BLOCKQUOTE tag node is specified.
2854 * @return The conversion result is returned.
2857 s_chtml30_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
2859 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2860 Doc *doc = chtml30->doc;
2861 W_L("<blockquote>");
2862 return chtml30->out;
2867 * It is a handler who processes the BLOCKQUOTE tag.
2869 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2870 * destination is specified.
2871 * @param node [i] The BLOCKQUOTE tag node is specified.
2872 * @return The conversion result is returned.
2875 s_chtml30_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
2877 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2878 Doc *doc = chtml30->doc;
2879 W_L("</blockquote>");
2880 return chtml30->out;
2885 * It is a handler who processes the DIR tag.
2887 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2888 * destination is specified.
2889 * @param node [i] The DIR tag node is specified.
2890 * @return The conversion result is returned.
2893 s_chtml30_start_dir_tag(void *pdoc, Node *UNUSED(child))
2895 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2896 Doc *doc = chtml30->doc;
2898 return chtml30->out;
2903 * It is a handler who processes the DIR tag.
2905 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2906 * destination is specified.
2907 * @param node [i] The DIR tag node is specified.
2908 * @return The conversion result is returned.
2911 s_chtml30_end_dir_tag(void *pdoc, Node *UNUSED(child))
2913 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2914 Doc *doc = chtml30->doc;
2916 return chtml30->out;
2921 * It is a handler who processes the DL tag.
2923 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2924 * destination is specified.
2925 * @param node [i] The DL tag node is specified.
2926 * @return The conversion result is returned.
2929 s_chtml30_start_dl_tag(void *pdoc, Node *UNUSED(child))
2931 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2932 Doc *doc = chtml30->doc;
2934 return chtml30->out;
2939 * It is a handler who processes the DL tag.
2941 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2942 * destination is specified.
2943 * @param node [i] The DL tag node is specified.
2944 * @return The conversion result is returned.
2947 s_chtml30_end_dl_tag(void *pdoc, Node *UNUSED(child))
2949 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2950 Doc *doc = chtml30->doc;
2952 return chtml30->out;
2957 * It is a handler who processes the DT tag.
2959 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2960 * destination is specified.
2961 * @param node [i] The DT tag node is specified.
2962 * @return The conversion result is returned.
2965 s_chtml30_start_dt_tag(void *pdoc, Node *UNUSED(child))
2967 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2968 Doc *doc = chtml30->doc;
2970 return chtml30->out;
2975 * It is a handler who processes the DT tag.
2977 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2978 * destination is specified.
2979 * @param node [i] The DT tag node is specified.
2980 * @return The conversion result is returned.
2983 s_chtml30_end_dt_tag(void *pdoc, Node *UNUSED(child))
2985 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2987 return chtml30->out;
2992 * It is a handler who processes the DD tag.
2994 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2995 * destination is specified.
2996 * @param node [i] The DD tag node is specified.
2997 * @return The conversion result is returned.
3000 s_chtml30_start_dd_tag(void *pdoc, Node *UNUSED(child))
3002 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3003 Doc *doc = chtml30->doc;
3007 return chtml30->out;
3012 * It is a handler who processes the DD tag.
3014 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3015 * destination is specified.
3016 * @param node [i] The DD tag node is specified.
3017 * @return The conversion result is returned.
3020 s_chtml30_end_dd_tag(void *pdoc, Node *UNUSED(child))
3022 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3024 return chtml30->out;
3029 * It is a handler who processes the MARQUEE tag.
3031 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3032 * destination is specified.
3033 * @param node [i] The MARQUEE tag node is specified.
3034 * @return The conversion result is returned.
3037 s_chtml30_start_marquee_tag(void *pdoc, Node *node)
3039 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3040 Doc *doc = chtml30->doc;
3043 /*--------------------------------------------------------------------------*/
3044 /* Get Attributes */
3045 /*--------------------------------------------------------------------------*/
3046 for (attr = qs_get_attr(doc,node);
3048 attr = qs_get_next_attr(doc,attr)) {
3049 char *name = qs_get_attr_name(doc,attr);
3050 char *value = qs_get_attr_value(doc,attr);
3051 if (STRCASEEQ('d','D',"direction", name)) {
3052 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3053 W_L(" direction=\"");
3058 else if (STRCASEEQ('b','B',"behavior",name)) {
3059 if (value && (STRCASEEQ('s','S',"scroll",value) || STRCASEEQ('s','S',"slide",value) || STRCASEEQ('a','A',"alternate",value))) {
3060 W_L(" behavior=\"");
3065 else if (STRCASEEQ('l','L',"loop",name)) {
3066 if (value && *value) {
3074 return chtml30->out;
3079 * It is a handler who processes the MARQUEE tag.
3081 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3082 * destination is specified.
3083 * @param node [i] The MARQUEE tag node is specified.
3084 * @return The conversion result is returned.
3087 s_chtml30_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3089 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3090 Doc *doc = chtml30->doc;
3092 return chtml30->out;
3097 * It is a handler who processes the BLINK tag.
3099 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3100 * destination is specified.
3101 * @param node [i] The BLINK tag node is specified.
3102 * @return The conversion result is returned.
3105 s_chtml30_start_blink_tag(void *pdoc, Node *UNUSED(child))
3107 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3108 Doc *doc = chtml30->doc;
3110 return chtml30->out;
3115 * It is a handler who processes the BLINK tag.
3117 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3118 * destination is specified.
3119 * @param node [i] The BLINK tag node is specified.
3120 * @return The conversion result is returned.
3123 s_chtml30_end_blink_tag(void *pdoc, Node *UNUSED(child))
3125 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3126 Doc *doc = chtml30->doc;
3128 return chtml30->out;
3133 * It is a handler who processes the MENU tag.
3135 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3136 * destination is specified.
3137 * @param node [i] The MENU tag node is specified.
3138 * @return The conversion result is returned.
3141 s_chtml30_start_menu_tag(void *pdoc, Node *UNUSED(child))
3143 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3144 Doc *doc = chtml30->doc;
3146 return chtml30->out;
3151 * It is a handler who processes the MENU tag.
3153 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3154 * destination is specified.
3155 * @param node [i] The MENU tag node is specified.
3156 * @return The conversion result is returned.
3159 s_chtml30_end_menu_tag(void *pdoc, Node *UNUSED(child))
3161 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3162 Doc *doc = chtml30->doc;
3164 return chtml30->out;
3169 * It is a handler who processes the PLAINTEXT tag.
3171 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3172 * destination is specified.
3173 * @param node [i] The PLAINTEXT tag node is specified.
3174 * @return The conversion result is returned.
3177 s_chtml30_start_plaintext_tag(void *pdoc, Node *node)
3179 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3180 Doc *doc = chtml30->doc;
3182 s_chtml30_start_plaintext_tag_inner(pdoc,node);
3183 return chtml30->out;
3187 s_chtml30_start_plaintext_tag_inner(void *pdoc, Node *node)
3189 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3190 Doc *doc = chtml30->doc;
3192 for (child = qs_get_child_node(doc, node);
3194 child = qs_get_next_node(doc, child)) {
3196 s_chtml30_start_plaintext_tag_inner(pdoc, child);
3198 return chtml30->out;
3203 * It is a handler who processes the PLAINTEXT tag.
3205 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3206 * destination is specified.
3207 * @param node [i] The PLAINTEXT tag node is specified.
3208 * @return The conversion result is returned.
3211 s_chtml30_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3213 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3214 return chtml30->out;
3219 * * It is handler who processes the New Line Code.
3222 s_chtml30_newline_mark(void *pdoc, Node *UNUSED(node))
3224 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3225 Doc *doc = chtml30->doc;
3227 return chtml30->out;