From e1a7af4c9244c2bc4403ca78c54b8b35a0a98d32 Mon Sep 17 00:00:00 2001 From: "Mark H. Wilkinson" Date: Mon, 16 Oct 2017 14:40:07 +0100 Subject: [PATCH] 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() {