From e1a7af4c9244c2bc4403ca78c54b8b35a0a98d32 Mon Sep 17 00:00:00 2001 From: "Mark H. Wilkinson" Date: Mon, 16 Oct 2017 14:40:07 +0100 Subject: [PATCH 1/2] Fix regression with rendering links in Markdown. --- src/core/components/providers/markdown.jsx | 1 + test/components/markdown.js | 6 ++++++ 2 files changed, 7 insertions(+) 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/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() { From 95002ba6e54fd1012b126a5876e1f198a78df071 Mon Sep 17 00:00:00 2001 From: Owen Conti Date: Thu, 19 Oct 2017 14:44:17 -0600 Subject: [PATCH 2/2] Fixes #3783 Remove extra styles for .renderedMarkdown content. --- src/style/_layout.scss | 8 -------- 1 file changed, 8 deletions(-) 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;