diff --git a/.eslintrc b/.eslintrc index de8159ce..09f6fe2e 100644 --- a/.eslintrc +++ b/.eslintrc @@ -22,7 +22,7 @@ "rules": { "semi": [2, "never"], "strict": 0, - "quotes": 2, + "quotes": [2, "double", { "allowTemplateLiterals": true }], "no-unused-vars": 2, "no-multi-spaces": 1, "camelcase": 1, diff --git a/package.json b/package.json index d62bf41b..e84818b5 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "test": "npm run lint-errors && npm run just-test-in-node", "test-in-node": "npm run lint-errors && npm run just-test-in-node", "just-test": "karma start --config karma.conf.js", - "just-test-in-node": "mocha --recursive --compilers js:babel-core/register test/core test/components" + "just-test-in-node": "mocha --recursive --compilers js:babel-core/register test/core test/components test/bugs" }, "dependencies": { "babel-polyfill": "^6.23.0", diff --git a/src/core/components/providers/markdown.jsx b/src/core/components/providers/markdown.jsx index 361e4580..d058d176 100644 --- a/src/core/components/providers/markdown.jsx +++ b/src/core/components/providers/markdown.jsx @@ -2,8 +2,15 @@ import React, { PropTypes } from "react" import Remarkable from "react-remarkable" import sanitize from "sanitize-html" +const sanitizeOptions = { + textFilter: function(text) { + return text + .replace(/"/g, "\"") + } +} + function Markdown({ source }) { - const sanitized = sanitize(source) + const sanitized = sanitize(source, sanitizeOptions) return ) + + expect(el.find("code").first().text()).toEqual("{\"abc\": \"def\"}\n") + expect(el.find("code").first().html()).toEqual("{"abc": "def"}\n") + }) +})