OSDN Git Service

* Added <plaintext> tag for au XHTML converter.
authorkonn <konn@1a406e8e-add9-4483-a2c8-d8cac5b7c224>
Mon, 14 Apr 2008 12:26:42 +0000 (12:26 +0000)
committerkonn <konn@1a406e8e-add9-4483-a2c8-d8cac5b7c224>
Mon, 14 Apr 2008 12:26:42 +0000 (12:26 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/modchxj/mod_chxj/branches/RELEASE_0_11_0@2258 1a406e8e-add9-4483-a2c8-d8cac5b7c224

src/chxj_xhtml_mobile_1_0.c

index 4ca5c8d..929cc6d 100644 (file)
@@ -106,6 +106,9 @@ static char *s_xhtml_1_0_start_dd_tag        (void *pdoc, Node *node);
 static char *s_xhtml_1_0_end_dd_tag          (void *pdoc, Node *node);
 static char *s_xhtml_1_0_start_menu_tag      (void *pdoc, Node *node);
 static char *s_xhtml_1_0_end_menu_tag        (void *pdoc, Node *node);
+static char *s_xhtml_1_0_start_plaintext_tag       (void *pdoc, Node *node);
+static char *s_xhtml_1_0_start_plaintext_tag_inner (void *pdoc, Node *node);
+static char *s_xhtml_1_0_end_plaintext_tag         (void *pdoc, Node *node);
 
 static void  s_init_xhtml(xhtml_t *xhtml, Doc *doc, request_rec *r, device_table *spec);
 static int   s_xhtml_search_emoji(xhtml_t *xhtml, char *txt, char **rslt);
@@ -365,8 +368,8 @@ tag_handler xhtml_handler[] = {
   },
   /* tagPLAINTEXT */
   {
-    NULL,
-    NULL,
+    s_xhtml_1_0_start_plaintext_tag,
+    s_xhtml_1_0_end_plaintext_tag,
   },
   /* tagBLINK */
   {
@@ -2923,6 +2926,61 @@ s_xhtml_1_0_end_menu_tag(void *pdoc, Node *UNUSED(child))
   W_L("</menu>");
   return xhtml->out;
 }
+
+
+/**
+ * It is a handler who processes the PLAINTEXT tag.
+ *
+ * @param pdoc  [i/o] The pointer to the XHTML structure at the output
+ *                     destination is specified.
+ * @param node   [i]   The PLAINTEXT tag node is specified.
+ * @return The conversion result is returned.
+ */
+static char *
+s_xhtml_1_0_start_plaintext_tag(void *pdoc, Node *node)
+{
+  xhtml_t *xhtml;
+  Doc *doc;
+
+  xhtml = GET_XHTML(pdoc);
+  doc     = xhtml->doc;
+  W_L("<plaintext>");
+  s_xhtml_1_0_start_plaintext_tag_inner(pdoc,node);
+  return xhtml->out;
+}
+
+static char *
+s_xhtml_1_0_start_plaintext_tag_inner(void *pdoc, Node *node)
+{
+  xhtml_t *xhtml;
+  Doc *doc;
+  Node *child;
+  xhtml = GET_XHTML(pdoc);
+  doc     = xhtml->doc;
+  for (child = qs_get_child_node(doc, node);
+       child;
+       child = qs_get_next_node(doc, child)) {
+    W_V(child->otext);
+    s_xhtml_1_0_start_plaintext_tag_inner(pdoc, child);
+  }
+  return xhtml->out;
+}
+
+
+/**
+ * It is a handler who processes the PLAINTEXT tag.
+ *
+ * @param pdoc  [i/o] The pointer to the XHTML structure at the output
+ *                     destination is specified.
+ * @param node   [i]   The PLAINTEXT tag node is specified.
+ * @return The conversion result is returned.
+ */
+static char *
+s_xhtml_1_0_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
+{
+  xhtml_t *xhtml = GET_XHTML(pdoc);
+  return xhtml->out;
+}
 /*
  * vim:ts=2 et
  */