2 * Copyright (C) 2005-2009 Atsushi Konno All rights reserved.
3 * Copyright (C) 2005 QSDN,Inc. All rights reserved.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 #include "chxj_jhtml.h"
18 #include "chxj_hdml.h"
19 #include "chxj_dump.h"
20 #include "chxj_img_conv.h"
21 #include "chxj_qr_code.h"
22 #include "chxj_encoding.h"
23 #include "chxj_url_encode.h"
24 #include "chxj_str_util.h"
25 #include "chxj_header_inf.h"
26 #include "chxj_jreserved_tag.h"
29 #define GET_JHTML(X) ((jhtml_t *)(X))
32 #define W_L(X) do { jhtml->out = BUFFERED_WRITE_LITERAL(jhtml->out, &doc->buf, (X)); } while(0)
33 #define W_V(X) do { jhtml->out = (X) ? BUFFERED_WRITE_VALUE(jhtml->out, &doc->buf, (X)) \
34 : BUFFERED_WRITE_LITERAL(jhtml->out, &doc->buf, ""); } while(0)
36 #define W_NLCODE() do { char *nlcode = TO_NLCODE(jhtml->conf); W_V(nlcode); } while (0)
38 static char *s_jhtml_start_html_tag (void *pdoc, Node *node);
39 static char *s_jhtml_end_html_tag (void *pdoc, Node *node);
40 static char *s_jhtml_start_meta_tag (void *pdoc, Node *node);
41 static char *s_jhtml_end_meta_tag (void *pdoc, Node *node);
42 static char *s_jhtml_start_head_tag (void *pdoc, Node *node);
43 static char *s_jhtml_end_head_tag (void *pdoc, Node *node);
44 static char *s_jhtml_start_title_tag (void *pdoc, Node *node);
45 static char *s_jhtml_end_title_tag (void *pdoc, Node *node);
46 static char *s_jhtml_start_base_tag (void *pdoc, Node *node);
47 static char *s_jhtml_end_base_tag (void *pdoc, Node *node);
48 static char *s_jhtml_start_body_tag (void *pdoc, Node *node);
49 static char *s_jhtml_end_body_tag (void *pdoc, Node *node);
50 static char *s_jhtml_start_a_tag (void *pdoc, Node *node);
51 static char *s_jhtml_end_a_tag (void *pdoc, Node *node);
52 static char *s_jhtml_start_pre_tag (void *pdoc, Node *node);
53 static char *s_jhtml_end_pre_tag (void *pdoc, Node *node);
54 static char *s_jhtml_start_p_tag (void *pdoc, Node *node);
55 static char *s_jhtml_end_p_tag (void *pdoc, Node *node);
56 static char *s_jhtml_start_ul_tag (void *pdoc, Node *node);
57 static char *s_jhtml_end_ul_tag (void *pdoc, Node *node);
58 static char *s_jhtml_start_ol_tag (void *pdoc, Node *node);
59 static char *s_jhtml_end_ol_tag (void *pdoc, Node *node);
60 static char *s_jhtml_start_li_tag (void *pdoc, Node *node);
61 static char *s_jhtml_end_li_tag (void *pdoc, Node *node);
62 static char *s_jhtml_start_br_tag (void *pdoc, Node *node);
63 static char *s_jhtml_end_br_tag (void *pdoc, Node *node);
64 static char *s_jhtml_start_tr_tag (void *pdoc, Node *node);
65 static char *s_jhtml_end_tr_tag (void *pdoc, Node *node);
66 static char *s_jhtml_start_font_tag (void *pdoc, Node *node);
67 static char *s_jhtml_end_font_tag (void *pdoc, Node *node);
68 static char *s_jhtml_start_form_tag (void *pdoc, Node *node);
69 static char *s_jhtml_end_form_tag (void *pdoc, Node *node);
70 static char *s_jhtml_start_input_tag (void *pdoc, Node *node);
71 static char *s_jhtml_end_input_tag (void *pdoc, Node *node);
72 static char *s_jhtml_start_center_tag (void *pdoc, Node *node);
73 static char *s_jhtml_end_center_tag (void *pdoc, Node *node);
74 static char *s_jhtml_start_hr_tag (void *pdoc, Node *node);
75 static char *s_jhtml_end_hr_tag (void *pdoc, Node *node);
76 static char *s_jhtml_start_img_tag (void *pdoc, Node *node);
77 static char *s_jhtml_end_img_tag (void *pdoc, Node *node);
78 static char *s_jhtml_start_select_tag (void *pdoc, Node *node);
79 static char *s_jhtml_end_select_tag (void *pdoc, Node *node);
80 static char *s_jhtml_start_option_tag (void *pdoc, Node *node);
81 static char *s_jhtml_end_option_tag (void *pdoc, Node *node);
82 static char *s_jhtml_start_div_tag (void *pdoc, Node *node);
83 static char *s_jhtml_end_div_tag (void *pdoc, Node *node);
84 static char *s_jhtml_start_textarea_tag (void *pdoc, Node *node);
85 static char *s_jhtml_end_textarea_tag (void *pdoc, Node *node);
86 static char *s_jhtml_start_b_tag (void *pdoc, Node *node);
87 static char *s_jhtml_end_b_tag (void *pdoc, Node *node);
88 static char *s_jhtml_chxjif_tag (void *pdoc, Node *node);
89 static char *s_jhtml_text_tag (void *pdoc, Node *node);
90 static char *s_jhtml_start_blockquote_tag(void *pdoc, Node *node);
91 static char *s_jhtml_end_blockquote_tag (void *pdoc, Node *node);
92 static char *s_jhtml_start_dir_tag (void *pdoc, Node *node);
93 static char *s_jhtml_end_dir_tag (void *pdoc, Node *node);
94 static char *s_jhtml_start_dl_tag (void *pdoc, Node *node);
95 static char *s_jhtml_end_dl_tag (void *pdoc, Node *node);
96 static char *s_jhtml_start_dt_tag (void *pdoc, Node *node);
97 static char *s_jhtml_end_dt_tag (void *pdoc, Node *node);
98 static char *s_jhtml_start_dd_tag (void *pdoc, Node *node);
99 static char *s_jhtml_end_dd_tag (void *pdoc, Node *node);
100 static char *s_jhtml_start_h1_tag (void *pdoc, Node *node);
101 static char *s_jhtml_end_h1_tag (void *pdoc, Node *node);
102 static char *s_jhtml_start_h2_tag (void *pdoc, Node *node);
103 static char *s_jhtml_end_h2_tag (void *pdoc, Node *node);
104 static char *s_jhtml_start_h3_tag (void *pdoc, Node *node);
105 static char *s_jhtml_end_h3_tag (void *pdoc, Node *node);
106 static char *s_jhtml_start_h4_tag (void *pdoc, Node *node);
107 static char *s_jhtml_end_h4_tag (void *pdoc, Node *node);
108 static char *s_jhtml_start_h5_tag (void *pdoc, Node *node);
109 static char *s_jhtml_end_h5_tag (void *pdoc, Node *node);
110 static char *s_jhtml_start_h6_tag (void *pdoc, Node *node);
111 static char *s_jhtml_end_h6_tag (void *pdoc, Node *node);
112 static char *s_jhtml_start_menu_tag (void *pdoc, Node *node);
113 static char *s_jhtml_end_menu_tag (void *pdoc, Node *node);
114 static char *s_jhtml_start_plaintext_tag (void *pdoc, Node *node);
115 static char *s_jhtml_start_plaintext_tag_inner (void *pdoc, Node *node);
116 static char *s_jhtml_end_plaintext_tag (void *pdoc, Node *node);
117 static char *s_jhtml_start_blink_tag (void *pdoc, Node *node);
118 static char *s_jhtml_end_blink_tag (void *pdoc, Node *node);
119 static char *s_jhtml_start_marquee_tag(void *pdoc, Node *node);
120 static char *s_jhtml_end_marquee_tag (void *pdoc, Node *node);
121 static char *s_jhtml_newline_mark (void *pdoc, Node *node);
123 static void s_init_jhtml(jhtml_t *jhtml, Doc *doc, request_rec *r, device_table *spec);
125 static int s_jhtml_search_emoji(jhtml_t *jhtml, char *txt, char **rslt);
127 static char *chxj_istyle_to_mode(apr_pool_t *p, const char *s);
131 tag_handler jhtml_handler[] = {
134 s_jhtml_start_html_tag,
135 s_jhtml_end_html_tag,
139 s_jhtml_start_meta_tag,
140 s_jhtml_end_meta_tag,
144 s_jhtml_start_textarea_tag,
145 s_jhtml_end_textarea_tag,
154 s_jhtml_start_pre_tag,
159 s_jhtml_start_ul_tag,
164 s_jhtml_start_li_tag,
169 s_jhtml_start_ol_tag,
174 s_jhtml_start_h1_tag,
179 s_jhtml_start_h2_tag,
184 s_jhtml_start_h3_tag,
189 s_jhtml_start_h4_tag,
194 s_jhtml_start_h5_tag,
199 s_jhtml_start_h6_tag,
204 s_jhtml_start_head_tag,
205 s_jhtml_end_head_tag,
209 s_jhtml_start_title_tag,
210 s_jhtml_end_title_tag,
214 s_jhtml_start_base_tag,
215 s_jhtml_end_base_tag,
219 s_jhtml_start_body_tag,
220 s_jhtml_end_body_tag,
229 s_jhtml_start_br_tag,
239 s_jhtml_start_tr_tag,
254 s_jhtml_start_font_tag,
255 s_jhtml_end_font_tag,
259 s_jhtml_start_form_tag,
260 s_jhtml_end_form_tag,
264 s_jhtml_start_input_tag,
265 s_jhtml_end_input_tag,
269 s_jhtml_start_center_tag,
270 s_jhtml_end_center_tag,
274 s_jhtml_start_hr_tag,
279 s_jhtml_start_img_tag,
284 s_jhtml_start_select_tag,
285 s_jhtml_end_select_tag,
289 s_jhtml_start_option_tag,
290 s_jhtml_end_option_tag,
294 s_jhtml_start_div_tag,
344 s_jhtml_start_dt_tag,
359 s_jhtml_start_blockquote_tag,
360 s_jhtml_end_blockquote_tag,
364 s_jhtml_start_dir_tag,
369 s_jhtml_start_dl_tag,
374 s_jhtml_start_dd_tag,
379 s_jhtml_start_menu_tag,
380 s_jhtml_end_menu_tag,
384 s_jhtml_start_plaintext_tag,
385 s_jhtml_end_plaintext_tag,
389 s_jhtml_start_blink_tag,
390 s_jhtml_end_blink_tag,
394 s_jhtml_start_marquee_tag,
395 s_jhtml_end_marquee_tag,
399 s_jhtml_newline_mark,
406 * converts from CHTML5.0 to JHTML.
408 * @param r [i] Requet_rec is appointed.
409 * @param spec [i] The result of the device specification processing which
410 * was done in advance is appointed.
411 * @param src [i] The character string before the converting is appointed.
412 * @return The character string after the converting is returned.
421 chxjconvrule_entry *entryp,
433 /*--------------------------------------------------------------------------*/
435 /*--------------------------------------------------------------------------*/
437 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
439 DBG(r,"I found qrcode xml");
442 DBG(r,"not found qrcode xml");
444 /*--------------------------------------------------------------------------*/
445 /* The CHTML structure is initialized. */
446 /*--------------------------------------------------------------------------*/
447 s_init_jhtml(&jhtml, &doc, r, spec);
449 jhtml.entryp = entryp;
450 jhtml.cookie = cookie;
452 chxj_set_content_type(r, chxj_header_inf_set_content_type(r, "text/html; charset=Windows-31J"));
454 /*--------------------------------------------------------------------------*/
455 /* The character string of the input is analyzed. */
456 /*--------------------------------------------------------------------------*/
457 qs_init_malloc(&doc);
458 qs_init_root_node(&doc);
460 apr_pool_create(&pool, r->pool);
461 ss = apr_pcalloc(pool, srclen + 1);
463 memset(ss, 0, srclen + 1);
464 memcpy(ss, src, srclen);
467 chxj_dump_out("[src] CHTML -> JHTML", ss, srclen);
470 qs_parse_string(&doc,ss,strlen(ss));
472 chxj_buffered_write_init(r->pool, &doc.buf);
473 /*--------------------------------------------------------------------------*/
474 /* It converts it from CHTML to JHTML. */
475 /*--------------------------------------------------------------------------*/
476 chxj_node_convert(spec,r,(void*)&jhtml, &doc, qs_get_root(&doc), 0);
477 jhtml.out = chxj_buffered_write_flush(jhtml.out, &doc.buf);
478 dst = apr_pstrdup(pool, jhtml.out);
479 chxj_buffered_write_terminate(&doc.buf);
482 qs_all_free(&doc,QX_LOGMARK);
485 return apr_pstrdup(pool,ss);
488 dst = apr_psprintf(pool, "\n");
490 *dstlen = strlen(dst);
493 chxj_dump_out("[dst] CHTML -> JHTML", dst, *dstlen);
501 * The CHTML structure is initialized.
503 * @param jhtml [i/o] The pointer to the JHTML structure that wants to be
504 * initialized is specified.
505 * @param doc [i] The Doc structure that should be set to the initialized
506 * JHTML structure is specified.
507 * @param r [i] To use POOL, the pointer to request_rec is specified.
508 * @param spec [i] The pointer to the device_table
511 s_init_jhtml(jhtml_t *jhtml, Doc *doc, request_rec *r, device_table *spec)
513 memset(doc, 0, sizeof(Doc));
514 memset(jhtml, 0, sizeof(jhtml_t));
519 jhtml->out = qs_alloc_zero_byte_string(r->pool);
520 jhtml->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
521 jhtml->doc->parse_mode = PARSE_MODE_CHTML;
526 * Corresponding EMOJI to a current character-code is retrieved.
527 * The substitution character string is stored in the rslt pointer if agreeing.
529 * @param jhtml [i] The pointer to the CHTML structure is specified.
530 * @param txt [i] The character string to want to examine whether it is
531 * EMOJI is specified.
532 * @param rslt [o] The pointer to the pointer that stores the result is
534 * @return When corresponding EMOJI exists, it returns it excluding 0.
537 s_jhtml_search_emoji(jhtml_t *jhtml, char *txt, char **rslt)
549 if (! spec) DBG(r,"spec is NULL");
551 for (ee = jhtml->conf->emoji;
555 unsigned char hex1byte;
556 unsigned char hex2byte;
559 DBG(r,"emoji->imode is NULL");
563 hex1byte = ee->imode->hex1byte & 0xff;
564 hex2byte = ee->imode->hex2byte & 0xff;
566 if (ee->imode->string
567 && strlen(ee->imode->string) > 0
568 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
569 if (spec == NULL || spec->emoji_type == NULL) {
570 *rslt = apr_psprintf(r->pool,"
\e%s
\ f", ee->jphone->string);
571 return strlen(ee->imode->string);
578 && ((unsigned char)txt[0] & 0xff) == ((unsigned char)hex1byte)
579 && ((unsigned char)txt[1] & 0xff) == ((unsigned char)hex2byte)) {
580 if (spec == NULL || spec->emoji_type == NULL) {
581 *rslt = apr_psprintf(r->pool,"
\e%s
\ f", ee->jphone->string);
594 chxj_jhtml_emoji_only_converter(request_rec *r, device_table *spec, const char *src, apr_size_t len)
608 DBG(r, "REQ[%X] start chxj_jhtml_emoji_eonly_converter()", (apr_size_t)(unsigned int)r);
609 memset(doc, 0, sizeof(Doc));
610 memset(jhtml, 0, sizeof(jhtml_t));
615 jhtml->out = qs_alloc_zero_byte_string(r->pool);
616 jhtml->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
617 jhtml->doc->parse_mode = PARSE_MODE_CHTML;
619 apr_pool_create(&pool, r->pool);
621 chxj_buffered_write_init(pool, &doc->buf);
623 for (ii=0; ii<len; ii++) {
627 rtn = s_jhtml_search_emoji(jhtml, (char *)&src[ii], &out);
634 if (is_sjis_kanji(src[ii])) {
635 two_byte[0] = src[ii+0];
636 two_byte[1] = src[ii+1];
642 one_byte[0] = src[ii+0];
647 jhtml->out = chxj_buffered_write_flush(jhtml->out, &doc->buf);
649 DBG(r, "REQ[%X] end chxj_jhtml_emoji_eonly_converter()", (apr_size_t)(unsigned int)r);
655 * It is a handler who processes the HTML tag.
657 * @param pdoc [i/o] The pointer to the CHTML structure at the output
658 * destination is specified.
659 * @param node [i] The HTML tag node is specified.
660 * @return The conversion result is returned.
663 s_jhtml_start_html_tag(void *pdoc, Node *UNUSED(node))
670 jhtml = GET_JHTML(pdoc);
673 DBG(r, "start s_jhtml_start_html_tag()");
675 /*--------------------------------------------------------------------------*/
677 /*--------------------------------------------------------------------------*/
680 DBG(r, "end s_jhtml_start_html_tag()");
687 * It is a handler who processes the HTML tag.
689 * @param pdoc [i/o] The pointer to the CHTML structure at the output
690 * destination is specified.
691 * @param node [i] The HTML tag node is specified.
692 * @return The conversion result is returned.
695 s_jhtml_end_html_tag(void *pdoc, Node *UNUSED(child))
697 jhtml_t *jhtml = GET_JHTML(pdoc);
698 Doc *doc = jhtml->doc;
707 * It is a handler who processes the META tag.
709 * @param pdoc [i/o] The pointer to the CHTML structure at the output
710 * destination is specified.
711 * @param node [i] The META tag node is specified.
712 * @return The conversion result is returned.
715 s_jhtml_start_meta_tag(void *pdoc, Node *node)
721 int content_type_flag;
724 jhtml = GET_JHTML(pdoc);
728 content_type_flag = 0;
731 /*--------------------------------------------------------------------------*/
733 /*--------------------------------------------------------------------------*/
734 for (attr = qs_get_attr(doc,node);
736 attr = qs_get_next_attr(doc,attr)) {
737 char *name = qs_get_attr_name(doc,attr);
738 char *value = qs_get_attr_value(doc,attr);
742 if (strcasecmp(name, "http-equiv") == 0 && value && *value) {
743 /*----------------------------------------------------------------------*/
745 /*----------------------------------------------------------------------*/
746 W_L(" http-equiv=\"");
749 if (STRCASEEQ('c','C',"content-type",value)) {
750 content_type_flag = 1;
752 if (STRCASEEQ('r','R',"refresh",value)) {
760 if (strcasecmp(name, "content") == 0 && value && *value) {
761 /*----------------------------------------------------------------------*/
763 /*----------------------------------------------------------------------*/
764 if (content_type_flag) {
768 W_V(chxj_header_inf_set_content_type(r, "text/html; charset=SHIFT_JIS"));
777 buf = apr_pstrdup(r->pool, value);
779 url = strchr(buf, ';');
781 sec = apr_pstrdup(r->pool, buf);
784 url = chxj_encoding_parameter(r, url);
785 url = chxj_add_cookie_parameter(r, url, jhtml->cookie);
815 * It is a handler who processes the META tag.
817 * @param pdoc [i/o] The pointer to the CHTML structure at the output
818 * destination is specified.
819 * @param node [i] The META tag node is specified.
820 * @return The conversion result is returned.
823 s_jhtml_end_meta_tag(void *pdoc, Node *UNUSED(child))
825 jhtml_t *jhtml = GET_JHTML(pdoc);
832 * It is a handler who processes the HEAD tag.
834 * @param pdoc [i/o] The pointer to the CHTML structure at the output
835 * destination is specified.
836 * @param node [i] The HEAD tag node is specified.
837 * @return The conversion result is returned.
840 s_jhtml_start_head_tag(void *pdoc, Node *UNUSED(node))
846 jhtml = GET_JHTML(pdoc);
856 * It is a handler who processes the HEAD tag.
858 * @param pdoc [i/o] The pointer to the CHTML structure at the output
859 * destination is specified.
860 * @param node [i] The HEAD tag node is specified.
861 * @return The conversion result is returned.
864 s_jhtml_end_head_tag(void *pdoc, Node *UNUSED(child))
870 jhtml = GET_JHTML(pdoc);
880 * It is a handler who processes the TITLE tag.
882 * @param pdoc [i/o] The pointer to the CHTML structure at the output
883 * destination is specified.
884 * @param node [i] The TITLE tag node is specified.
885 * @return The conversion result is returned.
888 s_jhtml_start_title_tag(void *pdoc, Node *UNUSED(node))
894 jhtml = GET_JHTML(pdoc);
904 * It is a handler who processes the TITLE tag.
906 * @param pdoc [i/o] The pointer to the CHTML structure at the output
907 * destination is specified.
908 * @param node [i] The TITLE tag node is specified.
909 * @return The conversion result is returned.
912 s_jhtml_end_title_tag(void *pdoc, Node *UNUSED(child))
918 jhtml = GET_JHTML(pdoc);
928 * It is a handler who processes the BASE tag.
930 * @param pdoc [i/o] The pointer to the CHTML structure at the output
931 * destination is specified.
932 * @param node [i] The BASE tag node is specified.
933 * @return The conversion result is returned.
936 s_jhtml_start_base_tag(void *pdoc, Node *node)
943 jhtml = GET_JHTML(pdoc);
948 /*--------------------------------------------------------------------------*/
950 /*--------------------------------------------------------------------------*/
951 for (attr = qs_get_attr(doc,node);
953 attr = qs_get_next_attr(doc,attr)) {
954 char *name = qs_get_attr_name(doc,attr);
955 char *value = qs_get_attr_value(doc,attr);
956 if (STRCASEEQ('h','H',"href",name)) {
968 * It is a handler who processes the BASE tag.
970 * @param pdoc [i/o] The pointer to the CHTML structure at the output
971 * destination is specified.
972 * @param node [i] The BASE tag node is specified.
973 * @return The conversion result is returned.
976 s_jhtml_end_base_tag(void *pdoc, Node *UNUSED(child))
978 jhtml_t *jhtml = GET_JHTML(pdoc);
984 * It is a handler who processes the BODY tag.
986 * @param pdoc [i/o] The pointer to the CHTML structure at the output
987 * destination is specified.
988 * @param node [i] The BODY tag node is specified.
989 * @return The conversion result is returned.
992 s_jhtml_start_body_tag(void *pdoc, Node *node)
999 jhtml = GET_JHTML(pdoc);
1004 /*--------------------------------------------------------------------------*/
1005 /* Get Attributes */
1006 /*--------------------------------------------------------------------------*/
1007 for (attr = qs_get_attr(doc,node);
1009 attr = qs_get_next_attr(doc,attr)) {
1010 char *name = qs_get_attr_name(doc,attr);
1011 char *value = qs_get_attr_value(doc,attr);
1012 if (STRCASEEQ('b','B',"bgcolor",name) && value && *value) {
1013 /*----------------------------------------------------------------------*/
1015 /*----------------------------------------------------------------------*/
1020 else if (STRCASEEQ('t','T',"text",name) && value && *value) {
1021 /*----------------------------------------------------------------------*/
1023 /*----------------------------------------------------------------------*/
1028 else if (STRCASEEQ('l','L',"link",name) && value && *value) {
1029 /*----------------------------------------------------------------------*/
1031 /*----------------------------------------------------------------------*/
1036 else if (STRCASEEQ('a','A',"alink",name)) {
1037 /*----------------------------------------------------------------------*/
1039 /*----------------------------------------------------------------------*/
1042 else if (STRCASEEQ('v','V',"vlink",name)) {
1043 /*----------------------------------------------------------------------*/
1045 /*----------------------------------------------------------------------*/
1055 * It is a handler who processes the BODY tag.
1057 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1058 * destination is specified.
1059 * @param node [i] The BODY tag node is specified.
1060 * @return The conversion result is returned.
1063 s_jhtml_end_body_tag(void *pdoc, Node *UNUSED(child))
1069 jhtml = GET_JHTML(pdoc);
1079 * It is a handler who processes the A tag.
1081 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1082 * destination is specified.
1083 * @param node [i] The A tag node is specified.
1084 * @return The conversion result is returned.
1087 s_jhtml_start_a_tag(void *pdoc, Node *node)
1094 jhtml = GET_JHTML(pdoc);
1099 /*--------------------------------------------------------------------------*/
1100 /* Get Attributes */
1101 /*--------------------------------------------------------------------------*/
1102 for (attr = qs_get_attr(doc,node);
1104 attr = qs_get_next_attr(doc,attr)) {
1105 char *name = qs_get_attr_name(doc,attr);
1106 char *value = qs_get_attr_value(doc,attr);
1107 if (STRCASEEQ('n','N',"name",name)) {
1108 /*----------------------------------------------------------------------*/
1110 /*----------------------------------------------------------------------*/
1115 else if (STRCASEEQ('h','H',"href",name)) {
1116 /*----------------------------------------------------------------------*/
1118 /*----------------------------------------------------------------------*/
1119 value = chxj_encoding_parameter(r, value);
1120 if (! chxj_starts_with(value, "mailto:") && ! chxj_starts_with(value, "tel:")) {
1121 value = chxj_add_cookie_parameter(r, value, jhtml->cookie);
1122 value = chxj_jreserved_tag_to_safe_for_query_string(r, value, jhtml->entryp);
1128 else if (STRCASEEQ('a','A',"accesskey",name)) {
1129 /*----------------------------------------------------------------------*/
1131 /*----------------------------------------------------------------------*/
1132 W_L(" accesskey=\"");
1136 else if (STRCASEEQ('c','C',"cti",name)) {
1137 /*----------------------------------------------------------------------*/
1139 /*----------------------------------------------------------------------*/
1144 else if (STRCASEEQ('i','I',"ijam",name)) {
1145 /*----------------------------------------------------------------------*/
1147 /*----------------------------------------------------------------------*/
1150 else if (STRCASEEQ('u','U',"utn",name)) {
1151 /*----------------------------------------------------------------------*/
1153 /* It is special only for CHTML. */
1154 /*----------------------------------------------------------------------*/
1157 else if (STRCASEEQ('t','T',"telbook",name)) {
1158 /*----------------------------------------------------------------------*/
1160 /*----------------------------------------------------------------------*/
1163 else if (STRCASEEQ('k','K',"kana",name)) {
1164 /*----------------------------------------------------------------------*/
1166 /*----------------------------------------------------------------------*/
1169 else if (STRCASEEQ('e','E',"email",name)) {
1170 /*----------------------------------------------------------------------*/
1172 /*----------------------------------------------------------------------*/
1175 else if (STRCASEEQ('i','I',"ista",name)) {
1176 /*----------------------------------------------------------------------*/
1178 /*----------------------------------------------------------------------*/
1181 else if (STRCASEEQ('i','I',"ilet",name)) {
1182 /*----------------------------------------------------------------------*/
1184 /*----------------------------------------------------------------------*/
1187 else if (STRCASEEQ('i','I',"iswf",name)) {
1188 /*----------------------------------------------------------------------*/
1190 /*----------------------------------------------------------------------*/
1193 else if (STRCASEEQ('i','I',"irst",name)) {
1194 /*----------------------------------------------------------------------*/
1196 /*----------------------------------------------------------------------*/
1206 * It is a handler who processes the A tag.
1208 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1209 * destination is specified.
1210 * @param node [i] The A tag node is specified.
1211 * @return The conversion result is returned.
1214 s_jhtml_end_a_tag(void *pdoc, Node *UNUSED(child))
1220 jhtml = GET_JHTML(pdoc);
1230 * It is a handler who processes the BR tag.
1232 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1233 * destination is specified.
1234 * @param node [i] The BR tag node is specified.
1235 * @return The conversion result is returned.
1238 s_jhtml_start_br_tag(void *pdoc, Node *node)
1245 jhtml = GET_JHTML(pdoc);
1250 /*--------------------------------------------------------------------------*/
1251 /* Get Attributes */
1252 /*--------------------------------------------------------------------------*/
1253 for (attr = qs_get_attr(doc,node);
1255 attr = qs_get_next_attr(doc,attr)) {
1256 char *name = qs_get_attr_name(doc,attr);
1257 char *value = qs_get_attr_value(doc,attr);
1258 if (STRCASEEQ('c','C',"clear",name)) {
1259 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1272 * It is a handler who processes the BR tag.
1274 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1275 * destination is specified.
1276 * @param node [i] The BR tag node is specified.
1277 * @return The conversion result is returned.
1280 s_jhtml_end_br_tag(void *pdoc, Node *UNUSED(child))
1282 jhtml_t *jhtml = GET_JHTML(pdoc);
1288 * It is a handler who processes the TR tag.
1290 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1291 * destination is specified.
1292 * @param node [i] The TR tag node is specified.
1293 * @return The conversion result is returned.
1296 s_jhtml_start_tr_tag(void *pdoc, Node *UNUSED(node))
1302 jhtml = GET_JHTML(pdoc);
1312 * It is a handler who processes the TR tag.
1314 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1315 * destination is specified.
1316 * @param node [i] The TR tag node is specified.
1317 * @return The conversion result is returned.
1320 s_jhtml_end_tr_tag(void *pdoc, Node *UNUSED(child))
1322 jhtml_t *jhtml = GET_JHTML(pdoc);
1328 * It is a handler who processes the FONT tag.
1330 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1331 * destination is specified.
1332 * @param node [i] The FONT tag node is specified.
1333 * @return The conversion result is returned.
1336 s_jhtml_start_font_tag(void *pdoc, Node *node)
1344 jhtml = GET_JHTML(pdoc);
1348 /*--------------------------------------------------------------------------*/
1349 /* Get Attributes */
1350 /*--------------------------------------------------------------------------*/
1351 for (attr = qs_get_attr(doc,node);
1353 attr = qs_get_next_attr(doc,attr)) {
1354 char *name = qs_get_attr_name(doc,attr);
1355 char *value = qs_get_attr_value(doc,attr);
1356 if (STRCASEEQ('c','C',"color",name) && value && *value) {
1357 color = apr_pstrdup(doc->buf.pool, value);
1360 else if (STRCASEEQ('s','S',"size",name)) {
1361 /*----------------------------------------------------------------------*/
1363 /*----------------------------------------------------------------------*/
1368 W_L("<font color=\"");
1378 * It is a handler who processes the FONT tag.
1380 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1381 * destination is specified.
1382 * @param node [i] The FONT tag node is specified.
1383 * @return The conversion result is returned.
1386 s_jhtml_end_font_tag(void *pdoc, Node *UNUSED(child))
1392 jhtml = GET_JHTML(pdoc);
1396 if (jhtml->font_flag) {
1405 * It is a handler who processes the FORM tag.
1407 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1408 * destination is specified.
1409 * @param node [i] The FORM tag node is specified.
1410 * @return The conversion result is returned.
1413 s_jhtml_start_form_tag(void *pdoc, Node *node)
1419 char *new_hidden_tag = NULL;
1420 char *attr_method = NULL;
1421 char *attr_action = NULL;
1422 char *attr_utn = NULL;
1424 jhtml = GET_JHTML(pdoc);
1428 /*--------------------------------------------------------------------------*/
1429 /* Get Attributes */
1430 /*--------------------------------------------------------------------------*/
1431 for (attr = qs_get_attr(doc,node);
1433 attr = qs_get_next_attr(doc,attr)) {
1434 char *name = qs_get_attr_name(doc,attr);
1435 char *value = qs_get_attr_value(doc,attr);
1436 if (STRCASEEQ('a','A',"action", name)) {
1437 /*----------------------------------------------------------------------*/
1439 /*----------------------------------------------------------------------*/
1440 attr_action = chxj_encoding_parameter(r, value);
1441 attr_action = chxj_add_cookie_parameter(r, attr_action, jhtml->cookie);
1443 else if (STRCASEEQ('m','M',"method", name)) {
1444 /*----------------------------------------------------------------------*/
1446 /*----------------------------------------------------------------------*/
1447 attr_method = apr_pstrdup(doc->pool, value);
1449 else if (STRCASEEQ('u','U',"utn", name)) {
1450 /*----------------------------------------------------------------------*/
1452 /* It is special only for CHTML. */
1453 /*----------------------------------------------------------------------*/
1458 int post_flag = (attr_method && strcasecmp(attr_method, "post") == 0) ? 1 : 0;
1463 char *old_qs = NULL;
1464 q = strchr(attr_action, '?');
1466 new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 0, post_flag, &old_qs, CHXJ_FALSE, CHXJ_TRUE, jhtml->entryp);
1467 if (new_hidden_tag || old_qs) {
1488 if (new_hidden_tag) {
1489 W_V(new_hidden_tag);
1496 * It is a handler who processes the FORM tag.
1498 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1499 * destination is specified.
1500 * @param node [i] The FORM tag node is specified.
1501 * @return The conversion result is returned.
1504 s_jhtml_end_form_tag(void *pdoc, Node *UNUSED(child))
1506 jhtml_t *jhtml = GET_JHTML(pdoc);
1507 Doc *doc = jhtml->doc;
1514 * It is a handler who processes the INPUT tag.
1516 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1517 * destination is specified.
1518 * @param node [i] The INPUT tag node is specified.
1519 * @return The conversion result is returned.
1522 s_jhtml_start_input_tag(void *pdoc, Node *node)
1536 jhtml = GET_JHTML(pdoc);
1549 /*--------------------------------------------------------------------------*/
1550 /* Get Attributes */
1551 /*--------------------------------------------------------------------------*/
1552 type = qs_get_type_attr(doc, node, doc->buf.pool);
1553 name = qs_get_name_attr(doc, node, doc->buf.pool);
1554 value = qs_get_value_attr(doc,node,doc->buf.pool);
1555 istyle = qs_get_istyle_attr(doc,node,doc->buf.pool);
1556 max_length = qs_get_maxlength_attr(doc,node,doc->buf.pool);
1557 checked = qs_get_checked_attr(doc,node,doc->buf.pool);
1558 accesskey = qs_get_accesskey_attr(doc, node, doc->buf.pool);
1559 size = qs_get_size_attr(doc, node, doc->buf.pool);
1562 if (type && (STRCASEEQ('t','T',"text", type) ||
1563 STRCASEEQ('p','P',"password",type) ||
1564 STRCASEEQ('c','C',"checkbox",type) ||
1565 STRCASEEQ('r','R',"radio", type) ||
1566 STRCASEEQ('h','H',"hidden", type) ||
1567 STRCASEEQ('s','S',"submit", type) ||
1568 STRCASEEQ('r','R',"reset", type))) {
1574 if (size && *size) {
1579 if (name && *name) {
1581 W_V(chxj_jreserved_to_safe_tag(r, name, jhtml->entryp));
1584 if (value && *value) {
1586 W_V(chxj_add_slash_to_doublequote(doc->pool, value));
1589 if (accesskey && *accesskey) {
1590 W_L(" accesskey=\"");
1594 if (istyle && (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4')) {
1595 /*------------------------------------------------------------------------*/
1597 /*------------------------------------------------------------------------*/
1598 if (type && STRCASEEQ('p','P',"password", type) && ! jhtml->entryp->pc_flag ) {
1604 char *vv = chxj_istyle_to_mode(doc->buf.pool,istyle);
1610 else if (type && STRCASEEQ('p','P',"password",type)) {
1615 /*--------------------------------------------------------------------------*/
1616 /* The figure is default for the password. */
1617 /*--------------------------------------------------------------------------*/
1618 if (max_length && *max_length) {
1619 if (chxj_chk_numeric(max_length) == 0) {
1620 W_L(" maxlength=\"");
1635 * It is a handler who processes the INPUT tag.
1637 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1638 * destination is specified.
1639 * @param node [i] The INPUT tag node is specified.
1640 * @return The conversion result is returned.
1643 s_jhtml_end_input_tag(void *pdoc, Node *UNUSED(child))
1645 jhtml_t *jhtml = GET_JHTML(pdoc);
1651 * It is a handler who processes the CENTER tag.
1653 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1654 * destination is specified.
1655 * @param node [i] The CENTER tag node is specified.
1656 * @return The conversion result is returned.
1659 s_jhtml_start_center_tag(void *pdoc, Node *UNUSED(node))
1661 jhtml_t *jhtml = GET_JHTML(pdoc);
1662 Doc *doc = jhtml->doc;
1669 * It is a handler who processes the CENTER tag.
1671 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1672 * destination is specified.
1673 * @param node [i] The CENTER tag node is specified.
1674 * @return The conversion result is returned.
1677 s_jhtml_end_center_tag(void *pdoc, Node *UNUSED(child))
1683 jhtml = GET_JHTML(pdoc);
1693 * It is a handler who processes the li tag.
1695 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1696 * destination is specified.
1697 * @param node [i] The li tag node is specified.
1698 * @return The conversion result is returned.
1701 s_jhtml_start_li_tag(void *pdoc, Node *node)
1708 jhtml = GET_JHTML(pdoc);
1713 /*--------------------------------------------------------------------------*/
1714 /* Get Attributes */
1715 /*--------------------------------------------------------------------------*/
1716 for (attr = qs_get_attr(doc,node);
1718 attr = qs_get_next_attr(doc,attr)) {
1719 char *name = qs_get_attr_name(doc,attr);
1720 char *value = qs_get_attr_value(doc,attr);
1721 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
1726 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
1738 * It is a handler who processes the li tag.
1740 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1741 * destination is specified.
1742 * @param node [i] The li tag node is specified.
1743 * @return The conversion result is returned.
1746 s_jhtml_end_li_tag(void *pdoc, Node *UNUSED(child))
1752 jhtml = GET_JHTML(pdoc);
1762 * It is a handler who processes the OL tag.
1764 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1765 * destination is specified.
1766 * @param node [i] The OL tag node is specified.
1767 * @return The conversion result is returned.
1770 s_jhtml_start_ol_tag(void *pdoc, Node *node)
1777 jhtml = GET_JHTML(pdoc);
1782 /*--------------------------------------------------------------------------*/
1783 /* Get Attributes */
1784 /*--------------------------------------------------------------------------*/
1785 for (attr = qs_get_attr(doc,node);
1787 attr = qs_get_next_attr(doc,attr)) {
1788 char *name = qs_get_attr_name(doc,attr);
1789 char *value = qs_get_attr_value(doc,attr);
1790 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
1795 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
1807 * It is a handler who processes the OL tag.
1809 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1810 * destination is specified.
1811 * @param node [i] The OL tag node is specified.
1812 * @return The conversion result is returned.
1815 s_jhtml_end_ol_tag(void *pdoc, Node *UNUSED(child))
1821 jhtml = GET_JHTML(pdoc);
1831 * It is a handler who processes the P tag.
1833 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1834 * destination is specified.
1835 * @param node [i] The P tag node is specified.
1836 * @return The conversion result is returned.
1839 s_jhtml_start_p_tag(void *pdoc, Node *node)
1847 jhtml = GET_JHTML(pdoc);
1852 for (attr = qs_get_attr(doc,node);
1854 attr = qs_get_next_attr(doc,attr)) {
1855 char *nm = qs_get_attr_name(doc,attr);
1856 char *val = qs_get_attr_value(doc,attr);
1857 if (STRCASEEQ('a','A',"align", nm)) {
1858 /*----------------------------------------------------------------------*/
1859 /* CHTML 1.0 (W3C version 3.2) */
1860 /*----------------------------------------------------------------------*/
1861 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
1862 align = apr_pstrdup(doc->buf.pool, val);
1878 * It is a handler who processes the P tag.
1880 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1881 * destination is specified.
1882 * @param node [i] The P tag node is specified.
1883 * @return The conversion result is returned.
1886 s_jhtml_end_p_tag(void *pdoc, Node *UNUSED(child))
1888 jhtml_t *jhtml = GET_JHTML(pdoc);
1889 Doc *doc = jhtml->doc;
1897 * It is a handler who processes the PRE tag.
1899 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1900 * destination is specified.
1901 * @param node [i] The PRE tag node is specified.
1902 * @return The conversion result is returned.
1905 s_jhtml_start_pre_tag(void *pdoc, Node *UNUSED(node))
1907 jhtml_t *jhtml = GET_JHTML(pdoc);
1908 Doc *doc = jhtml->doc;
1917 * It is a handler who processes the PRE tag.
1919 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1920 * destination is specified.
1921 * @param node [i] The PRE tag node is specified.
1922 * @return The conversion result is returned.
1925 s_jhtml_end_pre_tag(void *pdoc, Node *UNUSED(child))
1927 jhtml_t *jhtml = GET_JHTML(pdoc);
1928 Doc *doc = jhtml->doc;
1938 * It is a handler who processes the UL tag.
1940 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1941 * destination is specified.
1942 * @param node [i] The UL tag node is specified.
1943 * @return The conversion result is returned.
1946 s_jhtml_start_ul_tag(void *pdoc, Node *UNUSED(node))
1948 jhtml_t *jhtml = GET_JHTML(pdoc);
1949 Doc *doc = jhtml->doc;
1957 * It is a handler who processes the UL tag.
1959 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1960 * destination is specified.
1961 * @param node [i] The UL tag node is specified.
1962 * @return The conversion result is returned.
1965 s_jhtml_end_ul_tag(void *pdoc, Node *UNUSED(child))
1967 jhtml_t *jhtml = GET_JHTML(pdoc);
1968 Doc *doc = jhtml->doc;
1976 * It is a handler who processes the HR tag.
1978 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1979 * destination is specified.
1980 * @param node [i] The HR tag node is specified.
1981 * @return The conversion result is returned.
1984 s_jhtml_start_hr_tag(void *pdoc, Node *node)
1986 jhtml_t *jhtml = GET_JHTML(pdoc);
1987 Doc *doc = jhtml->doc;
1991 for (attr = qs_get_attr(doc,node);
1993 attr = qs_get_next_attr(doc,attr)) {
1994 char *name = qs_get_attr_name(doc,attr);
1995 char *value = qs_get_attr_value(doc,attr);
1996 if (STRCASEEQ('a','A',"align",name)) {
1997 /*----------------------------------------------------------------------*/
1999 /*----------------------------------------------------------------------*/
2000 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2006 else if (STRCASEEQ('s','S',"size",name) && value && *value) {
2007 /*----------------------------------------------------------------------*/
2009 /*----------------------------------------------------------------------*/
2014 else if (STRCASEEQ('w','W',"width",name) && value && *value) {
2015 /*----------------------------------------------------------------------*/
2017 /*----------------------------------------------------------------------*/
2022 else if (STRCASEEQ('n','N',"noshade",name)) {
2023 /*----------------------------------------------------------------------*/
2025 /*----------------------------------------------------------------------*/
2028 else if (STRCASEEQ('c','C',"color",name) && value && *value) {
2029 /*----------------------------------------------------------------------*/
2031 /*----------------------------------------------------------------------*/
2043 * It is a handler who processes the HR tag.
2045 * @param jhtml [i/o] The pointer to the CHTML structure at the output
2046 * destination is specified.
2047 * @param node [i] The HR tag node is specified.
2048 * @return The conversion result is returned.
2051 s_jhtml_end_hr_tag(void *pdoc, Node *UNUSED(child))
2053 jhtml_t *jhtml = GET_JHTML(pdoc);
2059 * It is a handler who processes the IMG tag.
2061 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2062 * destination is specified.
2063 * @param node [i] The IMG tag node is specified.
2064 * @return The conversion result is returned.
2067 s_jhtml_start_img_tag(void *pdoc, Node *node)
2069 jhtml_t *jhtml = GET_JHTML(pdoc);
2070 Doc *doc = jhtml->doc;
2071 request_rec *r = doc->r;
2073 #ifndef IMG_NOT_CONVERT_FILENAME
2074 device_table *spec = jhtml->spec;
2078 /*--------------------------------------------------------------------------*/
2079 /* Get Attributes */
2080 /*--------------------------------------------------------------------------*/
2081 for (attr = qs_get_attr(doc,node);
2083 attr = qs_get_next_attr(doc,attr)) {
2084 char *name = qs_get_attr_name(doc,attr);
2085 char *value = qs_get_attr_value(doc,attr);
2086 if (STRCASEEQ('s','S',"src",name)) {
2087 /*----------------------------------------------------------------------*/
2089 /*----------------------------------------------------------------------*/
2090 #ifdef IMG_NOT_CONVERT_FILENAME
2091 value = chxj_encoding_parameter(r, value);
2092 value = chxj_jreserved_tag_to_safe_for_query_string(r, value, jhtml->entryp);
2093 value = chxj_add_cookie_parameter(r, value, jhtml->cookie);
2094 value = chxj_add_cookie_no_update_parameter(r, value);
2099 value = chxj_img_conv(r, spec, value);
2100 value = chxj_encoding_parameter(r, value);
2101 value = chxj_jreserved_tag_to_safe_for_query_string(r, value, jhtml->entryp);
2102 value = chxj_add_cookie_parameter(r, value, jhtml->cookie);
2103 value = chxj_add_cookie_no_update_parameter(r, value);
2109 else if (STRCASEEQ('a','A',"align",name)) {
2110 /*----------------------------------------------------------------------*/
2112 /*----------------------------------------------------------------------*/
2114 if (STRCASEEQ('t','T',"top", value) ||
2115 STRCASEEQ('m','M',"middle",value) ||
2116 STRCASEEQ('b','B',"bottom",value) ||
2117 STRCASEEQ('l','L',"left", value) ||
2118 STRCASEEQ('r','R',"right", value)) {
2123 else if (STRCASEEQ('c','C',"center",value)) {
2130 else if (STRCASEEQ('w','W',"width",name) && value && *value) {
2131 /*----------------------------------------------------------------------*/
2133 /*----------------------------------------------------------------------*/
2138 else if (STRCASEEQ('h','H',"height",name) && value && *value) {
2139 /*----------------------------------------------------------------------*/
2141 /*----------------------------------------------------------------------*/
2146 else if (STRCASEEQ('h','H',"hspace",name)) {
2147 /*----------------------------------------------------------------------*/
2149 /*----------------------------------------------------------------------*/
2152 else if (STRCASEEQ('v','V',"vspace",name)) {
2153 /*----------------------------------------------------------------------*/
2155 /*----------------------------------------------------------------------*/
2158 else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
2159 /*----------------------------------------------------------------------*/
2161 /*----------------------------------------------------------------------*/
2173 * It is a handler who processes the IMG tag.
2175 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2176 * destination is specified.
2177 * @param node [i] The IMG tag node is specified.
2178 * @return The conversion result is returned.
2181 s_jhtml_end_img_tag(void *pdoc, Node *UNUSED(child))
2183 jhtml_t *jhtml = GET_JHTML(pdoc);
2189 * It is a handler who processes the SELECT tag.
2191 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2192 * destination is specified.
2193 * @param node [i] The SELECT tag node is specified.
2194 * @return The conversion result is returned.
2197 s_jhtml_start_select_tag(void *pdoc, Node *child)
2199 jhtml_t *jhtml = GET_JHTML(pdoc);
2200 Doc *doc = jhtml->doc;
2204 char *multiple = NULL;
2207 for (attr = qs_get_attr(doc,child);
2209 attr = qs_get_next_attr(doc,attr)) {
2210 char *nm = qs_get_attr_name(doc,attr);
2211 char *val = qs_get_attr_value(doc,attr);
2212 if (STRCASEEQ('s','S',"size",nm)) {
2213 /*----------------------------------------------------------------------*/
2214 /* CHTML 1.0 version 2.0 */
2215 /*----------------------------------------------------------------------*/
2216 size = apr_pstrdup(doc->buf.pool, val);
2218 else if (STRCASEEQ('n','N',"name",nm)) {
2219 /*----------------------------------------------------------------------*/
2220 /* CHTML 1.0 version 2.0 */
2221 /*----------------------------------------------------------------------*/
2222 name = apr_pstrdup(doc->buf.pool, val);
2224 else if (STRCASEEQ('m','M',"multiple", nm)) {
2225 /*----------------------------------------------------------------------*/
2226 /* CHTML 1.0 version 2.0 */
2227 /*----------------------------------------------------------------------*/
2228 multiple = apr_pstrdup(doc->buf.pool, val);
2231 if (size && *size) {
2236 if (name && *name) {
2250 * It is a handler who processes the SELECT tag.
2252 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2253 * destination is specified.
2254 * @param node [i] The SELECT tag node is specified.
2255 * @return The conversion result is returned.
2258 s_jhtml_end_select_tag(void *pdoc, Node *UNUSED(child))
2260 jhtml_t *jhtml = GET_JHTML(pdoc);
2261 Doc *doc = jhtml->doc;
2268 * It is a handler who processes the OPTION tag.
2270 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2271 * destination is specified.
2272 * @param node [i] The OPTION tag node is specified.
2273 * @return The conversion result is returned.
2276 s_jhtml_start_option_tag(void *pdoc, Node *child)
2278 jhtml_t *jhtml = GET_JHTML(pdoc);
2279 Doc *doc = jhtml->doc;
2282 char *selected = NULL;
2286 for (attr = qs_get_attr(doc,child);
2288 attr = qs_get_next_attr(doc,attr)) {
2289 char *nm = qs_get_attr_name(doc,attr);
2290 char *val = qs_get_attr_value(doc,attr);
2291 if (STRCASEEQ('s','S',"selected",nm)) {
2292 /*----------------------------------------------------------------------*/
2293 /* CHTML 1.0 version 2.0 */
2294 /*----------------------------------------------------------------------*/
2295 selected = apr_pstrdup(doc->buf.pool, val);
2297 else if (STRCASEEQ('v','V',"value",nm)) {
2298 /*----------------------------------------------------------------------*/
2299 /* CHTML 1.0 version 2.0 */
2300 /*----------------------------------------------------------------------*/
2301 value = apr_pstrdup(doc->buf.pool, val);
2318 * It is a handler who processes the OPTION tag.
2320 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2321 * destination is specified.
2322 * @param node [i] The OPTION tag node is specified.
2323 * @return The conversion result is returned.
2326 s_jhtml_end_option_tag(void *pdoc, Node *UNUSED(child))
2328 jhtml_t *jhtml = GET_JHTML(pdoc);
2335 * It is a handler who processes the DIV tag.
2337 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2338 * destination is specified.
2339 * @param node [i] The DIV tag node is specified.
2340 * @return The conversion result is returned.
2343 s_jhtml_start_div_tag(void *pdoc, Node *child)
2351 jhtml = GET_JHTML(pdoc);
2356 for (attr = qs_get_attr(doc,child);
2358 attr = qs_get_next_attr(doc,attr)) {
2359 char *nm = qs_get_attr_name(doc,attr);
2360 char *val = qs_get_attr_value(doc,attr);
2361 if (STRCASEEQ('a','A',"align",nm)) {
2362 /*----------------------------------------------------------------------*/
2363 /* CHTML 1.0 (W3C version 3.2) */
2364 /*----------------------------------------------------------------------*/
2365 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2366 align = apr_pstrdup(doc->buf.pool, val);
2381 * It is a handler who processes the DIV tag.
2383 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2384 * destination is specified.
2385 * @param node [i] The DIV tag node is specified.
2386 * @return The conversion result is returned.
2389 s_jhtml_end_div_tag(void *pdoc, Node *UNUSED(child))
2395 jhtml = GET_JHTML(pdoc);
2405 chxj_istyle_to_mode(apr_pool_t *p, const char *s)
2411 case '1': return apr_psprintf(p, "hiragana");
2412 case '2': return apr_psprintf(p, "hankakukana");
2413 case '3': return apr_psprintf(p, "alphabet");
2414 case '4': return apr_psprintf(p, "numeric");
2416 tmp = apr_palloc(p, 1);
2418 return apr_pstrdup(p, tmp);
2422 tmp = apr_palloc(p, 1);
2424 return apr_pstrdup(p,tmp);
2429 s_jhtml_chxjif_tag(void *pdoc, Node *node)
2436 jhtml = GET_JHTML(pdoc);
2440 for (child = qs_get_child_node(doc, node);
2442 child = qs_get_next_node(doc, child)) {
2444 s_jhtml_chxjif_tag(jhtml, child);
2451 * It is a handler who processes the TEXTARE tag.
2453 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2454 * destination is specified.
2455 * @param node [i] The TEXTAREA tag node is specified.
2456 * @return The conversion result is returned.
2459 s_jhtml_start_textarea_tag(void *pdoc, Node *node)
2466 jhtml = GET_JHTML(pdoc);
2470 jhtml->textarea_flag++;
2472 for (attr = qs_get_attr(doc,node);
2474 attr = qs_get_next_attr(doc,attr)) {
2475 char *name = qs_get_attr_name(doc,attr);
2476 char *value = qs_get_attr_value(doc,attr);
2477 if (STRCASEEQ('a','A',"accesskey",name) && value && *value != 0) {
2478 W_L(" accesskey=\"");
2482 else if (STRCASEEQ('i','I',"istyle", name) && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
2483 char *vv = chxj_istyle_to_mode(doc->buf.pool,value);
2488 else if (STRCASEEQ('n','N',"name", name) && value && *value) {
2493 else if (STRCASEEQ('r','R',"rows", name) && value && *value) {
2498 else if (STRCASEEQ('c','C',"cols", name) && value && *value) {
2510 * It is a handler who processes the TEXTAREA tag.
2512 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2513 * destination is specified.
2514 * @param node [i] The TEXTAREA tag node is specified.
2515 * @return The conversion result is returned.
2518 s_jhtml_end_textarea_tag(void *pdoc, Node *UNUSED(child))
2524 jhtml = GET_JHTML(pdoc);
2529 jhtml->textarea_flag--;
2536 * It is a handler who processes the B tag.
2538 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2539 * destination is specified.
2540 * @param node [i] The B tag node is specified.
2541 * @return The conversion result is returned.
2544 s_jhtml_start_b_tag(void* pdoc, Node* UNUSED(node))
2550 jhtml = GET_JHTML(pdoc);
2560 * It is a handler who processes the B tag.
2562 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2563 * destination is specified.
2564 * @param node [i] The B tag node is specified.
2565 * @return The conversion result is returned.
2568 s_jhtml_end_b_tag(void* pdoc, Node* UNUSED(child))
2570 jhtml_t* jhtml = GET_JHTML(pdoc);
2571 Doc* doc = jhtml->doc;
2578 s_jhtml_text_tag(void* pdoc, Node* child)
2590 jhtml = GET_JHTML(pdoc);
2593 DBG(r, "start s_jhtml_text_tag()");
2595 textval = qs_get_node_value(doc,child);
2596 if (strlen(textval) == 0) {
2600 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
2601 memset(tmp, 0, qs_get_node_size(doc,child)+1);
2603 tdst = qs_alloc_zero_byte_string(r->pool);
2604 memset(one_byte, 0, sizeof(one_byte));
2607 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
2609 int rtn = s_jhtml_search_emoji(jhtml, &textval[ii], &out);
2611 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
2616 if (is_sjis_kanji(textval[ii])) {
2617 one_byte[0] = textval[ii+0];
2618 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2619 one_byte[0] = textval[ii+1];
2620 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2624 if (jhtml->pre_flag) {
2625 one_byte[0] = textval[ii+0];
2626 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2629 if (jhtml->textarea_flag) {
2630 one_byte[0] = textval[ii+0];
2631 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2634 if (textval[ii] != '\r' && textval[ii] != '\n') {
2635 one_byte[0] = textval[ii+0];
2636 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2641 DBG(r, "end s_jhtml_text_tag()");
2647 * It is a handler who processes the BLOCKQUOTE tag.
2649 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2650 * destination is specified.
2651 * @param node [i] The BLOCKQUOTE tag node is specified.
2652 * @return The conversion result is returned.
2655 s_jhtml_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
2657 jhtml_t *jhtml = GET_JHTML(pdoc);
2658 Doc *doc = jhtml->doc;
2659 W_L("<blockquote>");
2665 * It is a handler who processes the BLOCKQUOTE tag.
2667 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2668 * destination is specified.
2669 * @param node [i] The BLOCKQUOTE tag node is specified.
2670 * @return The conversion result is returned.
2673 s_jhtml_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
2675 jhtml_t *jhtml = GET_JHTML(pdoc);
2676 Doc *doc = jhtml->doc;
2677 W_L("</blockquote>");
2683 * It is a handler who processes the DIR tag.
2685 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2686 * destination is specified.
2687 * @param node [i] The DIR tag node is specified.
2688 * @return The conversion result is returned.
2691 s_jhtml_start_dir_tag(void *pdoc, Node *UNUSED(child))
2693 jhtml_t *jhtml = GET_JHTML(pdoc);
2694 Doc *doc = jhtml->doc;
2701 * It is a handler who processes the DIR tag.
2703 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2704 * destination is specified.
2705 * @param node [i] The DIR tag node is specified.
2706 * @return The conversion result is returned.
2709 s_jhtml_end_dir_tag(void *pdoc, Node *UNUSED(child))
2711 jhtml_t *jhtml = GET_JHTML(pdoc);
2712 Doc *doc = jhtml->doc;
2719 * It is a handler who processes the DL tag.
2721 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2722 * destination is specified.
2723 * @param node [i] The DL tag node is specified.
2724 * @return The conversion result is returned.
2727 s_jhtml_start_dl_tag(void *pdoc, Node *UNUSED(child))
2729 jhtml_t *jhtml = GET_JHTML(pdoc);
2730 Doc *doc = jhtml->doc;
2737 * It is a handler who processes the DL tag.
2739 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2740 * destination is specified.
2741 * @param node [i] The DL tag node is specified.
2742 * @return The conversion result is returned.
2745 s_jhtml_end_dl_tag(void *pdoc, Node *UNUSED(child))
2747 jhtml_t *jhtml = GET_JHTML(pdoc);
2748 Doc *doc = jhtml->doc;
2755 * It is a handler who processes the DT tag.
2757 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2758 * destination is specified.
2759 * @param node [i] The DT tag node is specified.
2760 * @return The conversion result is returned.
2763 s_jhtml_start_dt_tag(void *pdoc, Node *UNUSED(child))
2765 jhtml_t *jhtml = GET_JHTML(pdoc);
2766 Doc *doc = jhtml->doc;
2773 * It is a handler who processes the DT tag.
2775 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2776 * destination is specified.
2777 * @param node [i] The DT tag node is specified.
2778 * @return The conversion result is returned.
2781 s_jhtml_end_dt_tag(void *pdoc, Node *UNUSED(child))
2783 jhtml_t *jhtml = GET_JHTML(pdoc);
2789 * It is a handler who processes the DD tag.
2791 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2792 * destination is specified.
2793 * @param node [i] The DD tag node is specified.
2794 * @return The conversion result is returned.
2797 s_jhtml_start_dd_tag(void *pdoc, Node *UNUSED(child))
2799 jhtml_t *jhtml = GET_JHTML(pdoc);
2800 Doc *doc = jhtml->doc;
2807 * It is a handler who processes the DD tag.
2809 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2810 * destination is specified.
2811 * @param node [i] The DD tag node is specified.
2812 * @return The conversion result is returned.
2815 s_jhtml_end_dd_tag(void *pdoc, Node *UNUSED(child))
2817 jhtml_t *jhtml = GET_JHTML(pdoc);
2823 * It is a handler who processes the H1 tag.
2825 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2826 * destination is specified.
2827 * @param node [i] The H1 tag node is specified.
2828 * @return The conversion result is returned.
2831 s_jhtml_start_h1_tag(void *pdoc, Node *node)
2839 jhtml = GET_JHTML(pdoc);
2843 for (attr = qs_get_attr(doc,node);
2845 attr = qs_get_next_attr(doc,attr)) {
2846 char *name = qs_get_attr_name(doc,attr);
2847 char *value = qs_get_attr_value(doc,attr);
2848 if (STRCASEEQ('a','A',"align", name)) {
2849 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2850 jhtml->h1_align_flag++;
2851 align = apr_pstrdup(doc->buf.pool, value);
2857 W_L("<div align=\"");
2866 * It is a handler who processes the H1 tag.
2868 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2869 * destination is specified.
2870 * @param node [i] The H1 tag node is specified.
2871 * @return The conversion result is returned.
2874 s_jhtml_end_h1_tag(void *pdoc, Node *UNUSED(child))
2880 jhtml = GET_JHTML(pdoc);
2884 if (jhtml->h1_align_flag) {
2885 jhtml->h1_align_flag--;
2893 * It is a handler who processes the H2 tag.
2895 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2896 * destination is specified.
2897 * @param node [i] The H1 tag node is specified.
2898 * @return The conversion result is returned.
2901 s_jhtml_start_h2_tag(void *pdoc, Node *node)
2909 jhtml = GET_JHTML(pdoc);
2913 for (attr = qs_get_attr(doc,node);
2915 attr = qs_get_next_attr(doc,attr)) {
2918 name = qs_get_attr_name(doc,attr);
2919 value = qs_get_attr_value(doc,attr);
2920 if (STRCASEEQ('a','A',"align", name)) {
2921 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2922 jhtml->h2_align_flag++;
2923 align = apr_pstrdup(doc->buf.pool, value);
2929 W_L("<div align=\"");
2938 * It is a handler who processes the H2 tag.
2940 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2941 * destination is specified.
2942 * @param node [i] The H1 tag node is specified.
2943 * @return The conversion result is returned.
2946 s_jhtml_end_h2_tag(void *pdoc, Node *UNUSED(child))
2952 jhtml = GET_JHTML(pdoc);
2956 if (jhtml->h2_align_flag) {
2957 jhtml->h2_align_flag--;
2965 * It is a handler who processes the H3 tag.
2967 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2968 * destination is specified.
2969 * @param node [i] The H1 tag node is specified.
2970 * @return The conversion result is returned.
2973 s_jhtml_start_h3_tag(void *pdoc, Node *node)
2981 jhtml = GET_JHTML(pdoc);
2985 for (attr = qs_get_attr(doc,node);
2987 attr = qs_get_next_attr(doc,attr)) {
2990 name = qs_get_attr_name(doc,attr);
2991 value = qs_get_attr_value(doc,attr);
2992 if (STRCASEEQ('a','A',"align", name)) {
2993 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2994 jhtml->h3_align_flag++;
2995 align = apr_pstrdup(doc->buf.pool, value);
3001 W_L("<div align=\"");
3010 * It is a handler who processes the H3 tag.
3012 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3013 * destination is specified.
3014 * @param node [i] The H1 tag node is specified.
3015 * @return The conversion result is returned.
3018 s_jhtml_end_h3_tag(void *pdoc, Node *UNUSED(child))
3024 jhtml = GET_JHTML(pdoc);
3028 if (jhtml->h3_align_flag) {
3029 jhtml->h3_align_flag--;
3037 * It is a handler who processes the H4 tag.
3039 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3040 * destination is specified.
3041 * @param node [i] The H1 tag node is specified.
3042 * @return The conversion result is returned.
3045 s_jhtml_start_h4_tag(void *pdoc, Node *node)
3053 jhtml = GET_JHTML(pdoc);
3057 for (attr = qs_get_attr(doc,node);
3059 attr = qs_get_next_attr(doc,attr)) {
3060 char *name = qs_get_attr_name(doc,attr);
3061 char *value = qs_get_attr_value(doc,attr);
3062 if (STRCASEEQ('a','A',"align", name)) {
3063 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
3064 jhtml->h4_align_flag++;
3065 align = apr_pstrdup(doc->buf.pool, value);
3071 W_L("<div align=\"");
3080 * It is a handler who processes the H4 tag.
3082 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3083 * destination is specified.
3084 * @param node [i] The H1 tag node is specified.
3085 * @return The conversion result is returned.
3088 s_jhtml_end_h4_tag(void *pdoc, Node *UNUSED(child))
3094 jhtml = GET_JHTML(pdoc);
3098 if (jhtml->h4_align_flag) {
3099 jhtml->h4_align_flag--;
3107 * It is a handler who processes the H5 tag.
3109 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3110 * destination is specified.
3111 * @param node [i] The H1 tag node is specified.
3112 * @return The conversion result is returned.
3115 s_jhtml_start_h5_tag(void *pdoc, Node *node)
3123 jhtml = GET_JHTML(pdoc);
3127 for (attr = qs_get_attr(doc,node);
3129 attr = qs_get_next_attr(doc,attr)) {
3130 char *name = qs_get_attr_name(doc,attr);
3131 char *value = qs_get_attr_value(doc,attr);
3132 if (STRCASEEQ('a','A',"align", name)) {
3133 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
3134 jhtml->h5_align_flag++;
3135 align = apr_pstrdup(doc->buf.pool, value);
3141 W_L("<div align=\"");
3150 * It is a handler who processes the H5 tag.
3152 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3153 * destination is specified.
3154 * @param node [i] The H1 tag node is specified.
3155 * @return The conversion result is returned.
3158 s_jhtml_end_h5_tag(void *pdoc, Node *UNUSED(child))
3164 jhtml = GET_JHTML(pdoc);
3168 if (jhtml->h5_align_flag) {
3169 jhtml->h5_align_flag--;
3177 * It is a handler who processes the H6 tag.
3179 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3180 * destination is specified.
3181 * @param node [i] The H1 tag node is specified.
3182 * @return The conversion result is returned.
3185 s_jhtml_start_h6_tag(void *pdoc, Node *node)
3193 jhtml = GET_JHTML(pdoc);
3197 for (attr = qs_get_attr(doc,node);
3199 attr = qs_get_next_attr(doc,attr)) {
3200 char *name = qs_get_attr_name(doc,attr);
3201 char *value = qs_get_attr_value(doc,attr);
3202 if (STRCASEEQ('a','A',"align", name)) {
3203 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
3204 jhtml->h6_align_flag++;
3205 align = apr_pstrdup(doc->buf.pool, value);
3211 W_L("<div align=\"");
3220 * It is a handler who processes the H6 tag.
3222 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3223 * destination is specified.
3224 * @param node [i] The H1 tag node is specified.
3225 * @return The conversion result is returned.
3228 s_jhtml_end_h6_tag(void *pdoc, Node *UNUSED(child))
3234 jhtml = GET_JHTML(pdoc);
3238 if (jhtml->h6_align_flag) {
3239 jhtml->h6_align_flag--;
3247 * It is a handler who processes the MENU tag.
3249 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3250 * destination is specified.
3251 * @param node [i] The MENU tag node is specified.
3252 * @return The conversion result is returned.
3255 s_jhtml_start_menu_tag(void *pdoc, Node *UNUSED(child))
3257 jhtml_t *jhtml = GET_JHTML(pdoc);
3258 Doc *doc = jhtml->doc;
3265 * It is a handler who processes the MENU tag.
3267 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3268 * destination is specified.
3269 * @param node [i] The MENU tag node is specified.
3270 * @return The conversion result is returned.
3273 s_jhtml_end_menu_tag(void *pdoc, Node *UNUSED(child))
3275 jhtml_t *jhtml = GET_JHTML(pdoc);
3276 Doc *doc = jhtml->doc;
3283 * It is a handler who processes the PLAINTEXT tag.
3285 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3286 * destination is specified.
3287 * @param node [i] The PLAINTEXT tag node is specified.
3288 * @return The conversion result is returned.
3291 s_jhtml_start_plaintext_tag(void *pdoc, Node *node)
3296 jhtml = GET_JHTML(pdoc);
3299 s_jhtml_start_plaintext_tag_inner(pdoc,node);
3304 s_jhtml_start_plaintext_tag_inner(void *pdoc, Node *node)
3309 jhtml = GET_JHTML(pdoc);
3311 for (child = qs_get_child_node(doc, node);
3313 child = qs_get_next_node(doc, child)) {
3315 s_jhtml_start_plaintext_tag_inner(pdoc, child);
3322 * It is a handler who processes the PLAINTEXT tag.
3324 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3325 * destination is specified.
3326 * @param node [i] The PLAINTEXT tag node is specified.
3327 * @return The conversion result is returned.
3330 s_jhtml_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3332 jhtml_t *jhtml = GET_JHTML(pdoc);
3338 * It is a handler who processes the BLINK tag.
3340 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3341 * destination is specified.
3342 * @param node [i] The BLINK tag node is specified.
3343 * @return The conversion result is returned.
3346 s_jhtml_start_blink_tag(void *pdoc, Node *UNUSED(child))
3348 jhtml_t *jhtml = GET_JHTML(pdoc);
3349 Doc *doc = jhtml->doc;
3356 * It is a handler who processes the BLINK tag.
3358 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3359 * destination is specified.
3360 * @param node [i] The BLINK tag node is specified.
3361 * @return The conversion result is returned.
3364 s_jhtml_end_blink_tag(void *pdoc, Node *UNUSED(child))
3366 jhtml_t *jhtml = GET_JHTML(pdoc);
3367 Doc *doc = jhtml->doc;
3374 * It is a handler who processes the MARQUEE tag.
3376 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3377 * destination is specified.
3378 * @param node [i] The MARQUEE tag node is specified.
3379 * @return The conversion result is returned.
3382 s_jhtml_start_marquee_tag(void *pdoc, Node *node)
3384 jhtml_t *jhtml = GET_JHTML(pdoc);
3385 Doc *doc = jhtml->doc;
3388 /*--------------------------------------------------------------------------*/
3389 /* Get Attributes */
3390 /*--------------------------------------------------------------------------*/
3391 for (attr = qs_get_attr(doc,node);
3393 attr = qs_get_next_attr(doc,attr)) {
3394 char *name = qs_get_attr_name(doc,attr);
3395 char *value = qs_get_attr_value(doc,attr);
3396 if (STRCASEEQ('d','D',"direction", name)) {
3397 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3398 W_L(" direction=\"");
3403 else if (STRCASEEQ('b','B',"behavior",name)) {
3406 else if (STRCASEEQ('l','L',"loop",name)) {
3416 * It is a handler who processes the MARQUEE tag.
3418 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3419 * destination is specified.
3420 * @param node [i] The MARQUEE tag node is specified.
3421 * @return The conversion result is returned.
3424 s_jhtml_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3426 jhtml_t *jhtml = GET_JHTML(pdoc);
3427 Doc *doc = jhtml->doc;
3434 * It is handler who processes the New Line Code.
3437 s_jhtml_newline_mark(void *pdoc, Node *UNUSED(node))
3439 jhtml_t *jhtml = GET_JHTML(pdoc);
3440 Doc *doc = jhtml->doc;