From 36df121cf66b530d30beb6266ed897115b4fe350 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Mon, 27 Jan 2025 23:10:37 -0500 Subject: [PATCH] Lint --- client/homebrew/brewRenderer/brewRenderer.jsx | 12 ++++++------ client/homebrew/editor/editor.jsx | 2 +- shared/naturalcrit/markdown.js | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/client/homebrew/brewRenderer/brewRenderer.jsx b/client/homebrew/brewRenderer/brewRenderer.jsx index a4774523f..a11710433 100644 --- a/client/homebrew/brewRenderer/brewRenderer.jsx +++ b/client/homebrew/brewRenderer/brewRenderer.jsx @@ -40,7 +40,7 @@ const BrewPage = (props)=>{ ...props }; const pageRef = useRef(null); - let cleanText = safeHTML(props.contents); + const cleanText = safeHTML(props.contents); useEffect(()=>{ if(!pageRef.current) return; @@ -77,7 +77,7 @@ const BrewPage = (props)=>{ centerObserver.disconnect(); }; }, []); - + return
; @@ -185,11 +185,11 @@ const BrewRenderer = (props)=>{ return ; } else { if(pageText.startsWith('\\page')) { - let firstLineTokens = Markdown.marked.lexer(pageText.split('\n', 1)[0])[0].tokens; - let injectedTags = firstLineTokens.find(obj => obj.injectedTags !== undefined)?.injectedTags; + const firstLineTokens = Markdown.marked.lexer(pageText.split('\n', 1)[0])[0].tokens; + const injectedTags = firstLineTokens.find((obj)=>obj.injectedTags !== undefined)?.injectedTags; if(injectedTags) { - styles = {...styles, ...injectedTags.styles}; - styles = _.mapKeys(styles, (v, k) => _.camelCase(k)); // Convert CSS to camelCase for React + styles = { ...styles, ...injectedTags.styles }; + styles = _.mapKeys(styles, (v, k)=>_.camelCase(k)); // Convert CSS to camelCase for React attributes = injectedTags.attributes; } pageText = pageText.includes('\n') ? pageText.substring(pageText.indexOf('\n') + 1) : ''; // Remove the \page line diff --git a/client/homebrew/editor/editor.jsx b/client/homebrew/editor/editor.jsx index fc2813f38..f56b18618 100644 --- a/client/homebrew/editor/editor.jsx +++ b/client/homebrew/editor/editor.jsx @@ -193,7 +193,7 @@ const Editor = createClass({ (this.props.renderer == 'V3' && line.match(/^(?=\\page(?:{[^\n{}]+})?$)/))) { if(lineNumber > 0) // Since \page is optional on first line of document, - editorPageCount += 1; // don't use it to increment page count; stay at 1 + editorPageCount += 1; // don't use it to increment page count; stay at 1 // add back the original class 'background' but also add the new class '.pageline' codeMirror.addLineClass(lineNumber, 'background', 'pageLine'); diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index ab19d06ba..99766b536 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -1002,7 +1002,7 @@ const Markdown = { }); return errors; - } + }, }; export default Markdown;