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/SyntacticSpan.tsx | |
parent | 9941754be106accd5ea8ce4b6f8229dd6f4afc9b (diff) | |
download | react-benzin-2c5fa193541eb8b74974731d01312f73951bca17.tar.gz |
style: correct some errors with eslint --fix
Diffstat (limited to 'src/lib/Markdown/SyntacticSpan.tsx')
-rw-r--r-- | src/lib/Markdown/SyntacticSpan.tsx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/Markdown/SyntacticSpan.tsx b/src/lib/Markdown/SyntacticSpan.tsx index f3c2125..bdce3f7 100644 --- a/src/lib/Markdown/SyntacticSpan.tsx +++ b/src/lib/Markdown/SyntacticSpan.tsx @@ -19,24 +19,24 @@ interface Emoji { const enclosureRegex = (e: string): RegexPair => ({ local: new RegExp(`${e}([^${e}]+)${e}`), - global: new RegExp(`(${e}[^${e}]+${e})`) + global: new RegExp(`(${e}[^${e}]+${e})`), }); const regex: Record<string, RegexPair> = { conceal: { global: /(!?\[.+?\]\(.+?\))(?!])/g, - local: /!?\[(.*\]?.*)\]\((.+?)\)/ + local: /!?\[(.*\]?.*)\]\((.+?)\)/, }, rawLink: { global: /((?:(?:[A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+$,\w]+@)?[A-Za-z0-9.-]+|(?:www\.|[-;:&=+$,\w]+@)[A-Za-z0-9.-]+)(?:(?:\/[+~%/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[.!/\\\w]*))?)/, - local: /&^/ + local: /&^/, }, emoji: enclosureRegex(':'), bold: enclosureRegex('\\*\\*'), italic: enclosureRegex('\\*'), code: enclosureRegex('`'), strikeThrough: enclosureRegex('~~'), -} +}; const splitter = new RegExp(Object.values(regex).map(pair => pair.global.source).join('|')); @@ -46,13 +46,13 @@ Object.keys(emojiLib).forEach(name => emojiList.push({ name, char: emojiLib[name const useStyles = makeStyles(theme => ({ code: { background: theme.palette.background.default, - borderRadius: theme.spacing(.5), - padding: theme.spacing(.5), + borderRadius: theme.spacing(0.5), + padding: theme.spacing(0.5), fontFamily: 'Monospace', }, image: { maxWidth: '100%', - maxHeight: '100%' + maxHeight: '100%', }, })); @@ -82,12 +82,12 @@ const SyntacticSpan: React.FC<PropTypes> = ({ span }) => { if (matchItalic) return <i>{matchItalic[1]}</i>; const matchStrikeThrough = span.match(regex.strikeThrough.local); - if (matchStrikeThrough) return <span style={{textDecoration: 'line-through' }}>{matchStrikeThrough[1]}</span>; + if (matchStrikeThrough) return <span style={{ textDecoration: 'line-through' }}>{matchStrikeThrough[1]}</span>; if (span.match(regex.rawLink.global)) return <Link href={span}>{span}</Link>; return <>{span}</>; -} +}; export { splitter }; |