diff --git a/src/core/components/providers/markdown.jsx b/src/core/components/providers/markdown.jsx index 2ef8b6a6..35ad0c5f 100644 --- a/src/core/components/providers/markdown.jsx +++ b/src/core/components/providers/markdown.jsx @@ -31,6 +31,7 @@ export default Markdown const sanitizeOptions = { allowedTags: sanitize.defaults.allowedTags.concat([ "h1", "h2", "img" ]), allowedAttributes: { + ...sanitize.defaults.allowedAttributes, "img": sanitize.defaults.allowedAttributes.img.concat(["title"]) }, textFilter: function(text) { diff --git a/src/style/_layout.scss b/src/style/_layout.scss index 95584a7c..e0d40550 100644 --- a/src/style/_layout.scss +++ b/src/style/_layout.scss @@ -768,14 +768,6 @@ } } -.renderedMarkdown { - p { - @include text_body(); - margin-top: 0px; - margin-bottom: 0px; - } -} - .response-content-type { padding-top: 1em; diff --git a/test/components/markdown.js b/test/components/markdown.js index 01a55e1c..65b80c0e 100644 --- a/test/components/markdown.js +++ b/test/components/markdown.js @@ -24,6 +24,12 @@ describe("Markdown component", function() { const el = render() expect(el.html()).toEqual(`

h1

\n

h2

\n

h3

\n

h4

\n
h5
\n
h6
\n
`) }) + + it("allows links", function() { + const str = `[Link](https://example.com/)` + const el = render() + expect(el.html()).toEqual(``) + }) }) describe("OAS 3", function() {