Fix undefined source error
This commit is contained in:
parent
13acb8ea0f
commit
bc02be51e1
1 changed files with 1 additions and 1 deletions
|
|
@ -4,7 +4,7 @@ import Marked from 'react-markdown'
|
|||
import { getImageSrc, getImageSrcset } from '../util/getImageUrl'
|
||||
import './Content.css'
|
||||
|
||||
const encodeMarkdownURIs = source => {
|
||||
const encodeMarkdownURIs = (source = '') => {
|
||||
const markdownLinkRegex = /\[(?:\[[^\]]*\]|[^[\]])*\]\([ \t]*<?((?:\([^)]*\)|[^()])*?)>?[ \t]*(['"].*?\6[ \t]*)?\)/g
|
||||
return source.replace(markdownLinkRegex, (match, linkURI) => {
|
||||
if (!linkURI) return match
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue