stop markdown shortcodes from being escaped

This commit is contained in:
Shawn Erquhart 2017-09-28 11:12:45 -04:00 committed by Benaiah Mischenko
parent a89427dd8b
commit 9fbdbf5171

View File

@ -1,4 +1,4 @@
import { flow, partial, flatMap, flatten, map } from 'lodash';
import { has, flow, partial, flatMap, flatten, map } from 'lodash';
import { joinPatternSegments, combinePatterns, replaceWhen } from '../../../../lib/regexHelper';
/**
@ -248,6 +248,12 @@ function escape(delim) {
*/
export default function remarkEscapeMarkdownEntities() {
const transform = (node, index) => {
/**
* Shortcode nodes will intentionally inject markdown entities in text node
* children not be escaped.
*/
if (has(node.data, 'shortcode')) return node;
const children = node.children && node.children.map(transform);
/**