diff --git a/package.json b/package.json index 0ededa44..fe2099a5 100644 --- a/package.json +++ b/package.json @@ -98,8 +98,8 @@ "react-addons-css-transition-group": "^15.3.1", "react-datetime": "^2.6.0", "react-portal": "^2.2.1", - "react-toolbox": "^1.2.1", "react-simple-dnd": "^0.1.2", + "react-toolbox": "^1.2.1", "selection-position": "^1.0.0", "semaphore": "^1.0.5", "slate": "^0.13.6" diff --git a/src/components/Widgets/MarkitupReactRenderer.js b/src/components/Widgets/MarkitupReactRenderer.js index 364266bb..40923448 100644 --- a/src/components/Widgets/MarkitupReactRenderer.js +++ b/src/components/Widgets/MarkitupReactRenderer.js @@ -1,5 +1,6 @@ import React, { PropTypes } from 'react'; import MarkupIt, { Syntax, BLOCKS, STYLES, ENTITIES } from 'markup-it'; +import { pick } from 'lodash'; import htmlSyntax from 'markup-it/syntaxes/html'; const defaultSchema = { @@ -9,7 +10,7 @@ const defaultSchema = { [BLOCKS.BLOCKQUOTE]: 'blockquote', [BLOCKS.PARAGRAPH]: 'p', [BLOCKS.FOOTNOTE]: 'footnote', - [BLOCKS.HTML]: (token) => { + [BLOCKS.HTML]: ({ token }) => { return { + 'mediaproxy': ({ token }) => { const src = token.getIn(['data', 'src']); const alt = token.getIn(['data', 'alt']); return {alt}/; diff --git a/src/components/Widgets/__tests__/__snapshots__/MarkitupReactRenderer.spec.js.snap b/src/components/Widgets/__tests__/__snapshots__/MarkitupReactRenderer.spec.js.snap index 74658e3e..9562819e 100644 --- a/src/components/Widgets/__tests__/__snapshots__/MarkitupReactRenderer.spec.js.snap +++ b/src/components/Widgets/__tests__/__snapshots__/MarkitupReactRenderer.spec.js.snap @@ -4,7 +4,7 @@ exports[`MarkitupReactRenderer Markdown rendering Code should render code 1`] = exports[`MarkitupReactRenderer Markdown rendering Code should render code 2 1`] = `"

There is a literal backtick (\`) here.

"`; -exports[`MarkitupReactRenderer Markdown rendering General should render markdown 1`] = `"

H1

Text with bold & em elements

H2

H3

  1. ol item 1
  2. ol item 2
  3. ol item 3

H4

link title

H5

\"alt

H6
"`; +exports[`MarkitupReactRenderer Markdown rendering General should render markdown 1`] = `"

H1

Text with bold & em elements

H2

H3

  1. ol item 1
  2. ol item 2
  3. ol item 3

H4

link title

H5

\"alt

H6
"`; exports[`MarkitupReactRenderer Markdown rendering HTML should render HTML as is using Markdown 1`] = `"

Title

  • Test HTML content
  • Testing HTML in Markdown
"`; @@ -20,7 +20,7 @@ exports[`MarkitupReactRenderer Markdown rendering Headings should render Heading exports[`MarkitupReactRenderer Markdown rendering Headings should render Heading 6 1`] = `"
Title
"`; -exports[`MarkitupReactRenderer Markdown rendering Links should render links 1`] = `"

I get 10 times more traffic from Google than from Yahoo or MSN.

"`; +exports[`MarkitupReactRenderer Markdown rendering Links should render links 1`] = `"

I get 10 times more traffic from Google than from Yahoo or MSN.

"`; exports[`MarkitupReactRenderer Markdown rendering Lists should render lists 1`] = `"
  1. ol item 1
  2. ol item 2
    • Sublist 1
    • Sublist 2
    • Sublist 3
      1. Sub-Sublist 1
      2. Sub-Sublist 2
      3. Sub-Sublist 3
  3. ol item 3
"`;