当我在 json 数据的 rails 中使用 strip_tags 剥离 html 标签时,它返回错误的数据:
the original data is: "<p><em><span style=\"font-size: 96px; \">test</span></em></p>"
data.to_json is: "\"<p><em><span style=\\\"font-size: 96px; \\\">\\u9ed1\\u4f53\\u5b57\\u54e6</span></em></p>\""
the stripped data that after strip_tags is: "\""
谁能告诉我原因或其他解决方案?