[Groonga-commit] groonga/groonga at dc17e63 [master] html_untag: support not escaped ">"

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Jun 26 18:32:13 JST 2013


Kouhei Sutou	2013-06-26 18:32:13 +0900 (Wed, 26 Jun 2013)

  New Revision: dc17e63d97833b08f352ad418f61b35e26916a6c
  https://github.com/groonga/groonga/commit/dc17e63d97833b08f352ad418f61b35e26916a6c

  Message:
    html_untag: support not escaped ">"

  Added files:
    test/command/suite/select/function/html_untag/not-escaped-gt.expected
    test/command/suite/select/function/html_untag/not-escaped-gt.test
  Modified files:
    lib/proc.c

  Modified: lib/proc.c (+5 -1)
===================================================================
--- lib/proc.c    2013-06-26 18:27:54 +0900 (9670ca6)
+++ lib/proc.c    2013-06-26 18:32:13 +0900 (b794151)
@@ -4066,7 +4066,11 @@ func_html_untag(grn_ctx *ctx, int nargs, grn_obj **args,
       in_tag = GRN_TRUE;
       break;
     case '>' :
-      in_tag = GRN_FALSE;
+      if (in_tag) {
+        in_tag = GRN_FALSE;
+      } else {
+        GRN_TEXT_PUTC(ctx, text, html_raw[i]);
+      }
       break;
     default :
       if (!in_tag) {

  Added: test/command/suite/select/function/html_untag/not-escaped-gt.expected (+11 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/function/html_untag/not-escaped-gt.expected    2013-06-26 18:32:13 +0900 (f8a9f37)
@@ -0,0 +1,11 @@
+table_create Entries TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Entries content COLUMN_SCALAR Text
+[[0,0.0,0.0],true]
+load --table Entries
+[
+{"content": "I <em>am</em> a boy. >:|"}
+]
+[[0,0.0,0.0],1]
+select Entries   --output_columns "html_untag(content)"   --command_version 2
+[[0,0.0,0.0],[[[1],[["html_untag","null"]],["I am a boy. >:|"]]]]

  Added: test/command/suite/select/function/html_untag/not-escaped-gt.test (+11 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/function/html_untag/not-escaped-gt.test    2013-06-26 18:32:13 +0900 (64e631d)
@@ -0,0 +1,11 @@
+table_create Entries TABLE_NO_KEY
+column_create Entries content COLUMN_SCALAR Text
+
+load --table Entries
+[
+{"content": "I <em>am</em> a boy. >:|"}
+]
+
+select Entries \
+  --output_columns "html_untag(content)" \
+  --command_version 2
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index