Navigation Menu

Skip to content

Commit

Permalink
html_untag: support not escaped ">"
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jun 26, 2013
1 parent 98e1ba1 commit dc17e63
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/proc.c
Expand Up @@ -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) {
Expand Down
@@ -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. >:|"]]]]
11 changes: 11 additions & 0 deletions test/command/suite/select/function/html_untag/not-escaped-gt.test
@@ -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

0 comments on commit dc17e63

Please sign in to comment.