From eebc9c2bfae935072a49453a50ae390829140ac0 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Wed, 22 Jan 2025 15:04:33 -0500 Subject: [PATCH 01/32] commit changes so far --- client/homebrew/brewRenderer/brewRenderer.jsx | 23 +++++++++++++++++-- shared/naturalcrit/markdown.js | 19 ++++++++++++++- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/client/homebrew/brewRenderer/brewRenderer.jsx b/client/homebrew/brewRenderer/brewRenderer.jsx index 17f261c2d..529605a40 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); - const cleanText = safeHTML(props.contents); + let cleanText = safeHTML(props.contents); useEffect(()=>{ if(!pageRef.current) return; @@ -78,6 +78,20 @@ const BrewPage = (props)=>{ }; }, []); + // Extract any page styles from `\page{cssProp:value}` + if(cleanText.match(/^ { + const [key, value] = curr.split(':').map(item => item.trim()); + const camelCaseKey = key.replace(/-([a-z])/g, g => g[1].toUpperCase()); //Convert to camelCase for React + acc[camelCaseKey] = value; + return acc; + }, {}); + + props.style = {...props.style, ...styleObject}; + cleanText = cleanText.substring(cleanText.indexOf('\n')); + } + return
; @@ -126,7 +140,7 @@ const BrewRenderer = (props)=>{ if(props.renderer == 'legacy') { rawPages = props.text.split('\\page'); } else { - rawPages = props.text.split(/^\\page$/gm); + rawPages = props.text.split(/^(?=\\page(?:{[^\n{}]+})?$)/gm); } const handlePageVisibilityChange = (pageNum, isVisible, isCenter)=>{ @@ -183,6 +197,11 @@ const BrewRenderer = (props)=>{ return ; } else { + let pageText2 = pageText.substring(0, pageText.indexOf('\n')); + let butt = Markdown.marked.lexer(pageText2); + console.log(butt) + + pageText += `\n\n \n\\column\n `; //Artificial column break at page end to emulate column-fill:auto (until `wide` is used, when column-fill:balance will reappear) const html = Markdown.render(pageText, index); diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index c2aa89fb5..78eef8ebd 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -527,6 +527,21 @@ const definitionListsMultiLine = { } }; +const pageBreak = { + name : 'pageBreak', + level : 'block', + start(src) { return src.match(/\n\\page/m)?.index; }, // Hint to Marked.js to stop and check for a match + tokenizer(src) { + const regex = /^\\page(?:$|(?={[^\n{}]+}$))/m; + const match = regex.exec(src); + if(match?.length) + return { type : 'pageBreak', raw : match[0] }; + }, + renderer(token) { + return `\n`; + } +}; + //v=====--------------------< Variable Handling >-------------------=====v// 242 lines const replaceVar = function(input, hoist=false, allowUnresolved=false) { const regex = /([!$]?)\[((?!\s*\])(?:\\.|[^\[\]\\])+)\]/g; @@ -795,7 +810,7 @@ const tableTerminators = [ ]; Marked.use(MarkedVariables()); -Marked.use({ extensions : [justifiedParagraphs, definitionListsMultiLine, definitionListsSingleLine, forcedParagraphBreaks, +Marked.use({ extensions : [pageBreak, justifiedParagraphs, definitionListsMultiLine, definitionListsSingleLine, forcedParagraphBreaks, nonbreakingSpaces, superSubScripts, mustacheSpans, mustacheDivs, mustacheInjectInline] }); Marked.use(mustacheInjectBlock); Marked.use({ renderer: renderer, tokenizer: tokenizer, mangle: false }); @@ -992,6 +1007,8 @@ const Markdown = { return errors; }, + + extractHTMLStyleTags : extractHTMLStyleTags }; export default Markdown; From 0ac981586f0f2bb4a6713f7e8b69989aa52a0ff4 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Fri, 24 Jan 2025 01:16:22 -0500 Subject: [PATCH 02/32] Clean up --- client/homebrew/brewRenderer/brewRenderer.jsx | 35 ++++++++----------- shared/naturalcrit/markdown.js | 21 ++--------- 2 files changed, 16 insertions(+), 40 deletions(-) diff --git a/client/homebrew/brewRenderer/brewRenderer.jsx b/client/homebrew/brewRenderer/brewRenderer.jsx index 529605a40..a4774523f 100644 --- a/client/homebrew/brewRenderer/brewRenderer.jsx +++ b/client/homebrew/brewRenderer/brewRenderer.jsx @@ -77,22 +77,8 @@ const BrewPage = (props)=>{ centerObserver.disconnect(); }; }, []); - - // Extract any page styles from `\page{cssProp:value}` - if(cleanText.match(/^ { - const [key, value] = curr.split(':').map(item => item.trim()); - const camelCaseKey = key.replace(/-([a-z])/g, g => g[1].toUpperCase()); //Convert to camelCase for React - acc[camelCaseKey] = value; - return acc; - }, {}); - - props.style = {...props.style, ...styleObject}; - cleanText = cleanText.substring(cleanText.indexOf('\n')); - } - return
+ return
; }; @@ -187,25 +173,32 @@ const BrewRenderer = (props)=>{ const renderPage = (pageText, index)=>{ - const styles = { + let styles = { ...(!displayOptions.pageShadows ? { boxShadow: 'none' } : {}) // Add more conditions as needed }; + let attributes = {}; if(props.renderer == 'legacy') { const html = MarkdownLegacy.render(pageText); return ; } else { - let pageText2 = pageText.substring(0, pageText.indexOf('\n')); - let butt = Markdown.marked.lexer(pageText2); - console.log(butt) - + 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; + if(injectedTags) { + 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 + } pageText += `\n\n \n\\column\n `; //Artificial column break at page end to emulate column-fill:auto (until `wide` is used, when column-fill:balance will reappear) const html = Markdown.render(pageText, index); - return ; + return ; } }; diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index c0feef234..ab19d06ba 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -527,21 +527,6 @@ const definitionListsMultiLine = { } }; -const pageBreak = { - name : 'pageBreak', - level : 'block', - start(src) { return src.match(/\n\\page/m)?.index; }, // Hint to Marked.js to stop and check for a match - tokenizer(src) { - const regex = /^\\page(?:$|(?={[^\n{}]+}$))/m; - const match = regex.exec(src); - if(match?.length) - return { type : 'pageBreak', raw : match[0] }; - }, - renderer(token) { - return `\n`; - } -}; - //v=====--------------------< Variable Handling >-------------------=====v// 242 lines const replaceVar = function(input, hoist=false, allowUnresolved=false) { const regex = /([!$]?)\[((?!\s*\])(?:\\.|[^\[\]\\])+)\]/g; @@ -810,7 +795,7 @@ const tableTerminators = [ ]; Marked.use(MarkedVariables()); -Marked.use({ extensions : [pageBreak, justifiedParagraphs, definitionListsMultiLine, definitionListsSingleLine, forcedParagraphBreaks, +Marked.use({ extensions : [justifiedParagraphs, definitionListsMultiLine, definitionListsSingleLine, forcedParagraphBreaks, nonbreakingSpaces, superSubScripts, mustacheSpans, mustacheDivs, mustacheInjectInline] }); Marked.use(mustacheInjectBlock); Marked.use({ renderer: renderer, tokenizer: tokenizer, mangle: false }); @@ -1017,9 +1002,7 @@ const Markdown = { }); return errors; - }, - - extractHTMLStyleTags : extractHTMLStyleTags + } }; export default Markdown; From 9f8831eed620fb28ee3b5cda22bffa032b76c192 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Fri, 24 Jan 2025 01:16:55 -0500 Subject: [PATCH 03/32] Adjust display and page count when first line has \page --- client/homebrew/editor/editor.jsx | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/client/homebrew/editor/editor.jsx b/client/homebrew/editor/editor.jsx index bba5f3ad9..3bda5f989 100644 --- a/client/homebrew/editor/editor.jsx +++ b/client/homebrew/editor/editor.jsx @@ -126,15 +126,15 @@ const Editor = createClass({ }, updateCurrentCursorPage : function(cursor) { - const lines = this.props.brew.text.split('\n').slice(0, cursor.line + 1); - const pageRegex = this.props.brew.renderer == 'V3' ? /^\\page$/ : /\\page/; + const lines = this.props.brew.text.split('\n').slice(1, cursor.line + 1); + const pageRegex = this.props.brew.renderer == 'V3' ? /^(?=\\page(?:{[^\n{}]+})?$)/ : /\\page/; const currentPage = lines.reduce((count, line)=>count + (pageRegex.test(line) ? 1 : 0), 1); this.props.onCursorPageChange(currentPage); }, updateCurrentViewPage : function(topScrollLine) { - const lines = this.props.brew.text.split('\n').slice(0, topScrollLine + 1); - const pageRegex = this.props.brew.renderer == 'V3' ? /^\\page$/ : /\\page/; + const lines = this.props.brew.text.split('\n').slice(1, topScrollLine + 1); + const pageRegex = this.props.brew.renderer == 'V3' ? /^(?=\\page(?:{[^\n{}]+})?$)/ : /\\page/; const currentPage = lines.reduce((count, line)=>count + (pageRegex.test(line) ? 1 : 0), 1); this.props.onViewPageChange(currentPage); }, @@ -174,7 +174,7 @@ const Editor = createClass({ for (let i=customHighlights.length - 1;i>=0;i--) customHighlights[i].clear(); - let editorPageCount = 2; // start page count from page 2 + let editorPageCount = 1; // start page count from page 1 _.forEach(this.props.brew.text.split('\n'), (line, lineNumber)=>{ @@ -190,7 +190,10 @@ const Editor = createClass({ // Styling for \page breaks if((this.props.renderer == 'legacy' && line.includes('\\page')) || - (this.props.renderer == 'V3' && line.match(/^\\page$/))) { + (this.props.renderer == 'V3' && line.match(/^(?=\\page(?:{[^\n{}]+})?$)/))) { + + if(lineNumber > 1) // Since \page is optional on first line of document, + 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'); @@ -199,8 +202,6 @@ const Editor = createClass({ textContent : editorPageCount }); codeMirror.setBookmark({ line: lineNumber, ch: line.length }, pageCountElement); - - editorPageCount += 1; }; // New Codemirror styling for V3 renderer @@ -358,7 +359,7 @@ const Editor = createClass({ if(!this.isText() || isJumping) return; - const textSplit = this.props.renderer == 'V3' ? /^\\page$/gm : /\\page/; + const textSplit = this.props.renderer == 'V3' ? /^(?=\\page(?:{[^\n{}]+})?$)/gm : /\\page/; const textString = this.props.brew.text.split(textSplit).slice(0, targetPage-1).join(textSplit); const targetLine = textString.match('\n') ? textString.split('\n').length - 1 : -1; From 7610466ee455a05cf11d1210e7828519796408f8 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Fri, 24 Jan 2025 01:48:18 -0500 Subject: [PATCH 04/32] Off by 1 error --- client/homebrew/editor/editor.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/homebrew/editor/editor.jsx b/client/homebrew/editor/editor.jsx index 3bda5f989..fc2813f38 100644 --- a/client/homebrew/editor/editor.jsx +++ b/client/homebrew/editor/editor.jsx @@ -192,7 +192,7 @@ const Editor = createClass({ if((this.props.renderer == 'legacy' && line.includes('\\page')) || (this.props.renderer == 'V3' && line.match(/^(?=\\page(?:{[^\n{}]+})?$)/))) { - if(lineNumber > 1) // Since \page is optional on first line of document, + 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 // add back the original class 'background' but also add the new class '.pageline' From 36df121cf66b530d30beb6266ed897115b4fe350 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Mon, 27 Jan 2025 23:10:37 -0500 Subject: [PATCH 05/32] 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; From f1ff032e1e42041c53743255c9140d1346a99f12 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Mon, 27 Jan 2025 23:24:25 -0500 Subject: [PATCH 06/32] Extract repeated pagebreak regex into a constant --- client/homebrew/editor/editor.jsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/client/homebrew/editor/editor.jsx b/client/homebrew/editor/editor.jsx index f56b18618..9a88efca5 100644 --- a/client/homebrew/editor/editor.jsx +++ b/client/homebrew/editor/editor.jsx @@ -12,7 +12,8 @@ const MetadataEditor = require('./metadataEditor/metadataEditor.jsx'); const EDITOR_THEME_KEY = 'HOMEBREWERY-EDITOR-THEME'; -const SNIPPETBAR_HEIGHT = 25; +const PAGEBREAK_REGEX_V3 = /^(?=\\page(?:{[^\n{}]+})?$)/m; +const SNIPPETBAR_HEIGHT = 25; const DEFAULT_STYLE_TEXT = dedent` /*=======--- Example CSS styling ---=======*/ /* Any CSS here will apply to your document! */ @@ -21,6 +22,8 @@ const DEFAULT_STYLE_TEXT = dedent` color: black; }`; + + let isJumping = false; const Editor = createClass({ @@ -127,14 +130,14 @@ const Editor = createClass({ updateCurrentCursorPage : function(cursor) { const lines = this.props.brew.text.split('\n').slice(1, cursor.line + 1); - const pageRegex = this.props.brew.renderer == 'V3' ? /^(?=\\page(?:{[^\n{}]+})?$)/ : /\\page/; + const pageRegex = this.props.brew.renderer == 'V3' ? PAGEBREAK_REGEX_V3 : /\\page/; const currentPage = lines.reduce((count, line)=>count + (pageRegex.test(line) ? 1 : 0), 1); this.props.onCursorPageChange(currentPage); }, updateCurrentViewPage : function(topScrollLine) { const lines = this.props.brew.text.split('\n').slice(1, topScrollLine + 1); - const pageRegex = this.props.brew.renderer == 'V3' ? /^(?=\\page(?:{[^\n{}]+})?$)/ : /\\page/; + const pageRegex = this.props.brew.renderer == 'V3' ? PAGEBREAK_REGEX_V3 : /\\page/; const currentPage = lines.reduce((count, line)=>count + (pageRegex.test(line) ? 1 : 0), 1); this.props.onViewPageChange(currentPage); }, @@ -190,7 +193,7 @@ const Editor = createClass({ // Styling for \page breaks if((this.props.renderer == 'legacy' && line.includes('\\page')) || - (this.props.renderer == 'V3' && line.match(/^(?=\\page(?:{[^\n{}]+})?$)/))) { + (this.props.renderer == 'V3' && line.match(PAGEBREAK_REGEX_V3))) { 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 @@ -359,7 +362,7 @@ const Editor = createClass({ if(!this.isText() || isJumping) return; - const textSplit = this.props.renderer == 'V3' ? /^(?=\\page(?:{[^\n{}]+})?$)/gm : /\\page/; + const textSplit = this.props.renderer == 'V3' ? PAGEBREAK_REGEX_V3 : /\\page/; const textString = this.props.brew.text.split(textSplit).slice(0, targetPage-1).join(textSplit); const targetLine = textString.match('\n') ? textString.split('\n').length - 1 : -1; From be18843b092003cbf729b888d2a5a6f910f8daf9 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Mon, 27 Jan 2025 23:27:03 -0500 Subject: [PATCH 07/32] Allow empty braces: \page{} --- client/homebrew/brewRenderer/brewRenderer.jsx | 2 +- client/homebrew/editor/editor.jsx | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/client/homebrew/brewRenderer/brewRenderer.jsx b/client/homebrew/brewRenderer/brewRenderer.jsx index a11710433..7210a65d0 100644 --- a/client/homebrew/brewRenderer/brewRenderer.jsx +++ b/client/homebrew/brewRenderer/brewRenderer.jsx @@ -126,7 +126,7 @@ const BrewRenderer = (props)=>{ if(props.renderer == 'legacy') { rawPages = props.text.split('\\page'); } else { - rawPages = props.text.split(/^(?=\\page(?:{[^\n{}]+})?$)/gm); + rawPages = props.text.split(/^(?=\\page(?:{[^\n{}]*})?$)/gm); } const handlePageVisibilityChange = (pageNum, isVisible, isCenter)=>{ diff --git a/client/homebrew/editor/editor.jsx b/client/homebrew/editor/editor.jsx index 9a88efca5..20cb8968c 100644 --- a/client/homebrew/editor/editor.jsx +++ b/client/homebrew/editor/editor.jsx @@ -12,7 +12,7 @@ const MetadataEditor = require('./metadataEditor/metadataEditor.jsx'); const EDITOR_THEME_KEY = 'HOMEBREWERY-EDITOR-THEME'; -const PAGEBREAK_REGEX_V3 = /^(?=\\page(?:{[^\n{}]+})?$)/m; +const PAGEBREAK_REGEX_V3 = /^(?=\\page(?:{[^\n{}]*})?$)/m; const SNIPPETBAR_HEIGHT = 25; const DEFAULT_STYLE_TEXT = dedent` /*=======--- Example CSS styling ---=======*/ @@ -22,8 +22,6 @@ const DEFAULT_STYLE_TEXT = dedent` color: black; }`; - - let isJumping = false; const Editor = createClass({ From 6dfd44e2f12e3daa5e94c91c25e3f9f4457095f1 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Wed, 29 Jan 2025 11:48:18 -0500 Subject: [PATCH 08/32] Allow spaces between `\page` and `{}` Consistent behavior with other curly injections --- client/homebrew/brewRenderer/brewRenderer.jsx | 5 ++--- client/homebrew/editor/editor.jsx | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/client/homebrew/brewRenderer/brewRenderer.jsx b/client/homebrew/brewRenderer/brewRenderer.jsx index 7210a65d0..fd88af403 100644 --- a/client/homebrew/brewRenderer/brewRenderer.jsx +++ b/client/homebrew/brewRenderer/brewRenderer.jsx @@ -17,10 +17,9 @@ const dedent = require('dedent-tabs').default; const { printCurrentBrew } = require('../../../shared/helpers.js'); import HeaderNav from './headerNav/headerNav.jsx'; - import { safeHTML } from './safeHTML.js'; - +const PAGEBREAK_REGEX_V3 = /^(?=\\page(?: *{[^\n{}]*})?$)/m; const PAGE_HEIGHT = 1056; const INITIAL_CONTENT = dedent` @@ -126,7 +125,7 @@ const BrewRenderer = (props)=>{ if(props.renderer == 'legacy') { rawPages = props.text.split('\\page'); } else { - rawPages = props.text.split(/^(?=\\page(?:{[^\n{}]*})?$)/gm); + rawPages = props.text.split(PAGEBREAK_REGEX_V3); } const handlePageVisibilityChange = (pageNum, isVisible, isCenter)=>{ diff --git a/client/homebrew/editor/editor.jsx b/client/homebrew/editor/editor.jsx index 20cb8968c..2d0a26268 100644 --- a/client/homebrew/editor/editor.jsx +++ b/client/homebrew/editor/editor.jsx @@ -12,7 +12,7 @@ const MetadataEditor = require('./metadataEditor/metadataEditor.jsx'); const EDITOR_THEME_KEY = 'HOMEBREWERY-EDITOR-THEME'; -const PAGEBREAK_REGEX_V3 = /^(?=\\page(?:{[^\n{}]*})?$)/m; +const PAGEBREAK_REGEX_V3 = /^(?=\\page(?: *{[^\n{}]*})?$)/m; const SNIPPETBAR_HEIGHT = 25; const DEFAULT_STYLE_TEXT = dedent` /*=======--- Example CSS styling ---=======*/ From d0a06b5cf755472841c039a56659087d77ef82a7 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Wed, 29 Jan 2025 12:00:36 -0500 Subject: [PATCH 09/32] Fix class injection --- client/homebrew/brewRenderer/brewRenderer.jsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/homebrew/brewRenderer/brewRenderer.jsx b/client/homebrew/brewRenderer/brewRenderer.jsx index fd88af403..e15cec3bb 100644 --- a/client/homebrew/brewRenderer/brewRenderer.jsx +++ b/client/homebrew/brewRenderer/brewRenderer.jsx @@ -176,6 +176,7 @@ const BrewRenderer = (props)=>{ ...(!displayOptions.pageShadows ? { boxShadow: 'none' } : {}) // Add more conditions as needed }; + let classes = 'page'; let attributes = {}; if(props.renderer == 'legacy') { @@ -187,8 +188,9 @@ const BrewRenderer = (props)=>{ 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 + classes = [classes, injectedTags.classes].join(' ').trim(); attributes = injectedTags.attributes; } pageText = pageText.includes('\n') ? pageText.substring(pageText.indexOf('\n') + 1) : ''; // Remove the \page line @@ -197,7 +199,7 @@ const BrewRenderer = (props)=>{ pageText += `\n\n \n\\column\n `; //Artificial column break at page end to emulate column-fill:auto (until `wide` is used, when column-fill:balance will reappear) const html = Markdown.render(pageText, index); - return ; + return ; } }; From 7f4a304f04bc0323bd00bbb6630ec24d5e865cdf Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Wed, 29 Jan 2025 12:10:50 -0500 Subject: [PATCH 10/32] Fix custom CSS variables --- client/homebrew/brewRenderer/brewRenderer.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/homebrew/brewRenderer/brewRenderer.jsx b/client/homebrew/brewRenderer/brewRenderer.jsx index e15cec3bb..a82ea8b34 100644 --- a/client/homebrew/brewRenderer/brewRenderer.jsx +++ b/client/homebrew/brewRenderer/brewRenderer.jsx @@ -189,7 +189,7 @@ const BrewRenderer = (props)=>{ 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 = _.mapKeys(styles, (v, k) => k.startsWith('--') ? k : _.camelCase(k)); // Convert CSS to camelCase for React classes = [classes, injectedTags.classes].join(' ').trim(); attributes = injectedTags.attributes; } From d8d403ffb8887a27124e736dfae19005a77cd6bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Thu, 30 Jan 2025 18:54:27 +0100 Subject: [PATCH 11/32] Update to v3.17.0 --- changelog.md | 45 ++++++++++++++++++++++++++++++++++ package-lock.json | 61 ++--------------------------------------------- package.json | 2 +- 3 files changed, 48 insertions(+), 60 deletions(-) diff --git a/changelog.md b/changelog.md index 3736ba9b0..723b5f1b2 100644 --- a/changelog.md +++ b/changelog.md @@ -85,6 +85,51 @@ pre { ## changelog For a full record of development, visit our [Github Page](https://github.com/naturalcrit/homebrewery). +### Thursday 01/30/2024 - v3.17.0 + +{{tasklist +##### 5e-Cleric + +- Update FAQ +- Fix styling for Vault buttons and checkboxes +- Improve navigation bar styling +- Add author renaming backend functions +- Fix malformed URI error when generating Reddit links +- Refactor User Page's Brew item component +- Refactor Share Page +- Refactor `dialog` notifications (with calculuschild and G-Ambatte) + +##### dbolack + +- Fix page shadows toolbar option - fixes issue [#3919](https://github.com/naturalcrit/homebrewery/issues/3919) +- Add Markdown for non-breaking spaces (` :>>> `) +- Update Docker install instructions - fixes issue [#1930](https://github.com/naturalcrit/homebrewery/issues/1930) +- Fix incorrect state update call - fixes issue [#3974](https://github.com/naturalcrit/homebrewery/issues/3974) +- Allow CSS inject directly in page by doing: `/page{}` - fixes issue [#3901](https://github.com/naturalcrit/homebrewery/issues/3901) With calculuschild +- Update Ubuntu install instructions - fixes issue [#1952](https://github.com/naturalcrit/homebrewery/issues/1952) +- Add align paragraph markdown (`:-: text`) + +##### G-Ambatte + +- Correct obsolete tag data - fixes issue [#3927](https://github.com/naturalcrit/homebrewery/issues/3927) +- Stop admin user being added as an author when updating brews via admin tools - fixes issue [#3952](https://github.com/naturalcrit/homebrewery/issues/3952) +- Add steps to refresh Google token to error page - fixes issue [#3955](https://github.com/naturalcrit/homebrewery/issues/3955) +- Add navigation by header/ID menu + +##### calculuschild + +- Fetch Google brews using user auth instead of service account - fixes issue [#2954](https://github.com/naturalcrit/homebrewery/issues/2954) +- Fix content negotiation middleware and tests - fixes issue [#3904](https://github.com/naturalcrit/homebrewery/issues/3904) +- Add Emojis testing +- Fix `toWellFormed() is not a function` for Win 7 users +- Add `content-visibility` property to decrease reflow time on large brews + +##### Gazook89 + +- Use Intersection Observers to detect on-screen pages - fixes issue [#3824](https://github.com/naturalcrit/homebrewery/issues/3824) + +}} + ### Wednesday 11/27/2024 - v3.16.1 {{taskList diff --git a/package-lock.json b/package-lock.json index 281c24b1f..1697ccc35 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "homebrewery", - "version": "3.16.1", + "version": "3.17.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "homebrewery", - "version": "3.16.1", + "version": "3.17.0", "hasInstallScript": true, "license": "MIT", "dependencies": { @@ -3837,16 +3837,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "license": "MIT", - "optional": true, - "dependencies": { - "file-uri-to-path": "1.0.0" - } - }, "node_modules/bn.js": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", @@ -6337,13 +6327,6 @@ "node": ">=16.0.0" } }, - "node_modules/file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", - "license": "MIT", - "optional": true - }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", @@ -6517,20 +6500,6 @@ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "license": "ISC" }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", @@ -10365,13 +10334,6 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, - "node_modules/nan": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.20.0.tgz", - "integrity": "sha512-bk3gXBZDGILuuo/6sKtr0DQmSThYHLtNCdSdXk9YkxD/jK6X2vmCyyXBBxyqZ4XcnzTyYEAThfX3DCEnLf6igw==", - "license": "MIT", - "optional": true - }, "node_modules/nanoid": { "version": "5.0.9", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.0.9.tgz", @@ -14429,25 +14391,6 @@ "node": ">=0.10.0" } }, - "node_modules/watchify/node_modules/fsevents": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", - "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", - "deprecated": "The v1 package contains DANGEROUS / INSECURE binaries. Upgrade to safe fsevents v2", - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "dependencies": { - "bindings": "^1.5.0", - "nan": "^2.12.1" - }, - "engines": { - "node": ">= 4.0" - } - }, "node_modules/watchify/node_modules/glob-parent": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", diff --git a/package.json b/package.json index 840975977..854f0c2f7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "homebrewery", "description": "Create authentic looking D&D homebrews using only markdown", - "version": "3.16.1", + "version": "3.17.0", "type": "module", "engines": { "npm": "^10.2.x", From d733b1f8f83b3bc43819ddef90872ae58314d8bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Thu, 30 Jan 2025 20:02:34 +0100 Subject: [PATCH 12/32] reformat changelog --- changelog.md | 90 +++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 65 insertions(+), 25 deletions(-) diff --git a/changelog.md b/changelog.md index 723b5f1b2..c6e712105 100644 --- a/changelog.md +++ b/changelog.md @@ -90,43 +90,83 @@ For a full record of development, visit our [Github Page](https://github.com/nat {{tasklist ##### 5e-Cleric -- Update FAQ -- Fix styling for Vault buttons and checkboxes -- Improve navigation bar styling -- Add author renaming backend functions -- Fix malformed URI error when generating Reddit links -- Refactor User Page's Brew item component -- Refactor Share Page -- Refactor `dialog` notifications (with calculuschild and G-Ambatte) +* [x] Update FAQ + +* [x] Fix styling for Vault buttons and checkboxes + +* [x] Improve navigation bar styling + +* [x] Add author renaming backend functions + +* [x] Fix malformed URI error when generating Reddit links + +* [x] Refactor User Page's Brew item component + +* [x] Refactor Share Page + +* [x] Refactor `dialog` notifications (with calculuschild and G-Ambatte) ##### dbolack -- Fix page shadows toolbar option - fixes issue [#3919](https://github.com/naturalcrit/homebrewery/issues/3919) -- Add Markdown for non-breaking spaces (` :>>> `) -- Update Docker install instructions - fixes issue [#1930](https://github.com/naturalcrit/homebrewery/issues/1930) -- Fix incorrect state update call - fixes issue [#3974](https://github.com/naturalcrit/homebrewery/issues/3974) -- Allow CSS inject directly in page by doing: `/page{}` - fixes issue [#3901](https://github.com/naturalcrit/homebrewery/issues/3901) With calculuschild -- Update Ubuntu install instructions - fixes issue [#1952](https://github.com/naturalcrit/homebrewery/issues/1952) -- Add align paragraph markdown (`:-: text`) +* [x] Fix page shadows toolbar option + +Fixes issue [#3919](https://github.com/naturalcrit/homebrewery/issues/3919) + +* [x] Add Markdown for non-breaking spaces (` :>>> `) + +* [x] Update Docker install instructions + +Fixes issue [#1930](https://github.com/naturalcrit/homebrewery/issues/1930) + +* [x] Fix incorrect state update call + +Fixes issue [#3974](https://github.com/naturalcrit/homebrewery/issues/3974) + +* [x] Allow CSS inject directly in page by doing: `/page{}` + +Fixes issue [#3901](https://github.com/naturalcrit/homebrewery/issues/3901) With calculuschild + +* [x] Update Ubuntu install instructions + +Fixes issue [#1952](https://github.com/naturalcrit/homebrewery/issues/1952) + +* [x] Add align paragraph markdown (`:-: text`) ##### G-Ambatte -- Correct obsolete tag data - fixes issue [#3927](https://github.com/naturalcrit/homebrewery/issues/3927) -- Stop admin user being added as an author when updating brews via admin tools - fixes issue [#3952](https://github.com/naturalcrit/homebrewery/issues/3952) -- Add steps to refresh Google token to error page - fixes issue [#3955](https://github.com/naturalcrit/homebrewery/issues/3955) -- Add navigation by header/ID menu +* [x] Correct obsolete tag data + +Fixes issue [#3927](https://github.com/naturalcrit/homebrewery/issues/3927) + +* [x] Stop admin user being added as an author when updating brews via admin tools + +Fixes issue [#3952](https://github.com/naturalcrit/homebrewery/issues/3952) + +* [x] Add steps to refresh Google token to error page + +Fixes issue [#3955](https://github.com/naturalcrit/homebrewery/issues/3955) + +* [x] Add navigation by header/ID menu ##### calculuschild -- Fetch Google brews using user auth instead of service account - fixes issue [#2954](https://github.com/naturalcrit/homebrewery/issues/2954) -- Fix content negotiation middleware and tests - fixes issue [#3904](https://github.com/naturalcrit/homebrewery/issues/3904) -- Add Emojis testing -- Fix `toWellFormed() is not a function` for Win 7 users -- Add `content-visibility` property to decrease reflow time on large brews +* [x] Fetch Google brews using user auth instead of service account + +Fixes issue [#2954](https://github.com/naturalcrit/homebrewery/issues/2954) + +* [x] Fix content negotiation middleware and tests + +Fixes issue [#3904](https://github.com/naturalcrit/homebrewery/issues/3904) + +* [x] Add Emojis testing + +* [x] Fix `toWellFormed() is not a function` for Win 7 users + +* [x] Add `content-visibility` property to decrease reflow time on large brews ##### Gazook89 -- Use Intersection Observers to detect on-screen pages - fixes issue [#3824](https://github.com/naturalcrit/homebrewery/issues/3824) +* [x] Use Intersection Observers to detect on-screen pages - fixes issue [#3824](https://github.com/naturalcrit/homebrewery/issues/3824) }} From f005cb784f2c57119f03f462fde3b7101af8b59b Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Thu, 30 Jan 2025 14:18:26 -0500 Subject: [PATCH 13/32] Update changelog.md --- changelog.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index c6e712105..89cb73e41 100644 --- a/changelog.md +++ b/changelog.md @@ -166,7 +166,9 @@ Fixes issue [#3904](https://github.com/naturalcrit/homebrewery/issues/3904) ##### Gazook89 -* [x] Use Intersection Observers to detect on-screen pages - fixes issue [#3824](https://github.com/naturalcrit/homebrewery/issues/3824) +* [x] Use Intersection Observers to detect on-screen pages + +Fixes issue [#3824](https://github.com/naturalcrit/homebrewery/issues/3824) }} From e4df577a322a5ed47c13f2f5dae13f292a37c7b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Thu, 30 Jan 2025 23:33:49 +0100 Subject: [PATCH 14/32] remove internal changes --- changelog.md | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/changelog.md b/changelog.md index c6e712105..facf8d647 100644 --- a/changelog.md +++ b/changelog.md @@ -96,16 +96,10 @@ For a full record of development, visit our [Github Page](https://github.com/nat * [x] Improve navigation bar styling -* [x] Add author renaming backend functions +* [x] Add author renaming feature * [x] Fix malformed URI error when generating Reddit links -* [x] Refactor User Page's Brew item component - -* [x] Refactor Share Page - -* [x] Refactor `dialog` notifications (with calculuschild and G-Ambatte) - ##### dbolack * [x] Fix page shadows toolbar option @@ -118,13 +112,9 @@ Fixes issue [#3919](https://github.com/naturalcrit/homebrewery/issues/3919) Fixes issue [#1930](https://github.com/naturalcrit/homebrewery/issues/1930) -* [x] Fix incorrect state update call +* [x] Allow CSS inject directly in page by doing: `/page{}` (With calculuschild) -Fixes issue [#3974](https://github.com/naturalcrit/homebrewery/issues/3974) - -* [x] Allow CSS inject directly in page by doing: `/page{}` - -Fixes issue [#3901](https://github.com/naturalcrit/homebrewery/issues/3901) With calculuschild +Fixes issue [#3901](https://github.com/naturalcrit/homebrewery/issues/3901) * [x] Update Ubuntu install instructions @@ -134,15 +124,11 @@ Fixes issue [#1952](https://github.com/naturalcrit/homebrewery/issues/1952) ##### G-Ambatte -* [x] Correct obsolete tag data +* [x] Fix crash when opening brew Properties tab Fixes issue [#3927](https://github.com/naturalcrit/homebrewery/issues/3927) -* [x] Stop admin user being added as an author when updating brews via admin tools - -Fixes issue [#3952](https://github.com/naturalcrit/homebrewery/issues/3952) - -* [x] Add steps to refresh Google token to error page +* [x] Show credentials error when oportune Fixes issue [#3955](https://github.com/naturalcrit/homebrewery/issues/3955) @@ -150,15 +136,7 @@ Fixes issue [#3955](https://github.com/naturalcrit/homebrewery/issues/3955) ##### calculuschild -* [x] Fetch Google brews using user auth instead of service account - -Fixes issue [#2954](https://github.com/naturalcrit/homebrewery/issues/2954) - -* [x] Fix content negotiation middleware and tests - -Fixes issue [#3904](https://github.com/naturalcrit/homebrewery/issues/3904) - -* [x] Add Emojis testing +* [x] Add CMM and emojis tests * [x] Fix `toWellFormed() is not a function` for Win 7 users From 37d56f736537147f79c797ab2d7aa5f9ae1614c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Thu, 30 Jan 2025 23:35:42 +0100 Subject: [PATCH 15/32] compile removed items --- changelog.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/changelog.md b/changelog.md index 521ef39a4..926d213ef 100644 --- a/changelog.md +++ b/changelog.md @@ -148,6 +148,10 @@ Fixes issue [#3955](https://github.com/naturalcrit/homebrewery/issues/3955) Fixes issue [#3824](https://github.com/naturalcrit/homebrewery/issues/3824) + +##### All +* [x] Update dependencies and scripts +* [x] Refactor components and fix various errors }} ### Wednesday 11/27/2024 - v3.16.1 From 8848c06b15cb4d3d7a80b5867308ee35a3ae1b78 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Thu, 30 Jan 2025 22:37:55 -0500 Subject: [PATCH 16/32] Rewording. Add more detailed examples. Add Table width syntax --- changelog.md | 55 +++++++++++++++++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 18 deletions(-) diff --git a/changelog.md b/changelog.md index 926d213ef..8cfb499f6 100644 --- a/changelog.md +++ b/changelog.md @@ -77,17 +77,20 @@ pre { } .varSyntaxTable th:first-of-type { - width:6cm; + width:6cm; +} + +.page .exampleTable td,th { + border:1px dashed #00000030; } ``` - ## changelog For a full record of development, visit our [Github Page](https://github.com/naturalcrit/homebrewery). ### Thursday 01/30/2024 - v3.17.0 -{{tasklist +{{taskList ##### 5e-Cleric * [x] Update FAQ @@ -96,9 +99,9 @@ For a full record of development, visit our [Github Page](https://github.com/nat * [x] Improve navigation bar styling -* [x] Add author renaming feature +* [x] Add feature to change username at https://www.naturalcrit.com/account -* [x] Fix malformed URI error when generating Reddit links +* [x] Fix Reddit link crash when title has non-latin chars ##### dbolack @@ -106,13 +109,13 @@ For a full record of development, visit our [Github Page](https://github.com/nat Fixes issue [#3919](https://github.com/naturalcrit/homebrewery/issues/3919) -* [x] Add Markdown for non-breaking spaces (` :>>> `) +* [x] Add `:>>>` syntax for horizontal :>>>>> spaces * [x] Update Docker install instructions Fixes issue [#1930](https://github.com/naturalcrit/homebrewery/issues/1930) -* [x] Allow CSS inject directly in page by doing: `/page{}` (With calculuschild) +* [x] Allow styling pages via `\page{myStyles}` (with calculuschild) Fixes issue [#3901](https://github.com/naturalcrit/homebrewery/issues/3901) @@ -120,7 +123,24 @@ Fixes issue [#3901](https://github.com/naturalcrit/homebrewery/issues/3901) Fixes issue [#1952](https://github.com/naturalcrit/homebrewery/issues/1952) -* [x] Add align paragraph markdown (`:-: text`) +* [x] Add `:-:` `:-` `-:` syntax for paragraph alignment, similar to table column alignment; for example: + +-: -: Right-aligned + +:-: :-: Centered + +* [x] Add `:-- 50% --:` syntax to allow setting table column widths by percentage; for example: +``` +| Narrow | Wide | +|:- 10% -:|:-90%--:| +| Cell | Cell | +``` + + +| Narrow | Wide | +|:- 10% -:|:-90%--:| +|Cell | Cell | +{exampleTable} ##### G-Ambatte @@ -128,32 +148,29 @@ Fixes issue [#1952](https://github.com/naturalcrit/homebrewery/issues/1952) Fixes issue [#3927](https://github.com/naturalcrit/homebrewery/issues/3927) -* [x] Show credentials error when oportune +* [x] Update error pages with steps to refresh credentials Fixes issue [#3955](https://github.com/naturalcrit/homebrewery/issues/3955) -* [x] Add navigation by header/ID menu +* [x] Add {{openSans :fas_rectangle_list: **NAVIGATION**}} menu to the viewer toolbar ##### calculuschild -* [x] Add CMM and emojis tests - -* [x] Fix `toWellFormed() is not a function` for Win 7 users - -* [x] Add `content-visibility` property to decrease reflow time on large brews +* [x] Reduce display lag on large brews ##### Gazook89 -* [x] Use Intersection Observers to detect on-screen pages +* [x] Smarter detection of current page number Fixes issue [#3824](https://github.com/naturalcrit/homebrewery/issues/3824) - ##### All * [x] Update dependencies and scripts * [x] Refactor components and fix various errors }} +\column + ### Wednesday 11/27/2024 - v3.16.1 {{taskList @@ -200,6 +217,8 @@ Fixes issue [#3744](https://github.com/naturalcrit/homebrewery/issues/3744) * [x] Multiple code refactors, cleanups, and security fixes }} +\page + ### Saturday 10/12/2024 - v3.16.0 {{taskList @@ -2122,4 +2141,4 @@ Massive changelog incoming: * Added `phb.standalone.css` plus a build system for creating it * Added page numbers and footer text -* Page accent now flips each page +* Page accent now flips each page \ No newline at end of file From 23944f4fe05e0a133fb99d4260db7bae2d4bbd6f Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Fri, 31 Jan 2025 00:03:44 -0500 Subject: [PATCH 17/32] smartypants package updated to support higher Marked versions Next Marked versions break things; need to update incrementally --- package-lock.json | 18 +++++++++--------- package.json | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1697ccc35..0889af57e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,11 +34,11 @@ "jwt-simple": "^0.5.6", "less": "^3.13.1", "lodash": "^4.17.21", - "marked": "11.2.0", + "marked": "12.0.0", "marked-emoji": "^1.4.3", "marked-extended-tables": "^1.1.0", "marked-gfm-heading-id": "^3.2.0", - "marked-smartypants-lite": "^1.0.2", + "marked-smartypants-lite": "^1.0.3", "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.30.1", "mongoose": "^8.9.5", @@ -9788,9 +9788,9 @@ } }, "node_modules/marked": { - "version": "11.2.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-11.2.0.tgz", - "integrity": "sha512-HR0m3bvu0jAPYiIvLUUQtdg1g6D247//lvcekpHO1WMvbwDlwSkZAX9Lw4F4YHE1T0HaaNve0tuAWuV1UJ6vtw==", + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-12.0.0.tgz", + "integrity": "sha512-Vkwtq9rLqXryZnWaQc86+FHLC6tr/fycMfYAhiOIXkrNmeGAyhSxjqu0Rs1i0bBqw5u0S7+lV9fdH2ZSVaoa0w==", "license": "MIT", "bin": { "marked": "bin/marked.js" @@ -9828,12 +9828,12 @@ } }, "node_modules/marked-smartypants-lite": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/marked-smartypants-lite/-/marked-smartypants-lite-1.0.2.tgz", - "integrity": "sha512-cEANts+s3+gnTzXPvPT2z4V8NfbMEL9QooKUviug0DkaKkXQWrUwDAmFnQAkLSJCw2BQcD8YPDyxu0HJ3mg36w==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/marked-smartypants-lite/-/marked-smartypants-lite-1.0.3.tgz", + "integrity": "sha512-OOL8cjFog8KtgUFpkihRu6G42Dz2QPOU4k2xfKmMJ0CdoX+BHBDmdesHUdoQKM0mlwTsRSU3shpMeM/LWuUokg==", "license": "MIT", "peerDependencies": { - "marked": ">=4 <12" + "marked": ">=4 <16" } }, "node_modules/markedLegacy": { diff --git a/package.json b/package.json index 854f0c2f7..3ad7ac233 100644 --- a/package.json +++ b/package.json @@ -109,11 +109,11 @@ "jwt-simple": "^0.5.6", "less": "^3.13.1", "lodash": "^4.17.21", - "marked": "11.2.0", + "marked": "12.0.0", "marked-emoji": "^1.4.3", "marked-extended-tables": "^1.1.0", "marked-gfm-heading-id": "^3.2.0", - "marked-smartypants-lite": "^1.0.2", + "marked-smartypants-lite": "^1.0.3", "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.30.1", "mongoose": "^8.9.5", From 4e0b6d634dbc70dce49177c30419c4154df0d16a Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Fri, 31 Jan 2025 00:12:13 -0500 Subject: [PATCH 18/32] Marked 12.0.1 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0889af57e..79d4a210a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,7 +34,7 @@ "jwt-simple": "^0.5.6", "less": "^3.13.1", "lodash": "^4.17.21", - "marked": "12.0.0", + "marked": "12.0.1", "marked-emoji": "^1.4.3", "marked-extended-tables": "^1.1.0", "marked-gfm-heading-id": "^3.2.0", @@ -9788,9 +9788,9 @@ } }, "node_modules/marked": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-12.0.0.tgz", - "integrity": "sha512-Vkwtq9rLqXryZnWaQc86+FHLC6tr/fycMfYAhiOIXkrNmeGAyhSxjqu0Rs1i0bBqw5u0S7+lV9fdH2ZSVaoa0w==", + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/marked/-/marked-12.0.1.tgz", + "integrity": "sha512-Y1/V2yafOcOdWQCX0XpAKXzDakPOpn6U0YLxTJs3cww6VxOzZV1BTOOYWLvH3gX38cq+iLwljHHTnMtlDfg01Q==", "license": "MIT", "bin": { "marked": "bin/marked.js" diff --git a/package.json b/package.json index 3ad7ac233..985435ff6 100644 --- a/package.json +++ b/package.json @@ -109,7 +109,7 @@ "jwt-simple": "^0.5.6", "less": "^3.13.1", "lodash": "^4.17.21", - "marked": "12.0.0", + "marked": "12.0.1", "marked-emoji": "^1.4.3", "marked-extended-tables": "^1.1.0", "marked-gfm-heading-id": "^3.2.0", From b1e99f1385ec8bc4efa744e61405a761953e1e06 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Fri, 31 Jan 2025 00:16:37 -0500 Subject: [PATCH 19/32] Marked 12.0.2 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 79d4a210a..8142ef89d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,7 +34,7 @@ "jwt-simple": "^0.5.6", "less": "^3.13.1", "lodash": "^4.17.21", - "marked": "12.0.1", + "marked": "12.0.2", "marked-emoji": "^1.4.3", "marked-extended-tables": "^1.1.0", "marked-gfm-heading-id": "^3.2.0", @@ -9788,9 +9788,9 @@ } }, "node_modules/marked": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/marked/-/marked-12.0.1.tgz", - "integrity": "sha512-Y1/V2yafOcOdWQCX0XpAKXzDakPOpn6U0YLxTJs3cww6VxOzZV1BTOOYWLvH3gX38cq+iLwljHHTnMtlDfg01Q==", + "version": "12.0.2", + "resolved": "https://registry.npmjs.org/marked/-/marked-12.0.2.tgz", + "integrity": "sha512-qXUm7e/YKFoqFPYPa3Ukg9xlI5cyAtGmyEIzMfW//m6kXwCy2Ps9DYf5ioijFKQ8qyuscrHoY04iJGctu2Kg0Q==", "license": "MIT", "bin": { "marked": "bin/marked.js" diff --git a/package.json b/package.json index 985435ff6..fe77b3e17 100644 --- a/package.json +++ b/package.json @@ -109,7 +109,7 @@ "jwt-simple": "^0.5.6", "less": "^3.13.1", "lodash": "^4.17.21", - "marked": "12.0.1", + "marked": "12.0.2", "marked-emoji": "^1.4.3", "marked-extended-tables": "^1.1.0", "marked-gfm-heading-id": "^3.2.0", From e87acc3f0f66b8bce7c228b9cf07ae3def719528 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 05:17:57 +0000 Subject: [PATCH 20/32] Bump dompurify from 3.2.3 to 3.2.4 Bumps [dompurify](https://github.com/cure53/DOMPurify) from 3.2.3 to 3.2.4. - [Release notes](https://github.com/cure53/DOMPurify/releases) - [Commits](https://github.com/cure53/DOMPurify/compare/3.2.3...3.2.4) --- updated-dependencies: - dependency-name: dompurify dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 9 +++++---- package.json | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8142ef89d..af0d9e14d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,7 @@ "cors": "^2.8.5", "create-react-class": "^15.7.0", "dedent-tabs": "^0.10.3", - "dompurify": "^3.2.3", + "dompurify": "^3.2.4", "expr-eval": "^2.0.2", "express": "^4.21.2", "express-async-handler": "^1.2.0", @@ -5313,9 +5313,10 @@ } }, "node_modules/dompurify": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.2.3.tgz", - "integrity": "sha512-U1U5Hzc2MO0oW3DF+G9qYN0aT7atAou4AgI0XjWz061nyBPbdxkfdhfy5uMgGn6+oLFCfn44ZGbdDqCzVmlOWA==", + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.2.4.tgz", + "integrity": "sha512-ysFSFEDVduQpyhzAob/kkuJjf5zWkZD8/A9ywSp1byueyuCfHamrCBa14/Oc2iiB0e51B+NpxSl5gmzn+Ms/mg==", + "license": "(MPL-2.0 OR Apache-2.0)", "optionalDependencies": { "@types/trusted-types": "^2.0.7" } diff --git a/package.json b/package.json index fe77b3e17..2ef557033 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,7 @@ "cors": "^2.8.5", "create-react-class": "^15.7.0", "dedent-tabs": "^0.10.3", - "dompurify": "^3.2.3", + "dompurify": "^3.2.4", "expr-eval": "^2.0.2", "express": "^4.21.2", "express-async-handler": "^1.2.0", From 7e826cd4f5629e517af0cd1c44ebd7b5c482ef7e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 05:22:30 +0000 Subject: [PATCH 21/32] Bump react-router from 7.1.3 to 7.1.4 Bumps [react-router](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router) from 7.1.3 to 7.1.4. - [Release notes](https://github.com/remix-run/react-router/releases) - [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router/CHANGELOG.md) - [Commits](https://github.com/remix-run/react-router/commits/react-router@7.1.4/packages/react-router) --- updated-dependencies: - dependency-name: react-router dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 9 +++++---- package.json | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index af0d9e14d..3e0e541ff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -47,7 +47,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "react-frame-component": "^4.1.3", - "react-router": "^7.1.3", + "react-router": "^7.1.4", "sanitize-filename": "1.6.3", "superagent": "^10.1.1", "vitreum": "git+https://git@github.com/calculuschild/vitreum.git" @@ -11609,9 +11609,10 @@ "license": "MIT" }, "node_modules/react-router": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.1.3.tgz", - "integrity": "sha512-EezYymLY6Guk/zLQ2vRA8WvdUhWFEj5fcE3RfWihhxXBW7+cd1LsIiA3lmx+KCmneAGQuyBv820o44L2+TtkSA==", + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.1.4.tgz", + "integrity": "sha512-aJWVrKoLI0nIK1lfbTU3d5al1ZEUiwtSus/xjYL8K5sv2hyPesiOIojHM7QnaNLVtroOB1McZsWk37fMQVoc6A==", + "license": "MIT", "dependencies": { "@types/cookie": "^0.6.0", "cookie": "^1.0.1", diff --git a/package.json b/package.json index 2ef557033..0598cdbd8 100644 --- a/package.json +++ b/package.json @@ -122,7 +122,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "react-frame-component": "^4.1.3", - "react-router": "^7.1.3", + "react-router": "^7.1.4", "sanitize-filename": "1.6.3", "superagent": "^10.1.1", "vitreum": "git+https://git@github.com/calculuschild/vitreum.git" From b6b23a787cba68ec0b99a081c6842210e557156f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Fri, 31 Jan 2025 11:52:46 +0100 Subject: [PATCH 22/32] upadte notification popup to handle markdown --- .../notificationPopup/notificationPopup.jsx | 5 ++- .../notificationPopup/notificationPopup.less | 40 ++++++++++++++++--- 2 files changed, 38 insertions(+), 7 deletions(-) diff --git a/client/homebrew/brewRenderer/notificationPopup/notificationPopup.jsx b/client/homebrew/brewRenderer/notificationPopup/notificationPopup.jsx index b2045f13d..49ac57994 100644 --- a/client/homebrew/brewRenderer/notificationPopup/notificationPopup.jsx +++ b/client/homebrew/brewRenderer/notificationPopup/notificationPopup.jsx @@ -1,6 +1,7 @@ require('./notificationPopup.less'); import React, { useEffect, useState } from 'react'; import request from '../../utils/request-middleware.js'; +import Markdown from 'naturalcrit/markdown.js'; import Dialog from '../../../components/dialog.jsx'; @@ -40,11 +41,11 @@ const NotificationPopup = ()=>{ const renderNotificationsList = ()=>{ if(error) return
{error}
; - + notifications.map((notification) =>console.log(Markdown.render(notification.text, 1))); return notifications.map((notification)=>(
  • {notification.title}
    -

    +

  • )); }; diff --git a/client/homebrew/brewRenderer/notificationPopup/notificationPopup.less b/client/homebrew/brewRenderer/notificationPopup/notificationPopup.less index 79edf37b2..61f79e501 100644 --- a/client/homebrew/brewRenderer/notificationPopup/notificationPopup.less +++ b/client/homebrew/brewRenderer/notificationPopup/notificationPopup.less @@ -8,6 +8,7 @@ } .notificationPopup { + font-size:17px; position : relative; width : 100%; padding : 15px; @@ -48,17 +49,46 @@ } ul { margin-top : 15px; - font-size : 0.8em; + font-size : 0.9em; list-style-position : outside; list-style-type : disc; li { - margin-top : 1.4em; - font-size : 0.8em; - line-height : 1.4em; + margin-top : 1.2em; + font-size : 0.9em; + line-height : 1.2em; + padding-left: 1em; em { text-transform:capitalize; font-weight : 800; } + li { list-style-type: square;} + } + ul ul,ol ol,ul ol,ol ul { + margin-bottom : 0px; + margin-left : 1.5em; } } -} + + /*Markdown styling*/ + code { + background:#08115a; + padding: 0.1em 0.5em; + border-radius:2px; + font-family : 'Courier New', "Courier", monospace; + overflow-wrap : break-word; + white-space : pre-wrap; + } + pre code { + display : inline-block; + width : 100%; + } + .blank { + height : 1em; + margin-top : 0; + & + * { margin-top : 0; } + } + + + + +} \ No newline at end of file From 057abcda0d85d1e8821ea1c13c39f14bdfee3152 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Fri, 31 Jan 2025 12:04:40 +0100 Subject: [PATCH 23/32] reduce style between li elements --- .../notificationPopup/notificationPopup.less | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/client/homebrew/brewRenderer/notificationPopup/notificationPopup.less b/client/homebrew/brewRenderer/notificationPopup/notificationPopup.less index 61f79e501..4f5a0a2de 100644 --- a/client/homebrew/brewRenderer/notificationPopup/notificationPopup.less +++ b/client/homebrew/brewRenderer/notificationPopup/notificationPopup.less @@ -8,7 +8,6 @@ } .notificationPopup { - font-size:17px; position : relative; width : 100%; padding : 15px; @@ -53,15 +52,14 @@ list-style-position : outside; list-style-type : disc; li { - margin-top : 1.2em; font-size : 0.9em; - line-height : 1.2em; + line-height : 1.5em; padding-left: 1em; em { text-transform:capitalize; font-weight : 800; } - li { list-style-type: square;} + li { list-style-type: square; line-height : 1.2em;} } ul ul,ol ol,ul ol,ol ul { margin-bottom : 0px; @@ -79,12 +77,12 @@ white-space : pre-wrap; } pre code { - display : inline-block; - width : 100%; + display : inline-block; + width : 100%; } .blank { - height : 1em; - margin-top : 0; + height : 1em; + margin-top : 0; & + * { margin-top : 0; } } From 6269651c8dc0b8e25f25c9b139e9ebbd66c815d1 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Fri, 31 Jan 2025 12:42:54 -0500 Subject: [PATCH 24/32] Update Marked to v13.0.3 --- package-lock.json | 18 +++++++++--------- package.json | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3e0e541ff..643d1f0e3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,10 +34,10 @@ "jwt-simple": "^0.5.6", "less": "^3.13.1", "lodash": "^4.17.21", - "marked": "12.0.2", + "marked": "13.0.3", "marked-emoji": "^1.4.3", "marked-extended-tables": "^1.1.0", - "marked-gfm-heading-id": "^3.2.0", + "marked-gfm-heading-id": "^4.0.1", "marked-smartypants-lite": "^1.0.3", "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.30.1", @@ -9789,9 +9789,9 @@ } }, "node_modules/marked": { - "version": "12.0.2", - "resolved": "https://registry.npmjs.org/marked/-/marked-12.0.2.tgz", - "integrity": "sha512-qXUm7e/YKFoqFPYPa3Ukg9xlI5cyAtGmyEIzMfW//m6kXwCy2Ps9DYf5ioijFKQ8qyuscrHoY04iJGctu2Kg0Q==", + "version": "13.0.3", + "resolved": "https://registry.npmjs.org/marked/-/marked-13.0.3.tgz", + "integrity": "sha512-rqRix3/TWzE9rIoFGIn8JmsVfhiuC8VIQ8IdX5TfzmeBucdY05/0UlzKaw0eVtpcN/OdVFpBk7CjKGo9iHJ/zA==", "license": "MIT", "bin": { "marked": "bin/marked.js" @@ -9817,15 +9817,15 @@ } }, "node_modules/marked-gfm-heading-id": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/marked-gfm-heading-id/-/marked-gfm-heading-id-3.2.0.tgz", - "integrity": "sha512-Xfxpr5lXLDLY10XqzSCA9l2dDaiabQUgtYM9hw8yunyVsB/xYBRpiic6BOiY/EAJw1ik1eWr1ET1HKOAPZBhXg==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/marked-gfm-heading-id/-/marked-gfm-heading-id-4.1.1.tgz", + "integrity": "sha512-EeQZieAQmsI6c2tWLx0ETd0VjPwLV8qi+HT0dIsfVMERm0rCIuXfRvZXJbo1SgUi++lmuR1LVY+QzgNiLNvVpw==", "license": "MIT", "dependencies": { "github-slugger": "^2.0.0" }, "peerDependencies": { - "marked": ">=4 <13" + "marked": ">=13 <16" } }, "node_modules/marked-smartypants-lite": { diff --git a/package.json b/package.json index 0598cdbd8..cd43bb5e2 100644 --- a/package.json +++ b/package.json @@ -109,10 +109,10 @@ "jwt-simple": "^0.5.6", "less": "^3.13.1", "lodash": "^4.17.21", - "marked": "12.0.2", + "marked": "13.0.3", "marked-emoji": "^1.4.3", "marked-extended-tables": "^1.1.0", - "marked-gfm-heading-id": "^3.2.0", + "marked-gfm-heading-id": "^4.0.1", "marked-smartypants-lite": "^1.0.3", "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.30.1", From 518924d72590e5ba11ae237391811a4118c92107 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Fri, 31 Jan 2025 13:36:42 -0500 Subject: [PATCH 25/32] Use import, run eslint --- ...ation-block-multi-line-min-declarations.js | 28 ++++---- stylelint_plugins/declaration-colon-align.js | 67 ++++++++++--------- .../declaration-colon-min-space-before.js | 21 +++--- 3 files changed, 58 insertions(+), 58 deletions(-) diff --git a/stylelint_plugins/declaration-block-multi-line-min-declarations.js b/stylelint_plugins/declaration-block-multi-line-min-declarations.js index ba40ab5f6..517fd27ec 100644 --- a/stylelint_plugins/declaration-block-multi-line-min-declarations.js +++ b/stylelint_plugins/declaration-block-multi-line-min-declarations.js @@ -1,5 +1,5 @@ -const stylelint = require('stylelint'); -const { isNumber } = require('stylelint/lib/utils/validateTypes.cjs'); +import stylelint from 'stylelint'; +import { isNumber } from 'stylelint/lib/utils/validateTypes.mjs'; const { report, ruleMessages, validateOptions } = stylelint.utils; const ruleName = 'naturalcrit/declaration-block-multi-line-min-declarations'; @@ -7,9 +7,8 @@ const messages = ruleMessages(ruleName, { expected : (decls)=>`Rule with ${decls} declaration${decls == 1 ? '' : 's'} should be single line`, }); - -module.exports = stylelint.createPlugin(ruleName, function getPlugin(primaryOption, secondaryOptionObject, context) { - return function lint(postcssRoot, postcssResult) { +const ruleFunction = (primaryOption, secondaryOptionObject, context)=>{ + return (postcssRoot, postcssResult)=>{ const validOptions = validateOptions( postcssResult, @@ -20,26 +19,23 @@ module.exports = stylelint.createPlugin(ruleName, function getPlugin(primaryOpti } ); - if(!validOptions) { //If the options are invalid, don't lint + if(!validOptions) //If the options are invalid, don't lint return; - } + const isAutoFixing = Boolean(context.fix); postcssRoot.walkRules((rule)=>{ //Iterate CSS rules //Apply rule only if all children are decls (no further nested rules) - if(rule.nodes.length > primaryOption || !rule.nodes.every((node)=>node.type === 'decl')) { + if(rule.nodes.length > primaryOption || !rule.nodes.every((node)=>node.type === 'decl')) return; - } //Ignore if already one line if(!rule.nodes.some((node)=>node.raws.before.includes('\n')) && !rule.raws.after.includes('\n')) return; if(isAutoFixing) { //We are in “fix” mode - rule.each((decl)=>{ - decl.raws.before = ' '; - }); + rule.each((decl)=>decl.raws.before = ' '); rule.raws.after = ' '; } else { report({ @@ -52,7 +48,9 @@ module.exports = stylelint.createPlugin(ruleName, function getPlugin(primaryOpti } }); }; -}); +}; -module.exports.ruleName = ruleName; -module.exports.messages = messages; +ruleFunction.ruleName = ruleName; +ruleFunction.messages = messages; + +export default stylelint.createPlugin(ruleName, ruleFunction); diff --git a/stylelint_plugins/declaration-colon-align.js b/stylelint_plugins/declaration-colon-align.js index f1f5269d3..aeb92fcd8 100644 --- a/stylelint_plugins/declaration-colon-align.js +++ b/stylelint_plugins/declaration-colon-align.js @@ -1,32 +1,29 @@ -const stylelint = require('stylelint'); - +import stylelint from 'stylelint'; const { report, ruleMessages, validateOptions } = stylelint.utils; + const ruleName = 'naturalcrit/declaration-colon-align'; const messages = ruleMessages(ruleName, { expected : (rule)=>`Expected colons aligned within rule "${rule}"`, }); - -module.exports = stylelint.createPlugin(ruleName, function getPlugin(primaryOption, secondaryOptionObject, context) { - return function lint(postcssRoot, postcssResult) { +const ruleFunction = (primaryOption, secondaryOptionObject, context)=>{ + return (postcssRoot, postcssResult)=>{ const validOptions = validateOptions( postcssResult, ruleName, { actual : primaryOption, - possible : [ - true, - false - ] + possible : [true, false] } ); - if(!validOptions) { //If the options are invalid, don't lint + if(!validOptions) // If the options are invalid, don't lint return; - } + const isAutoFixing = Boolean(context.fix); - postcssRoot.walkRules((rule)=>{ //Iterate CSS rules + + postcssRoot.walkRules((rule)=>{ // Iterate CSS rules let maxColonPos = 0; let misaligned = false; @@ -36,33 +33,37 @@ module.exports = stylelint.createPlugin(ruleName, function getPlugin(primaryOpti return; const colonPos = declaration.prop.length + declaration.raws.between.indexOf(':'); - if(maxColonPos > 0 && colonPos != maxColonPos) { + + if(maxColonPos > 0 && colonPos != maxColonPos) misaligned = true; - } + maxColonPos = Math.max(maxColonPos, colonPos); }); - if(misaligned) { - if(isAutoFixing) { //We are in “fix” mode - rule.each((declaration)=>{ - if(declaration.type != 'decl') - return; + if(!misaligned) + return; - declaration.raws.between = `${' '.repeat(maxColonPos - declaration.prop.length)}:${declaration.raws.between.split(':')[1]}`; - }); - } else { //We are in “report only” mode - report({ - ruleName, - result : postcssResult, - message : messages.expected(rule.selector), // Build the reported message - node : rule, // Specify the reported node - word : rule.selector, // Which exact word caused the error? This positions the error properly - }); - } + if(isAutoFixing) { // We are in “fix” mode + rule.each((declaration)=>{ + if(declaration.type != 'decl') + return; + + declaration.raws.between = `${' '.repeat(maxColonPos - declaration.prop.length)}:${declaration.raws.between.split(':')[1]}`; + }); + } else { // We are in “report only” mode + report({ + ruleName, + result : postcssResult, + message : messages.expected(rule.selector), // Build the reported message + node : rule, // Specify the reported node + word : rule.selector, // Which exact word caused the error? This positions the error properly + }); } }); }; -}); +}; -module.exports.ruleName = ruleName; -module.exports.messages = messages; +ruleFunction.ruleName = ruleName; +ruleFunction.messages = messages; + +export default stylelint.createPlugin(ruleName, ruleFunction); \ No newline at end of file diff --git a/stylelint_plugins/declaration-colon-min-space-before.js b/stylelint_plugins/declaration-colon-min-space-before.js index e75c035a6..7776c6fef 100644 --- a/stylelint_plugins/declaration-colon-min-space-before.js +++ b/stylelint_plugins/declaration-colon-min-space-before.js @@ -1,5 +1,5 @@ -const stylelint = require('stylelint'); -const { isNumber } = require('stylelint/lib/utils/validateTypes.cjs'); +import stylelint from 'stylelint'; +import { isNumber } from 'stylelint/lib/utils/validateTypes.mjs'; const { report, ruleMessages, validateOptions } = stylelint.utils; const ruleName = 'naturalcrit/declaration-colon-min-space-before'; @@ -7,9 +7,8 @@ const messages = ruleMessages(ruleName, { expected : (num)=>`Expected at least ${num} space${num == 1 ? '' : 's'} before ":"` }); - -module.exports = stylelint.createPlugin(ruleName, function getPlugin(primaryOption, secondaryOptionObject, context) { - return function lint(postcssRoot, postcssResult) { +const ruleFunction = (primaryOption, secondaryOptionObject, context)=>{ + return (postcssRoot, postcssResult)=>{ const validOptions = validateOptions( postcssResult, @@ -30,9 +29,9 @@ module.exports = stylelint.createPlugin(ruleName, function getPlugin(primaryOpti const between = decl.raws.between; const colonIndex = between.indexOf(':'); - if(between.slice(0, colonIndex).length >= primaryOption) { + if(between.slice(0, colonIndex).length >= primaryOption) return; - } + if(isAutoFixing) { //We are in “fix” mode decl.raws.between = between.slice(0, colonIndex).replace(/\s*$/, ' '.repeat(primaryOption)) + between.slice(colonIndex); } else { @@ -46,7 +45,9 @@ module.exports = stylelint.createPlugin(ruleName, function getPlugin(primaryOpti } }); }; -}); +}; -module.exports.ruleName = ruleName; -module.exports.messages = messages; +ruleFunction.ruleName = ruleName; +ruleFunction.messages = messages; + +export default stylelint.createPlugin(ruleName, ruleFunction); \ No newline at end of file From 2f1ade84636857fde18832e795e4cfc81b55ef61 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Fri, 31 Jan 2025 13:38:25 -0500 Subject: [PATCH 26/32] lint --- .stylelintrc.json | 92 +++++++++++++++++++++++------------------------ 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/.stylelintrc.json b/.stylelintrc.json index 2c7a9afdf..b5f2e7712 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -1,48 +1,48 @@ { - "extends": [ - "stylelint-config-recess-order", - "stylelint-config-recommended"], - "plugins": [ - "@stylistic/stylelint-plugin", - "./stylelint_plugins/declaration-colon-align.js", - "./stylelint_plugins/declaration-colon-min-space-before", - "./stylelint_plugins/declaration-block-multi-line-min-declarations" - ], - "customSyntax": "postcss-less", - "rules": { - "no-descending-specificity" : null, - "at-rule-no-unknown" : null, - "function-no-unknown" : null, - "font-family-no-missing-generic-family-keyword" : null, - "font-weight-notation" : "named-where-possible", - "font-family-name-quotes" : "always-unless-keyword", - "@stylistic/indentation" : "tab", - "no-duplicate-selectors" : true, - "@stylistic/color-hex-case" : "upper", - "color-hex-length" : "long", - "@stylistic/selector-combinator-space-after" : "always", - "@stylistic/selector-combinator-space-before" : "always", - "@stylistic/selector-attribute-operator-space-before" : "never", - "@stylistic/selector-attribute-operator-space-after" : "never", - "@stylistic/selector-attribute-brackets-space-inside" : "never", - "selector-attribute-quotes" : "always", - "selector-pseudo-element-colon-notation" : "double", - "@stylistic/selector-pseudo-class-parentheses-space-inside" : "never", - "@stylistic/block-opening-brace-space-before" : "always", - "naturalcrit/declaration-colon-min-space-before" : 1, - "@stylistic/declaration-block-trailing-semicolon" : "always", - "@stylistic/declaration-colon-space-after" : "always", - "@stylistic/number-leading-zero" : "always", - "function-url-quotes" : ["always", { "except": ["empty"] }], - "function-url-scheme-disallowed-list" : ["data","http"], - "comment-whitespace-inside" : "always", - "@stylistic/string-quotes" : "single", - "@stylistic/media-feature-range-operator-space-before" : "always", - "@stylistic/media-feature-range-operator-space-after" : "always", - "@stylistic/media-feature-parentheses-space-inside" : "never", - "@stylistic/media-feature-colon-space-before" : "always", - "@stylistic/media-feature-colon-space-after" : "always", - "naturalcrit/declaration-colon-align" : true, - "naturalcrit/declaration-block-multi-line-min-declarations": 1 - } + "extends": [ + "stylelint-config-recess-order", + "stylelint-config-recommended"], + "plugins": [ + "@stylistic/stylelint-plugin", + "./stylelint_plugins/declaration-colon-align.js", + "./stylelint_plugins/declaration-colon-min-space-before", + "./stylelint_plugins/declaration-block-multi-line-min-declarations" + ], + "customSyntax": "postcss-less", + "rules": { + "no-descending-specificity" : null, + "at-rule-no-unknown" : null, + "function-no-unknown" : null, + "font-family-no-missing-generic-family-keyword" : null, + "font-weight-notation" : "named-where-possible", + "font-family-name-quotes" : "always-unless-keyword", + "@stylistic/indentation" : "tab", + "no-duplicate-selectors" : true, + "@stylistic/color-hex-case" : "upper", + "color-hex-length" : "long", + "@stylistic/selector-combinator-space-after" : "always", + "@stylistic/selector-combinator-space-before" : "always", + "@stylistic/selector-attribute-operator-space-before" : "never", + "@stylistic/selector-attribute-operator-space-after" : "never", + "@stylistic/selector-attribute-brackets-space-inside" : "never", + "selector-attribute-quotes" : "always", + "selector-pseudo-element-colon-notation" : "double", + "@stylistic/selector-pseudo-class-parentheses-space-inside" : "never", + "@stylistic/block-opening-brace-space-before" : "always", + "naturalcrit/declaration-colon-min-space-before" : 1, + "@stylistic/declaration-block-trailing-semicolon" : "always", + "@stylistic/declaration-colon-space-after" : "always", + "@stylistic/number-leading-zero" : "always", + "function-url-quotes" : ["always", { "except": ["empty"] }], + "function-url-scheme-disallowed-list" : ["data","http"], + "comment-whitespace-inside" : "always", + "@stylistic/string-quotes" : "single", + "@stylistic/media-feature-range-operator-space-before" : "always", + "@stylistic/media-feature-range-operator-space-after" : "always", + "@stylistic/media-feature-parentheses-space-inside" : "never", + "@stylistic/media-feature-colon-space-before" : "always", + "@stylistic/media-feature-colon-space-after" : "always", + "naturalcrit/declaration-colon-align" : true, + "naturalcrit/declaration-block-multi-line-min-declarations" : 1 + } } From 19660272898744fde1210805b3789d1663c910a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Fri, 31 Jan 2025 20:02:31 +0100 Subject: [PATCH 27/32] linting & suggested changes --- .../notificationPopup/notificationPopup.jsx | 3 +-- .../notificationPopup/notificationPopup.less | 24 +++++++++---------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/client/homebrew/brewRenderer/notificationPopup/notificationPopup.jsx b/client/homebrew/brewRenderer/notificationPopup/notificationPopup.jsx index 49ac57994..38a85e0c7 100644 --- a/client/homebrew/brewRenderer/notificationPopup/notificationPopup.jsx +++ b/client/homebrew/brewRenderer/notificationPopup/notificationPopup.jsx @@ -41,11 +41,10 @@ const NotificationPopup = ()=>{ const renderNotificationsList = ()=>{ if(error) return
    {error}
    ; - notifications.map((notification) =>console.log(Markdown.render(notification.text, 1))); return notifications.map((notification)=>(
  • {notification.title}
    -

    +

  • )); }; diff --git a/client/homebrew/brewRenderer/notificationPopup/notificationPopup.less b/client/homebrew/brewRenderer/notificationPopup/notificationPopup.less index 4f5a0a2de..8c32f037f 100644 --- a/client/homebrew/brewRenderer/notificationPopup/notificationPopup.less +++ b/client/homebrew/brewRenderer/notificationPopup/notificationPopup.less @@ -52,14 +52,14 @@ list-style-position : outside; list-style-type : disc; li { - font-size : 0.9em; - line-height : 1.5em; - padding-left: 1em; - em { - text-transform:capitalize; - font-weight : 800; + padding-left : 1em; + font-size : 0.9em; + line-height : 1.5em; + em { + font-weight : 800; + text-transform : capitalize; } - li { list-style-type: square; line-height : 1.2em;} + li { line-height : 1.2em; list-style-type : square;} } ul ul,ol ol,ul ol,ol ul { margin-bottom : 0px; @@ -67,14 +67,14 @@ } } - /*Markdown styling*/ + /* Markdown styling */ code { - background:#08115a; - padding: 0.1em 0.5em; - border-radius:2px; - font-family : 'Courier New', "Courier", monospace; + padding : 0.1em 0.5em; + font-family : 'Courier New', 'Courier', monospace; overflow-wrap : break-word; white-space : pre-wrap; + background : #08115A; + border-radius : 2px; } pre code { display : inline-block; From be1742d01d52c7e5be960482daf7dbdf118846d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Fri, 31 Jan 2025 20:08:10 +0100 Subject: [PATCH 28/32] remove unnecessary spaces --- .../notificationPopup/notificationPopup.less | 28 ++++++++----------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/client/homebrew/brewRenderer/notificationPopup/notificationPopup.less b/client/homebrew/brewRenderer/notificationPopup/notificationPopup.less index 8c32f037f..8383920a5 100644 --- a/client/homebrew/brewRenderer/notificationPopup/notificationPopup.less +++ b/client/homebrew/brewRenderer/notificationPopup/notificationPopup.less @@ -52,14 +52,14 @@ list-style-position : outside; list-style-type : disc; li { - padding-left : 1em; - font-size : 0.9em; - line-height : 1.5em; - em { - font-weight : 800; - text-transform : capitalize; + font-size : 0.9em; + line-height : 1.5em; + padding-left: 1em; + em { + text-transform:capitalize; + font-weight : 800; } - li { line-height : 1.2em; list-style-type : square;} + li { list-style-type: square; line-height : 1.2em;} } ul ul,ol ol,ul ol,ol ul { margin-bottom : 0px; @@ -67,14 +67,14 @@ } } - /* Markdown styling */ + /*Markdown styling*/ code { - padding : 0.1em 0.5em; - font-family : 'Courier New', 'Courier', monospace; + background:#08115a; + padding: 0.1em 0.5em; + border-radius:2px; + font-family : 'Courier New', "Courier", monospace; overflow-wrap : break-word; white-space : pre-wrap; - background : #08115A; - border-radius : 2px; } pre code { display : inline-block; @@ -85,8 +85,4 @@ margin-top : 0; & + * { margin-top : 0; } } - - - - } \ No newline at end of file From 460fb655d82127a46ac715d0d04993ab77bd532d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Fri, 31 Jan 2025 20:11:57 +0100 Subject: [PATCH 29/32] bring margin back --- .../notificationPopup/notificationPopup.less | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/client/homebrew/brewRenderer/notificationPopup/notificationPopup.less b/client/homebrew/brewRenderer/notificationPopup/notificationPopup.less index 8383920a5..be642f0fe 100644 --- a/client/homebrew/brewRenderer/notificationPopup/notificationPopup.less +++ b/client/homebrew/brewRenderer/notificationPopup/notificationPopup.less @@ -52,14 +52,19 @@ list-style-position : outside; list-style-type : disc; li { - font-size : 0.9em; - line-height : 1.5em; - padding-left: 1em; - em { - text-transform:capitalize; - font-weight : 800; + padding-left : 1em; + margin-top : 1.5em; + font-size : 0.9em; + line-height : 1.5em; + em { + font-weight : 800; + text-transform : capitalize; + } + li { + margin-top : 0; + line-height : 1.2em; + list-style-type : square; } - li { list-style-type: square; line-height : 1.2em;} } ul ul,ol ol,ul ol,ol ul { margin-bottom : 0px; @@ -67,14 +72,14 @@ } } - /*Markdown styling*/ + /* Markdown styling */ code { - background:#08115a; - padding: 0.1em 0.5em; - border-radius:2px; - font-family : 'Courier New', "Courier", monospace; + padding : 0.1em 0.5em; + font-family : 'Courier New', 'Courier', monospace; overflow-wrap : break-word; white-space : pre-wrap; + background : #08115A; + border-radius : 2px; } pre code { display : inline-block; From 27c4cfd25c5c7789c1f796d2434f781ccd30f8ab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 03:16:41 +0000 Subject: [PATCH 30/32] Bump mongoose from 8.9.5 to 8.9.6 Bumps [mongoose](https://github.com/Automattic/mongoose) from 8.9.5 to 8.9.6. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md) - [Commits](https://github.com/Automattic/mongoose/compare/8.9.5...8.9.6) --- updated-dependencies: - dependency-name: mongoose dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 9 +++++---- package.json | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 643d1f0e3..a06b29c1e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,7 +41,7 @@ "marked-smartypants-lite": "^1.0.3", "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.30.1", - "mongoose": "^8.9.5", + "mongoose": "^8.9.6", "nanoid": "5.0.9", "nconf": "^0.12.1", "react": "^18.3.1", @@ -10187,9 +10187,10 @@ } }, "node_modules/mongoose": { - "version": "8.9.5", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.9.5.tgz", - "integrity": "sha512-SPhOrgBm0nKV3b+IIHGqpUTOmgVL5Z3OO9AwkFEmvOZznXTvplbomstCnPOGAyungtRXE5pJTgKpKcZTdjeESg==", + "version": "8.9.6", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.9.6.tgz", + "integrity": "sha512-ipLvXwNPVuuuq5H3lnSD0lpaRH3DlCoC6emnMVJvweTwxU29uxDJWxMsNpERDQt8JMvYF1HGVuTK+Id2BlQLCA==", + "license": "MIT", "dependencies": { "bson": "^6.10.1", "kareem": "2.6.3", diff --git a/package.json b/package.json index cd43bb5e2..7031004ee 100644 --- a/package.json +++ b/package.json @@ -116,7 +116,7 @@ "marked-smartypants-lite": "^1.0.3", "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.30.1", - "mongoose": "^8.9.5", + "mongoose": "^8.9.6", "nanoid": "5.0.9", "nconf": "^0.12.1", "react": "^18.3.1", From 423caefe1aea07154e593558a98c66b4e506e31b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 04:45:39 +0000 Subject: [PATCH 31/32] Bump react-router from 7.1.4 to 7.1.5 Bumps [react-router](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router) from 7.1.4 to 7.1.5. - [Release notes](https://github.com/remix-run/react-router/releases) - [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router/CHANGELOG.md) - [Commits](https://github.com/remix-run/react-router/commits/react-router@7.1.5/packages/react-router) --- updated-dependencies: - dependency-name: react-router dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index a06b29c1e..649c6597c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -47,7 +47,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "react-frame-component": "^4.1.3", - "react-router": "^7.1.4", + "react-router": "^7.1.5", "sanitize-filename": "1.6.3", "superagent": "^10.1.1", "vitreum": "git+https://git@github.com/calculuschild/vitreum.git" @@ -11610,9 +11610,9 @@ "license": "MIT" }, "node_modules/react-router": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.1.4.tgz", - "integrity": "sha512-aJWVrKoLI0nIK1lfbTU3d5al1ZEUiwtSus/xjYL8K5sv2hyPesiOIojHM7QnaNLVtroOB1McZsWk37fMQVoc6A==", + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.1.5.tgz", + "integrity": "sha512-8BUF+hZEU4/z/JD201yK6S+UYhsf58bzYIDq2NS1iGpwxSXDu7F+DeGSkIXMFBuHZB21FSiCzEcUb18cQNdRkA==", "license": "MIT", "dependencies": { "@types/cookie": "^0.6.0", diff --git a/package.json b/package.json index 7031004ee..2bf3a0a93 100644 --- a/package.json +++ b/package.json @@ -122,7 +122,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "react-frame-component": "^4.1.3", - "react-router": "^7.1.4", + "react-router": "^7.1.5", "sanitize-filename": "1.6.3", "superagent": "^10.1.1", "vitreum": "git+https://git@github.com/calculuschild/vitreum.git" From ce01b6c1ff81c62f2fcf4948d399adb598a2408b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Mon, 3 Feb 2025 15:10:34 +0100 Subject: [PATCH 32/32] initial commit --- client/homebrew/pages/errorPage/errors/errorIndex.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/homebrew/pages/errorPage/errors/errorIndex.js b/client/homebrew/pages/errorPage/errors/errorIndex.js index f7614a37a..2c7be5d4b 100644 --- a/client/homebrew/pages/errorPage/errors/errorIndex.js +++ b/client/homebrew/pages/errorPage/errors/errorIndex.js @@ -3,8 +3,8 @@ const dedent = require('dedent-tabs').default; const loginUrl = 'https://www.naturalcrit.com/login'; // Prevent parsing text (e.g. document titles) as markdown -const escape = (text) => { - return text.split('').map(char => `&#${char.charCodeAt(0)};`).join(''); +const escape = (text = '')=>{ + return text.split('').map((char)=>`&#${char.charCodeAt(0)};`).join(''); }; //001-050 : Brew errors