diff --git a/src/components/Widgets/Markdown/MarkdownControl/VisualEditor/components.js b/src/components/Widgets/Markdown/MarkdownControl/VisualEditor/components.js
index 2f19dcc7..0c213884 100644
--- a/src/components/Widgets/Markdown/MarkdownControl/VisualEditor/components.js
+++ b/src/components/Widgets/Markdown/MarkdownControl/VisualEditor/components.js
@@ -1,4 +1,5 @@
import React from 'react';
+import { List } from 'immutable';
import cn from 'classnames';
import styles from './index.css';
@@ -34,10 +35,17 @@ export const NODE_COMPONENTS = {
'numbered-list': props =>
{props.children}
,
'link': props => {
+ // Need to wrap this in mark components for any marks found in data.
const data = props.node.get('data');
+ const marks = data.get('marks');
const url = data.get('url');
const title = data.get('title');
- return {props.children};
+ const link = {props.children};
+ const result = !marks ? link : marks.reduce((acc, mark) => {
+ const MarkComponent = MARK_COMPONENTS[mark.type];
+ return {acc};
+ }, link);
+ return result;
},
'shortcode': props => {
const { attributes, node, state: editorState } = props;
diff --git a/src/components/Widgets/Markdown/serializers/__tests__/slate.spec.js b/src/components/Widgets/Markdown/serializers/__tests__/slate.spec.js
new file mode 100644
index 00000000..0c9c4edc
--- /dev/null
+++ b/src/components/Widgets/Markdown/serializers/__tests__/slate.spec.js
@@ -0,0 +1,17 @@
+import { flow } from 'lodash';
+import { markdownToSlate, slateToMarkdown } from '../index';
+
+const process = flow([markdownToSlate, slateToMarkdown]);
+
+describe('slate', () => {
+ it('should distinguish between newlines and hard breaks', () => {
+ expect(process('a\n')).toEqual('a\n');
+ });
+ it('should not decode encoded html entities in inline code', () => {
+ expect(process('<div>
')).toEqual('<div>
\n');
+ });
+
+ it('should parse non-text children of mark nodes', () => {
+ expect(process('**[a](b)**')).toEqual('**[a](b)**');
+ });
+});