ext/yajl/yajl_ext.c in yajl-ruby-1.4.0 vs ext/yajl/yajl_ext.c in yajl-ruby-1.4.1

- old
+ new

@@ -1028,13 +1028,18 @@ memcpy(indentString, RSTRING_PTR(indent), RSTRING_LEN(indent)); indentString[RSTRING_LEN(indent)] = '\0'; actualIndent = indentString; } } + if (rb_hash_aref(opts, sym_html_safe) == Qtrue) { htmlSafe = 1; } + + if (rb_hash_aref(opts, sym_entities) == Qtrue) { + htmlSafe = 2; + } } if (!indentString) { indentString = defaultIndentString; } cfg = (yajl_gen_config){beautify, (const char *)indentString, htmlSafe}; @@ -1354,9 +1359,10 @@ sym_allow_comments = ID2SYM(rb_intern("allow_comments")); sym_check_utf8 = ID2SYM(rb_intern("check_utf8")); sym_pretty = ID2SYM(rb_intern("pretty")); sym_indent = ID2SYM(rb_intern("indent")); sym_html_safe = ID2SYM(rb_intern("html_safe")); + sym_entities = ID2SYM(rb_intern("entities")); sym_terminator = ID2SYM(rb_intern("terminator")); sym_symbolize_keys = ID2SYM(rb_intern("symbolize_keys")); sym_symbolize_names = ID2SYM(rb_intern("symbolize_names")); #ifdef HAVE_RUBY_ENCODING_H