diff options
author | eug-vs <eug-vs@keemail.me> | 2020-04-18 20:26:32 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-04-18 20:26:32 +0300 |
commit | 2c5fa193541eb8b74974731d01312f73951bca17 (patch) | |
tree | 4cbc833a14487543d9ef38e66f6028d82f3978af /src/lib/Markdown/Markdown.tsx | |
parent | 9941754be106accd5ea8ce4b6f8229dd6f4afc9b (diff) | |
download | react-benzin-2c5fa193541eb8b74974731d01312f73951bca17.tar.gz |
style: correct some errors with eslint --fix
Diffstat (limited to 'src/lib/Markdown/Markdown.tsx')
-rw-r--r-- | src/lib/Markdown/Markdown.tsx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/Markdown/Markdown.tsx b/src/lib/Markdown/Markdown.tsx index 82e889c..68967c5 100644 --- a/src/lib/Markdown/Markdown.tsx +++ b/src/lib/Markdown/Markdown.tsx @@ -10,8 +10,8 @@ interface PropTypes { const resolveUrls = (line: string, baseUrl: string): string => { return line.replace(/src="(?!http)(.*)"[\s>]/, (match, url, offset, string) => `src="${baseUrl}/${url}?sanitize=true"`) - .replace(/\[(.*\]?.*)\]\((?!http)(.+?)\)/, (match, text, url, offset, string) => `[${text}](${baseUrl}/${url})`); -} + .replace(/\[(.*\]?.*)\]\((?!http)(.+?)\)/, (match, text, url, offset, string) => `[${text}](${baseUrl}/${url})`); +}; const Markdown: React.FC<PropTypes> = ({ data, url }) => { const [markdown, setMarkdown] = useState<string>(data || ''); @@ -24,7 +24,7 @@ const Markdown: React.FC<PropTypes> = ({ data, url }) => { const baseUrl = url?.slice(0, url.lastIndexOf('/')) || ''; const lines = markdown.split(/\r?\n/).map(line => resolveUrls(line, baseUrl)); - return <Section rawLines={lines} /> + return <Section rawLines={lines} />; }; |