From 31907645373e7d41f8190a7e69a3949d8fcadd42 Mon Sep 17 00:00:00 2001 From: Vir Desai Date: Wed, 8 Jul 2020 17:56:25 -0400 Subject: [PATCH] changes to make headings markdown only if a space exists before the text --- src/rules.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/rules.js b/src/rules.js index 7598622..3da8fc7 100644 --- a/src/rules.js +++ b/src/rules.js @@ -2,6 +2,7 @@ /* eslint-disable react/no-array-index-key */ import React from 'react' import { Image, Linking, Text, View } from 'react-native' +import { blockRegex } from 'simple-markdown' export default styles => ({ autolink: { @@ -71,6 +72,7 @@ export default styles => ({ }, }, heading: { + match: blockRegex(/^ *(#{1,6}) ([^\n]+?)#* *(?:\n *)+\n/), react: (node, output, parentState) => { const state = { ...parentState } state.withinText = true