From 591ccf564c25b1642d9fcab0cd18e5a759f6b7b2 Mon Sep 17 00:00:00 2001 From: David Bolack Date: Fri, 10 Jan 2025 20:22:33 -0600 Subject: [PATCH 01/44] Working changes --- install/ubuntu/etc/systemd/system/homebrewery.service | 2 +- install/ubuntu/install.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/install/ubuntu/etc/systemd/system/homebrewery.service b/install/ubuntu/etc/systemd/system/homebrewery.service index 939d11fb8..4152943d9 100644 --- a/install/ubuntu/etc/systemd/system/homebrewery.service +++ b/install/ubuntu/etc/systemd/system/homebrewery.service @@ -3,7 +3,7 @@ Description=Homebrewery Web Server [Service] User=root -After=mongodb +Requires=mongodb Environment=NODE_ENV=local WorkingDirectory=/usr/local/homebrewery ExecStart=node server.js diff --git a/install/ubuntu/install.sh b/install/ubuntu/install.sh index ebad7f3f2..e1de299e7 100644 --- a/install/ubuntu/install.sh +++ b/install/ubuntu/install.sh @@ -4,7 +4,7 @@ echo ::Install CURL apt install -y curl echo ::Add NodeJS source to package repo -curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - +curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - # Install required packages echo ::Install Homebrewery requirements From 533586f516b02b290942e969f3f7c1c208f1d545 Mon Sep 17 00:00:00 2001 From: David Bolack Date: Fri, 10 Jan 2025 21:09:50 -0600 Subject: [PATCH 02/44] Rough draft of update. --- install/README.UBUNTU.md | 4 +++- .../etc/systemd/system/homebrewery.service | 3 ++- install/ubuntu/install.sh | 18 ++++++++++++++---- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/install/README.UBUNTU.md b/install/README.UBUNTU.md index d14cfef46..d97d6b362 100644 --- a/install/README.UBUNTU.md +++ b/install/README.UBUNTU.md @@ -24,12 +24,14 @@ These instructions assume that you are installing to a completely new, fresh Ubu These installation instructions have been tested on the following Ubuntu releases: -- *ubuntu-20.04.3-desktop-amd64* +- *ubuntu-24.04.1-desktop-amd64* ## Final Notes While this installation process works successfully at the time of writing (December 19, 2021), it relies on all of the Node.JS packages used in the HomeBrewery project retaining their cross-platform capabilities to continue to function. This is one of the inherent advantages of Node.JS, but it is by no means guaranteed and as such, functionality or even installation may fail without warning at some point in the future. +Earlier versions of Ubuntu may requier an alternate Mongo setup, see https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-ubuntu/ for assistance. + Regards, G December 19, 2021 diff --git a/install/ubuntu/etc/systemd/system/homebrewery.service b/install/ubuntu/etc/systemd/system/homebrewery.service index 4152943d9..defa85a31 100644 --- a/install/ubuntu/etc/systemd/system/homebrewery.service +++ b/install/ubuntu/etc/systemd/system/homebrewery.service @@ -3,7 +3,8 @@ Description=Homebrewery Web Server [Service] User=root -Requires=mongodb +BindsTo=mongod.service +After=mongod.service Environment=NODE_ENV=local WorkingDirectory=/usr/local/homebrewery ExecStart=node server.js diff --git a/install/ubuntu/install.sh b/install/ubuntu/install.sh index e1de299e7..13265779a 100644 --- a/install/ubuntu/install.sh +++ b/install/ubuntu/install.sh @@ -6,9 +6,21 @@ apt install -y curl echo ::Add NodeJS source to package repo curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - +# Add Mongo CE Source +echo ::Add Mongo CE source to package repo +curl -fsSL https://www.mongodb.org/static/pgp/server-8.0.asc | \ + sudo gpg -o /usr/share/keyrings/mongodb-server-8.0.gpg \ + --dearmor +echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu noble/mongodb-org/8.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list +sudo apt-get update + # Install required packages echo ::Install Homebrewery requirements -apt satisfy -y git nodejs npm mongodb +apt satisfy -y git nodejs npm mongodb-org + +# Enable and start Mongo +systemctl enable mongod +systemctl start mongod # Clone Homebrewery repo echo ::Get Homebrewery files @@ -23,9 +35,7 @@ npm audit fix npm run postinstall # Create Homebrewery service -echo ::Create Homebrewery service -ln -s /usr/local/homebrewery/install/ubuntu/etc/systemd/system/homebrewery.service /etc/systemd/system/homebrewery.service -systemctl daemon-reload +echo ::Create systemctl daemon-reload echo ::Set Homebrewery to start automatically systemctl enable homebrewery From 3578a7e1e2d10d067624acffa92ea75bd576521b Mon Sep 17 00:00:00 2001 From: David Bolack Date: Fri, 10 Jan 2025 22:52:18 -0600 Subject: [PATCH 03/44] Updated for last three LTS releases --- install/README.UBUNTU.md | 4 +++- install/ubuntu/install.sh | 50 +++++++++++++++++++++++++++++++++------ 2 files changed, 46 insertions(+), 8 deletions(-) diff --git a/install/README.UBUNTU.md b/install/README.UBUNTU.md index d97d6b362..13fa7631d 100644 --- a/install/README.UBUNTU.md +++ b/install/README.UBUNTU.md @@ -24,7 +24,9 @@ These instructions assume that you are installing to a completely new, fresh Ubu These installation instructions have been tested on the following Ubuntu releases: -- *ubuntu-24.04.1-desktop-amd64* + - *ubuntu-24.04.1-desktop-amd64* + - *ubuntu-22.04.5-desktop-amd64* + - *ubuntu-20.04.6-desktop-amd64* ## Final Notes diff --git a/install/ubuntu/install.sh b/install/ubuntu/install.sh index 13265779a..a0fcc8c17 100644 --- a/install/ubuntu/install.sh +++ b/install/ubuntu/install.sh @@ -1,5 +1,22 @@ #!/bin/sh +# Detect Ubuntu Version +export DISTRO=$(grep "^NAME=" /etc/os-release | awk -F '=' '{print $2}' | sed 's/"//g') +export DISTRO_VER=$(grep "VERSION_ID=" /etc/os-release | awk -F '=' '{print $2}' | sed 's/"//g') +export MATCHED="Yes" + +if [ "${DISTRO}" != "Ubuntu" ]; +then + echo :: Ubuntu not detected. Are you using an alternate spin or derivative? + echo :: Detected - ${DISTRO} + read -p [y/N] YESNO + if [ "${YESNO}" != "Y" ] && [ ]"${YESNO}" != "y" ]; then + exit + fi + + MATCHED="No" +fi + # Install CURL and add required NodeJS source to package repo echo ::Install CURL apt install -y curl @@ -7,13 +24,30 @@ echo ::Add NodeJS source to package repo curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - # Add Mongo CE Source -echo ::Add Mongo CE source to package repo -curl -fsSL https://www.mongodb.org/static/pgp/server-8.0.asc | \ - sudo gpg -o /usr/share/keyrings/mongodb-server-8.0.gpg \ - --dearmor -echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu noble/mongodb-org/8.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list -sudo apt-get update +if [ ${DISTRO} = "Ubuntu" ]; + then + echo ::Add Mongo CE source to package repo + curl -fsSL https://www.mongodb.org/static/pgp/server-8.0.asc | \ + sudo gpg -o /usr/share/keyrings/mongodb-server-8.0.gpg \ + --dearmor + if [ "${DISTRO_VER}" == "24.04" ]; then + echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu noble/mongodb-org/8.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list + elif [ "${DISTRO_VER}" == "22.04" ]; then + echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/8.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list + elif [ "${DISTRO_VER}" == "20.04" ]; then + echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/8.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list + else + MATCHED="No" + fi + sudo apt-get update +fi +if [ ${MATCHED} == "No" ]; then + echo :: WARNING + echo :: Unable to determine Ubuntu version for Mongo installation purposes. + echo :: Please check your spin/distro documentation to install Mongo CE and enable it on startup. +fi + # Install required packages echo ::Install Homebrewery requirements apt satisfy -y git nodejs npm mongodb-org @@ -35,7 +69,9 @@ npm audit fix npm run postinstall # Create Homebrewery service -echo ::Create systemctl daemon-reload +echo ::Create Homebrewery service +ln -s /usr/local/homebrewery/install/ubuntu/etc/systemd/system/homebrewery.service /etc/systemd/system/homebrewery.service +systemctl daemon-reload echo ::Set Homebrewery to start automatically systemctl enable homebrewery From 9d67724da9c4d042092663055764bf3c7a662b6a Mon Sep 17 00:00:00 2001 From: David Bolack Date: Fri, 10 Jan 2025 23:22:22 -0600 Subject: [PATCH 04/44] Wrap titles in error messages with pre blocks to prevent rendering. --- client/homebrew/pages/errorPage/errors/errorIndex.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/homebrew/pages/errorPage/errors/errorIndex.js b/client/homebrew/pages/errorPage/errors/errorIndex.js index ccdd86768..73040ec68 100644 --- a/client/homebrew/pages/errorPage/errors/errorIndex.js +++ b/client/homebrew/pages/errorPage/errors/errorIndex.js @@ -89,7 +89,7 @@ const errorIndex = (props)=>{ : - **Brew Title:** ${props.brew.brewTitle || 'Unable to show title'} + **Brew Title:** \`${props.brew.brewTitle || 'Unable to show title'}\` **Current Authors:** ${props.brew.authors?.map((author)=>{return `[${author}](/user/${author})`;}).join(', ') || 'Unable to list authors'} @@ -104,7 +104,7 @@ const errorIndex = (props)=>{ : - **Brew Title:** ${props.brew.brewTitle || 'Unable to show title'} + **Brew Title:** \`${props.brew.brewTitle || 'Unable to show title'}\` **Current Authors:** ${props.brew.authors?.map((author)=>{return `[${author}](/user/${author})`;}).join(', ') || 'Unable to list authors'} @@ -181,7 +181,7 @@ const errorIndex = (props)=>{ **Brew ID:** ${props.brew.brewId} - **Brew Title:** ${props.brew.brewTitle}`, + **Brew Title:** \`${props.brew.brewTitle}\`, // ####### Admin page error ####### '52' : dedent` From 80003f6c5735a290f6ab6e22f377bf525f90eabb Mon Sep 17 00:00:00 2001 From: David Bolack Date: Sat, 11 Jan 2025 08:44:11 -0600 Subject: [PATCH 05/44] Return overremoved backtick --- client/homebrew/pages/errorPage/errors/errorIndex.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/homebrew/pages/errorPage/errors/errorIndex.js b/client/homebrew/pages/errorPage/errors/errorIndex.js index 73040ec68..f05f93838 100644 --- a/client/homebrew/pages/errorPage/errors/errorIndex.js +++ b/client/homebrew/pages/errorPage/errors/errorIndex.js @@ -181,7 +181,7 @@ const errorIndex = (props)=>{ **Brew ID:** ${props.brew.brewId} - **Brew Title:** \`${props.brew.brewTitle}\`, + **Brew Title:** \`${props.brew.brewTitle}\``, // ####### Admin page error ####### '52' : dedent` From eebc9c2bfae935072a49453a50ae390829140ac0 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Wed, 22 Jan 2025 15:04:33 -0500 Subject: [PATCH 06/44] 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 07/44] 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 08/44] 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 09/44] 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 abc830eda2210a64607ff338ecec376e1957ff73 Mon Sep 17 00:00:00 2001 From: David Bolack Date: Fri, 24 Jan 2025 14:09:13 -0600 Subject: [PATCH 10/44] Change backticks to `
` literals.

---
 client/homebrew/pages/errorPage/errors/errorIndex.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/client/homebrew/pages/errorPage/errors/errorIndex.js b/client/homebrew/pages/errorPage/errors/errorIndex.js
index f05f93838..caa5e662c 100644
--- a/client/homebrew/pages/errorPage/errors/errorIndex.js
+++ b/client/homebrew/pages/errorPage/errors/errorIndex.js
@@ -89,7 +89,7 @@ const errorIndex = (props)=>{
 		
 		:
 
-		**Brew Title:** \`${props.brew.brewTitle || 'Unable to show title'}\`
+		**Brew Title:** 
${props.brew.brewTitle || 'Unable to show title'}
**Current Authors:** ${props.brew.authors?.map((author)=>{return `[${author}](/user/${author})`;}).join(', ') || 'Unable to list authors'} @@ -104,7 +104,7 @@ const errorIndex = (props)=>{ : - **Brew Title:** \`${props.brew.brewTitle || 'Unable to show title'}\` + **Brew Title:**
${props.brew.brewTitle || 'Unable to show title'}
**Current Authors:** ${props.brew.authors?.map((author)=>{return `[${author}](/user/${author})`;}).join(', ') || 'Unable to list authors'} @@ -181,7 +181,7 @@ const errorIndex = (props)=>{ **Brew ID:** ${props.brew.brewId} - **Brew Title:** \`${props.brew.brewTitle}\``, + **Brew Title:**
${props.brew.brewTitle}
`, // ####### Admin page error ####### '52' : dedent` From 29d04fe57ddbbd4d031d9bc63bbf447f3b7c149e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 03:42:09 +0000 Subject: [PATCH 11/44] Bump eslint from 9.18.0 to 9.19.0 Bumps [eslint](https://github.com/eslint/eslint) from 9.18.0 to 9.19.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v9.18.0...v9.19.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 18 ++++++++++-------- package.json | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6cf876186..85f052f2b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -55,7 +55,7 @@ "devDependencies": { "@stylistic/stylelint-plugin": "^3.1.1", "babel-plugin-transform-import-meta": "^2.3.2", - "eslint": "^9.18.0", + "eslint": "^9.19.0", "eslint-plugin-jest": "^28.11.0", "eslint-plugin-react": "^7.37.4", "globals": "^15.14.0", @@ -1915,10 +1915,11 @@ } }, "node_modules/@eslint/js": { - "version": "9.18.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.18.0.tgz", - "integrity": "sha512-fK6L7rxcq6/z+AaQMtiFTkvbHkBLNlwyRxHpKawP0x3u9+NC6MQTnFW+AdpwC6gfHTW0051cokQgtTN2FqlxQA==", + "version": "9.19.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.19.0.tgz", + "integrity": "sha512-rbq9/g38qjfqFLOVPvwjIvFFdNziEC5S65jmjPw5r6A//QH+W91akh9irMwjDN8zKUTak6W9EsAv4m/7Wnw0UQ==", "dev": true, + "license": "MIT", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } @@ -5650,17 +5651,18 @@ "license": "MIT" }, "node_modules/eslint": { - "version": "9.18.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.18.0.tgz", - "integrity": "sha512-+waTfRWQlSbpt3KWE+CjrPPYnbq9kfZIYUqapc0uBXyjTp8aYXZDsUH16m39Ryq3NjAVP4tjuF7KaukeqoCoaA==", + "version": "9.19.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.19.0.tgz", + "integrity": "sha512-ug92j0LepKlbbEv6hD911THhoRHmbdXt2gX+VDABAW/Ir7D3nqKdv5Pf5vtlyY6HQMTEP2skXY43ueqTCWssEA==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", "@eslint/config-array": "^0.19.0", "@eslint/core": "^0.10.0", "@eslint/eslintrc": "^3.2.0", - "@eslint/js": "9.18.0", + "@eslint/js": "9.19.0", "@eslint/plugin-kit": "^0.2.5", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", diff --git a/package.json b/package.json index 40f6aad81..15c0efcea 100644 --- a/package.json +++ b/package.json @@ -130,7 +130,7 @@ "devDependencies": { "@stylistic/stylelint-plugin": "^3.1.1", "babel-plugin-transform-import-meta": "^2.3.2", - "eslint": "^9.18.0", + "eslint": "^9.19.0", "eslint-plugin-jest": "^28.11.0", "eslint-plugin-react": "^7.37.4", "globals": "^15.14.0", From fb20be833ce97e7d25a283f2f63e30721a4aac64 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 16:32:07 +0000 Subject: [PATCH 12/44] Bump stylelint from 16.13.2 to 16.14.1 Bumps [stylelint](https://github.com/stylelint/stylelint) from 16.13.2 to 16.14.1. - [Release notes](https://github.com/stylelint/stylelint/releases) - [Changelog](https://github.com/stylelint/stylelint/blob/main/CHANGELOG.md) - [Commits](https://github.com/stylelint/stylelint/compare/16.13.2...16.14.1) --- updated-dependencies: - dependency-name: stylelint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 27 ++++++++++++++------------- package.json | 2 +- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index 85f052f2b..7fee96257 100644 --- a/package-lock.json +++ b/package-lock.json @@ -63,7 +63,7 @@ "jest-expect-message": "^1.1.3", "jsdom-global": "^3.0.2", "postcss-less": "^6.0.0", - "stylelint": "^16.13.2", + "stylelint": "^16.14.1", "stylelint-config-recess-order": "^6.0.0", "stylelint-config-recommended": "^15.0.0", "supertest": "^7.0.0" @@ -11248,9 +11248,9 @@ } }, "node_modules/postcss": { - "version": "8.4.49", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.49.tgz", - "integrity": "sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==", + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.1.tgz", + "integrity": "sha512-6oz2beyjc5VMn/KV1pPw8fliQkhBXrVn1Z3TVyqZxU8kZpzEKhBdmCFqI6ZbmGtamQvQGuU1sgPTk8ZrXDD7jQ==", "dev": true, "funding": [ { @@ -11268,7 +11268,7 @@ ], "license": "MIT", "dependencies": { - "nanoid": "^3.3.7", + "nanoid": "^3.3.8", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" }, @@ -11352,9 +11352,9 @@ "license": "MIT" }, "node_modules/postcss/node_modules/nanoid": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", - "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", "dev": true, "funding": [ { @@ -13040,9 +13040,9 @@ "license": "ISC" }, "node_modules/stylelint": { - "version": "16.13.2", - "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-16.13.2.tgz", - "integrity": "sha512-wDlgh0mRO9RtSa3TdidqHd0nOG8MmUyVKl+dxA6C1j8aZRzpNeEgdhFmU5y4sZx4Fc6r46p0fI7p1vR5O2DZqA==", + "version": "16.14.1", + "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-16.14.1.tgz", + "integrity": "sha512-oqCL7AC3786oTax35T/nuLL8p2C3k/8rHKAooezrPGRvUX0wX+qqs5kMWh5YYT4PHQgVDobHT4tw55WgpYG6Sw==", "dev": true, "funding": [ { @@ -13054,6 +13054,7 @@ "url": "https://github.com/sponsors/stylelint" } ], + "license": "MIT", "dependencies": { "@csstools/css-parser-algorithms": "^3.0.4", "@csstools/css-tokenizer": "^3.0.3", @@ -13073,7 +13074,7 @@ "globby": "^11.1.0", "globjoin": "^0.1.4", "html-tags": "^3.3.1", - "ignore": "^7.0.1", + "ignore": "^7.0.3", "imurmurhash": "^0.1.4", "is-plain-object": "^5.0.0", "known-css-properties": "^0.35.0", @@ -13082,7 +13083,7 @@ "micromatch": "^4.0.8", "normalize-path": "^3.0.0", "picocolors": "^1.1.1", - "postcss": "^8.4.49", + "postcss": "^8.5.1", "postcss-resolve-nested-selector": "^0.1.6", "postcss-safe-parser": "^7.0.1", "postcss-selector-parser": "^7.0.0", diff --git a/package.json b/package.json index 15c0efcea..c7781d69c 100644 --- a/package.json +++ b/package.json @@ -138,7 +138,7 @@ "jest-expect-message": "^1.1.3", "jsdom-global": "^3.0.2", "postcss-less": "^6.0.0", - "stylelint": "^16.13.2", + "stylelint": "^16.14.1", "stylelint-config-recess-order": "^6.0.0", "stylelint-config-recommended": "^15.0.0", "supertest": "^7.0.0" From 66fd9e188b7ca1d826304c505c68ca694392b216 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 16:36:51 +0000 Subject: [PATCH 13/44] Bump @babel/core from 7.26.0 to 7.26.7 Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.26.0 to 7.26.7. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.26.7/packages/babel-core) --- updated-dependencies: - dependency-name: "@babel/core" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 97 ++++++++++++++++++++++++++--------------------- package.json | 2 +- 2 files changed, 54 insertions(+), 45 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7fee96257..2bef0ba67 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "hasInstallScript": true, "license": "MIT", "dependencies": { - "@babel/core": "^7.26.0", + "@babel/core": "^7.26.7", "@babel/plugin-transform-runtime": "^7.25.9", "@babel/preset-env": "^7.26.0", "@babel/preset-react": "^7.26.3", @@ -87,9 +87,10 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.0.tgz", - "integrity": "sha512-INCKxTtbXtcNbUZ3YXutwMpEleqttcswhAdee7dhuoVrD2cnuc3PqtERBtxkX5nziX9vnBL8WXmSGwv8CuPV6g==", + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", + "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", + "license": "MIT", "dependencies": { "@babel/helper-validator-identifier": "^7.25.9", "js-tokens": "^4.0.0", @@ -100,28 +101,30 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.0.tgz", - "integrity": "sha512-qETICbZSLe7uXv9VE8T/RWOdIE5qqyTucOt4zLYMafj2MRO271VGgLd4RACJMeBO37UPWhXiKMBk7YlJ0fOzQA==", + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.5.tgz", + "integrity": "sha512-XvcZi1KWf88RVbF9wn8MN6tYFloU5qX8KjuF3E1PVBmJ9eypXfs4GRiJwLuTZL0iSnJUKn1BFPa5BPZZJyFzPg==", + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.0.tgz", - "integrity": "sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg==", + "version": "7.26.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.7.tgz", + "integrity": "sha512-SRijHmF0PSPgLIBYlWnG0hyeJLwXE2CgpsXaMOrtt2yp9/86ALw6oUlj9KYuZ0JN07T4eBMVIW4li/9S1j2BGA==", + "license": "MIT", "dependencies": { "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.26.0", - "@babel/generator": "^7.26.0", - "@babel/helper-compilation-targets": "^7.25.9", + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.5", + "@babel/helper-compilation-targets": "^7.26.5", "@babel/helper-module-transforms": "^7.26.0", - "@babel/helpers": "^7.26.0", - "@babel/parser": "^7.26.0", + "@babel/helpers": "^7.26.7", + "@babel/parser": "^7.26.7", "@babel/template": "^7.25.9", - "@babel/traverse": "^7.25.9", - "@babel/types": "^7.26.0", + "@babel/traverse": "^7.26.7", + "@babel/types": "^7.26.7", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -137,12 +140,13 @@ } }, "node_modules/@babel/generator": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.0.tgz", - "integrity": "sha512-/AIkAmInnWwgEAJGQr9vY0c66Mj6kjkE2ZPB1PurTRaRAh3U+J45sAQMjQDJdh4WbR3l0x5xkimXBKyBXXAu2w==", + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.5.tgz", + "integrity": "sha512-2caSP6fN9I7HOe6nqhtft7V4g7/V/gfDsC3Ag4W7kEzzvRGKqiv0pu0HogPiZ3KaVSoNDhUws6IJjDjpfmYIXw==", + "license": "MIT", "dependencies": { - "@babel/parser": "^7.26.0", - "@babel/types": "^7.26.0", + "@babel/parser": "^7.26.5", + "@babel/types": "^7.26.5", "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^3.0.2" @@ -175,11 +179,12 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.9.tgz", - "integrity": "sha512-j9Db8Suy6yV/VHa4qzrj9yZfZxhLWQdVnRlXxmKLYlhWUVB1sB2G5sxuWYXk/whHD9iW76PmNzxZ4UCnTQTVEQ==", + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.26.5.tgz", + "integrity": "sha512-IXuyn5EkouFJscIDuFF5EsiSolseme1s0CZB+QxVugqJLYmKdxI1VfIBOst0SUu4rnk2Z7kqTwmoO1lp3HIfnA==", + "license": "MIT", "dependencies": { - "@babel/compat-data": "^7.25.9", + "@babel/compat-data": "^7.26.5", "@babel/helper-validator-option": "^7.25.9", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", @@ -394,23 +399,25 @@ } }, "node_modules/@babel/helpers": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.0.tgz", - "integrity": "sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw==", + "version": "7.26.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.7.tgz", + "integrity": "sha512-8NHiL98vsi0mbPQmYAGWwfcFaOy4j2HY49fXJCfuDcdE7fMIsH9a7GdaeXpIBsbT7307WU8KCMp5pUVDNL4f9A==", + "license": "MIT", "dependencies": { "@babel/template": "^7.25.9", - "@babel/types": "^7.26.0" + "@babel/types": "^7.26.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/parser": { - "version": "7.26.1", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.1.tgz", - "integrity": "sha512-reoQYNiAJreZNsJzyrDNzFQ+IQ5JFiIzAHJg9bn94S3l+4++J7RsIhNMoB+lgP/9tpmiAQqspv+xfdxTSzREOw==", + "version": "7.26.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.7.tgz", + "integrity": "sha512-kEvgGGgEjRUutvdVvZhbn/BxVt+5VSpwXz1j3WYXQbXDo8KzFOPNG2GQbdAiNq8g6wn1yKk7C/qrke03a84V+w==", + "license": "MIT", "dependencies": { - "@babel/types": "^7.26.0" + "@babel/types": "^7.26.7" }, "bin": { "parser": "bin/babel-parser.js" @@ -1707,15 +1714,16 @@ } }, "node_modules/@babel/traverse": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.9.tgz", - "integrity": "sha512-ZCuvfwOwlz/bawvAuvcj8rrithP2/N55Tzz342AkTvq4qaWbGfmCk/tKhNaV2cthijKrPAA8SRJV5WWe7IBMJw==", + "version": "7.26.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.7.tgz", + "integrity": "sha512-1x1sgeyRLC3r5fQOM0/xtQKsYjyxmFjaOrLJNtZ81inNjyJHGIolTULPiSc/2qe1/qfpFLisLQYFnnZl7QoedA==", + "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.25.9", - "@babel/generator": "^7.25.9", - "@babel/parser": "^7.25.9", + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.5", + "@babel/parser": "^7.26.7", "@babel/template": "^7.25.9", - "@babel/types": "^7.25.9", + "@babel/types": "^7.26.7", "debug": "^4.3.1", "globals": "^11.1.0" }, @@ -1733,9 +1741,10 @@ } }, "node_modules/@babel/types": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.0.tgz", - "integrity": "sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA==", + "version": "7.26.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.7.tgz", + "integrity": "sha512-t8kDRGrKXyp6+tjUh7hw2RLyclsW4TRoRvRHtSyAX9Bb5ldlFh+90YAYY6awRXrlB4G5G2izNeGySpATlFzmOg==", + "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.25.9", "@babel/helper-validator-identifier": "^7.25.9" diff --git a/package.json b/package.json index c7781d69c..c27922422 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,7 @@ ] }, "dependencies": { - "@babel/core": "^7.26.0", + "@babel/core": "^7.26.7", "@babel/plugin-transform-runtime": "^7.25.9", "@babel/preset-env": "^7.26.0", "@babel/preset-react": "^7.26.3", From 1576a946b017c749633d7f819899a6257d004467 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 18:09:34 +0000 Subject: [PATCH 14/44] Bump @babel/preset-env from 7.26.0 to 7.26.7 Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.26.0 to 7.26.7. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.26.7/packages/babel-preset-env) --- updated-dependencies: - dependency-name: "@babel/preset-env" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 103 +++++++++++++++++++--------------------------- package.json | 2 +- 2 files changed, 43 insertions(+), 62 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2bef0ba67..281c24b1f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "dependencies": { "@babel/core": "^7.26.7", "@babel/plugin-transform-runtime": "^7.25.9", - "@babel/preset-env": "^7.26.0", + "@babel/preset-env": "^7.26.7", "@babel/preset-react": "^7.26.3", "@googleapis/drive": "^8.14.0", "body-parser": "^1.20.2", @@ -166,18 +166,6 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/helper-builder-binary-assignment-operator-visitor": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.25.9.tgz", - "integrity": "sha512-C47lC7LIDCnz0h4vai/tpNOI95tCd5ZT3iBt/DBH5lXKHZsyNQv18yf1wIIg2ntiQNgmAvA+DgZ82iW8Qdym8g==", - "dependencies": { - "@babel/traverse": "^7.25.9", - "@babel/types": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/helper-compilation-targets": { "version": "7.26.5", "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.26.5.tgz", @@ -298,9 +286,10 @@ } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.9.tgz", - "integrity": "sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw==", + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.26.5.tgz", + "integrity": "sha512-RS+jZcRdZdRFzMyr+wcsaqOmld1/EqTghfaBGQQd/WnRdzdlvSZ//kF7U8VQTxf1ynZ4cjUcYgjVGx13ewNPMg==", + "license": "MIT", "engines": { "node": ">=6.9.0" } @@ -337,18 +326,6 @@ "@babel/core": "^7.0.0" } }, - "node_modules/@babel/helper-simple-access": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.25.9.tgz", - "integrity": "sha512-c6WHXuiaRsJTyHYLJV75t9IqsmTbItYfdj99PnzYGQZkYKvan5/2jKJ7gu31J3/BJ/A18grImSPModuyG/Eo0Q==", - "dependencies": { - "@babel/traverse": "^7.25.9", - "@babel/types": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/helper-skip-transparent-expression-wrappers": { "version": "7.25.9", "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.25.9.tgz", @@ -793,11 +770,12 @@ } }, "node_modules/@babel/plugin-transform-block-scoped-functions": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.25.9.tgz", - "integrity": "sha512-toHc9fzab0ZfenFpsyYinOX0J/5dgJVA2fm64xPewu7CoYHWEivIWKxkK2rMi4r3yQqLnVmheMXRdG+k239CgA==", + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.26.5.tgz", + "integrity": "sha512-chuTSY+hq09+/f5lMj8ZSYgCFpppV2CbYrhNFJ1BFoXpiWPnnAb7R0MqrafCpN8E1+YRrtM1MXZHJdIx8B6rMQ==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-plugin-utils": "^7.26.5" }, "engines": { "node": ">=6.9.0" @@ -965,11 +943,11 @@ } }, "node_modules/@babel/plugin-transform-exponentiation-operator": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.25.9.tgz", - "integrity": "sha512-KRhdhlVk2nObA5AYa7QMgTMTVJdfHprfpAk4DjZVtllqRg9qarilstTKEhpVjyt+Npi8ThRyiV8176Am3CodPA==", + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.26.3.tgz", + "integrity": "sha512-7CAHcQ58z2chuXPWblnn1K6rLDnDWieghSOEmqQsrBenH0P9InCUtOJYD89pvngljmZlJcz3fcmgYsXFNGa1ZQ==", + "license": "MIT", "dependencies": { - "@babel/helper-builder-binary-assignment-operator-visitor": "^7.25.9", "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { @@ -1096,13 +1074,13 @@ } }, "node_modules/@babel/plugin-transform-modules-commonjs": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.25.9.tgz", - "integrity": "sha512-dwh2Ol1jWwL2MgkCzUSOvfmKElqQcuswAZypBSUsScMXvgdT8Ekq5YA6TtqpTVWH+4903NmboMuH1o9i8Rxlyg==", + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.26.3.tgz", + "integrity": "sha512-MgR55l4q9KddUDITEzEFYn5ZsGDXMSsU9E+kh7fjRXTIC3RHqfCo8RPRbyReYJh44HQ/yomFkqbOFohXvDCiIQ==", + "license": "MIT", "dependencies": { - "@babel/helper-module-transforms": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9", - "@babel/helper-simple-access": "^7.25.9" + "@babel/helper-module-transforms": "^7.26.0", + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1173,11 +1151,12 @@ } }, "node_modules/@babel/plugin-transform-nullish-coalescing-operator": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.25.9.tgz", - "integrity": "sha512-ENfftpLZw5EItALAD4WsY/KUWvhUlZndm5GC7G3evUsVeSJB6p0pBeLQUnRnBCBx7zV0RKQjR9kCuwrsIrjWog==", + "version": "7.26.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.26.6.tgz", + "integrity": "sha512-CKW8Vu+uUZneQCPtXmSBUC6NCAUdya26hWCElAWh5mVSlSRsmiCPUUDKb3Z0szng1hiAJa098Hkhg9o4SE35Qw==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-plugin-utils": "^7.26.5" }, "engines": { "node": ">=6.9.0" @@ -1501,11 +1480,12 @@ } }, "node_modules/@babel/plugin-transform-typeof-symbol": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.25.9.tgz", - "integrity": "sha512-v61XqUMiueJROUv66BVIOi0Fv/CUuZuZMl5NkRoCVxLAnMexZ0A3kMe7vvZ0nulxMuMp0Mk6S5hNh48yki08ZA==", + "version": "7.26.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.26.7.tgz", + "integrity": "sha512-jfoTXXZTgGg36BmhqT3cAYK5qkmqvJpvNrPhaK/52Vgjhw4Rq29s9UqpWWV0D6yuRmgiFH/BUVlkl96zJWqnaw==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-plugin-utils": "^7.26.5" }, "engines": { "node": ">=6.9.0" @@ -1574,13 +1554,14 @@ } }, "node_modules/@babel/preset-env": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.26.0.tgz", - "integrity": "sha512-H84Fxq0CQJNdPFT2DrfnylZ3cf5K43rGfWK4LJGPpjKHiZlk0/RzwEus3PDDZZg+/Er7lCA03MVacueUuXdzfw==", + "version": "7.26.7", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.26.7.tgz", + "integrity": "sha512-Ycg2tnXwixaXOVb29rana8HNPgLVBof8qqtNQ9LE22IoyZboQbGSxI6ZySMdW3K5nAe6gu35IaJefUJflhUFTQ==", + "license": "MIT", "dependencies": { - "@babel/compat-data": "^7.26.0", - "@babel/helper-compilation-targets": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9", + "@babel/compat-data": "^7.26.5", + "@babel/helper-compilation-targets": "^7.26.5", + "@babel/helper-plugin-utils": "^7.26.5", "@babel/helper-validator-option": "^7.25.9", "@babel/plugin-bugfix-firefox-class-in-computed-class-key": "^7.25.9", "@babel/plugin-bugfix-safari-class-field-initializer-scope": "^7.25.9", @@ -1594,7 +1575,7 @@ "@babel/plugin-transform-arrow-functions": "^7.25.9", "@babel/plugin-transform-async-generator-functions": "^7.25.9", "@babel/plugin-transform-async-to-generator": "^7.25.9", - "@babel/plugin-transform-block-scoped-functions": "^7.25.9", + "@babel/plugin-transform-block-scoped-functions": "^7.26.5", "@babel/plugin-transform-block-scoping": "^7.25.9", "@babel/plugin-transform-class-properties": "^7.25.9", "@babel/plugin-transform-class-static-block": "^7.26.0", @@ -1605,7 +1586,7 @@ "@babel/plugin-transform-duplicate-keys": "^7.25.9", "@babel/plugin-transform-duplicate-named-capturing-groups-regex": "^7.25.9", "@babel/plugin-transform-dynamic-import": "^7.25.9", - "@babel/plugin-transform-exponentiation-operator": "^7.25.9", + "@babel/plugin-transform-exponentiation-operator": "^7.26.3", "@babel/plugin-transform-export-namespace-from": "^7.25.9", "@babel/plugin-transform-for-of": "^7.25.9", "@babel/plugin-transform-function-name": "^7.25.9", @@ -1614,12 +1595,12 @@ "@babel/plugin-transform-logical-assignment-operators": "^7.25.9", "@babel/plugin-transform-member-expression-literals": "^7.25.9", "@babel/plugin-transform-modules-amd": "^7.25.9", - "@babel/plugin-transform-modules-commonjs": "^7.25.9", + "@babel/plugin-transform-modules-commonjs": "^7.26.3", "@babel/plugin-transform-modules-systemjs": "^7.25.9", "@babel/plugin-transform-modules-umd": "^7.25.9", "@babel/plugin-transform-named-capturing-groups-regex": "^7.25.9", "@babel/plugin-transform-new-target": "^7.25.9", - "@babel/plugin-transform-nullish-coalescing-operator": "^7.25.9", + "@babel/plugin-transform-nullish-coalescing-operator": "^7.26.6", "@babel/plugin-transform-numeric-separator": "^7.25.9", "@babel/plugin-transform-object-rest-spread": "^7.25.9", "@babel/plugin-transform-object-super": "^7.25.9", @@ -1636,7 +1617,7 @@ "@babel/plugin-transform-spread": "^7.25.9", "@babel/plugin-transform-sticky-regex": "^7.25.9", "@babel/plugin-transform-template-literals": "^7.25.9", - "@babel/plugin-transform-typeof-symbol": "^7.25.9", + "@babel/plugin-transform-typeof-symbol": "^7.26.7", "@babel/plugin-transform-unicode-escapes": "^7.25.9", "@babel/plugin-transform-unicode-property-regex": "^7.25.9", "@babel/plugin-transform-unicode-regex": "^7.25.9", diff --git a/package.json b/package.json index c27922422..840975977 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,7 @@ "dependencies": { "@babel/core": "^7.26.7", "@babel/plugin-transform-runtime": "^7.25.9", - "@babel/preset-env": "^7.26.0", + "@babel/preset-env": "^7.26.7", "@babel/preset-react": "^7.26.3", "@googleapis/drive": "^8.14.0", "body-parser": "^1.20.2", From 36df121cf66b530d30beb6266ed897115b4fe350 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Mon, 27 Jan 2025 23:10:37 -0500 Subject: [PATCH 15/44] 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 16/44] 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 17/44] 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 d69288076af8f86e2f877b5f02d09be79e25ba48 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Mon, 27 Jan 2025 23:34:50 -0500 Subject: [PATCH 18/44] Change to _.escape() to escape HTML characters --- client/homebrew/pages/errorPage/errors/errorIndex.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/homebrew/pages/errorPage/errors/errorIndex.js b/client/homebrew/pages/errorPage/errors/errorIndex.js index caa5e662c..1353cf889 100644 --- a/client/homebrew/pages/errorPage/errors/errorIndex.js +++ b/client/homebrew/pages/errorPage/errors/errorIndex.js @@ -1,4 +1,5 @@ const dedent = require('dedent-tabs').default; +import _ from 'lodash'; const loginUrl = 'https://www.naturalcrit.com/login'; @@ -89,7 +90,7 @@ const errorIndex = (props)=>{ : - **Brew Title:**
${props.brew.brewTitle || 'Unable to show title'}
+ **Brew Title:** ${_.escape(props.brew.brewTitle) || 'Unable to show title'} **Current Authors:** ${props.brew.authors?.map((author)=>{return `[${author}](/user/${author})`;}).join(', ') || 'Unable to list authors'} @@ -104,7 +105,7 @@ const errorIndex = (props)=>{ : - **Brew Title:**
${props.brew.brewTitle || 'Unable to show title'}
+ **Brew Title:** ${_.escape(props.brew.brewTitle) || 'Unable to show title'} **Current Authors:** ${props.brew.authors?.map((author)=>{return `[${author}](/user/${author})`;}).join(', ') || 'Unable to list authors'} @@ -181,7 +182,7 @@ const errorIndex = (props)=>{ **Brew ID:** ${props.brew.brewId} - **Brew Title:**
${props.brew.brewTitle}
`, + **Brew Title:** ${_.escape(props.brew.brewTitle)}`, // ####### Admin page error ####### '52' : dedent` From 73c2be147cb56e18b515abaeb61c52e9a15551f3 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Tue, 28 Jan 2025 00:13:51 -0500 Subject: [PATCH 19/44] Custom escape function --- client/homebrew/pages/errorPage/errors/errorIndex.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/client/homebrew/pages/errorPage/errors/errorIndex.js b/client/homebrew/pages/errorPage/errors/errorIndex.js index 1353cf889..5c21b719c 100644 --- a/client/homebrew/pages/errorPage/errors/errorIndex.js +++ b/client/homebrew/pages/errorPage/errors/errorIndex.js @@ -7,6 +7,10 @@ const loginUrl = 'https://www.naturalcrit.com/login'; //050-100 : Other pages errors const errorIndex = (props)=>{ + const escape = (text) => { + return text.split('').map(char => `\\${char}`).join(''); + }; + return { // Default catch all '00' : dedent` @@ -90,7 +94,7 @@ const errorIndex = (props)=>{ : - **Brew Title:** ${_.escape(props.brew.brewTitle) || 'Unable to show title'} + **Brew Title:** ${escape(props.brew.brewTitle) || 'Unable to show title'} **Current Authors:** ${props.brew.authors?.map((author)=>{return `[${author}](/user/${author})`;}).join(', ') || 'Unable to list authors'} @@ -105,7 +109,7 @@ const errorIndex = (props)=>{ : - **Brew Title:** ${_.escape(props.brew.brewTitle) || 'Unable to show title'} + **Brew Title:** ${escape(props.brew.brewTitle) || 'Unable to show title'} **Current Authors:** ${props.brew.authors?.map((author)=>{return `[${author}](/user/${author})`;}).join(', ') || 'Unable to list authors'} @@ -182,7 +186,7 @@ const errorIndex = (props)=>{ **Brew ID:** ${props.brew.brewId} - **Brew Title:** ${_.escape(props.brew.brewTitle)}`, + **Brew Title:** ${escape(props.brew.brewTitle)}`, // ####### Admin page error ####### '52' : dedent` From ecd8869097a8c81260f572f24ae278185b3ddda9 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Tue, 28 Jan 2025 00:17:08 -0500 Subject: [PATCH 20/44] Add a comment --- client/homebrew/pages/errorPage/errors/errorIndex.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/client/homebrew/pages/errorPage/errors/errorIndex.js b/client/homebrew/pages/errorPage/errors/errorIndex.js index 5c21b719c..fe8e505e5 100644 --- a/client/homebrew/pages/errorPage/errors/errorIndex.js +++ b/client/homebrew/pages/errorPage/errors/errorIndex.js @@ -3,14 +3,15 @@ import _ from 'lodash'; 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}`).join(''); +}; + //001-050 : Brew errors //050-100 : Other pages errors const errorIndex = (props)=>{ - const escape = (text) => { - return text.split('').map(char => `\\${char}`).join(''); - }; - return { // Default catch all '00' : dedent` From 6a31d612e632e95d3ccfdf410f9e8186a5af1fb5 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Tue, 28 Jan 2025 00:24:15 -0500 Subject: [PATCH 21/44] Escape to HTML entities --- client/homebrew/pages/errorPage/errors/errorIndex.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/homebrew/pages/errorPage/errors/errorIndex.js b/client/homebrew/pages/errorPage/errors/errorIndex.js index fe8e505e5..63cb2619f 100644 --- a/client/homebrew/pages/errorPage/errors/errorIndex.js +++ b/client/homebrew/pages/errorPage/errors/errorIndex.js @@ -5,7 +5,7 @@ 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}`).join(''); + return text.split('').map(char => `&#${char.charCodeAt(0)};`).join(''); }; //001-050 : Brew errors From 3e78b037850390b3e94a06d9021c6c1417ea7f11 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Tue, 28 Jan 2025 00:28:46 -0500 Subject: [PATCH 22/44] Remove lodash again --- client/homebrew/pages/errorPage/errors/errorIndex.js | 1 - 1 file changed, 1 deletion(-) diff --git a/client/homebrew/pages/errorPage/errors/errorIndex.js b/client/homebrew/pages/errorPage/errors/errorIndex.js index 63cb2619f..f7614a37a 100644 --- a/client/homebrew/pages/errorPage/errors/errorIndex.js +++ b/client/homebrew/pages/errorPage/errors/errorIndex.js @@ -1,5 +1,4 @@ const dedent = require('dedent-tabs').default; -import _ from 'lodash'; const loginUrl = 'https://www.naturalcrit.com/login'; From 6dfd44e2f12e3daa5e94c91c25e3f9f4457095f1 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Wed, 29 Jan 2025 11:48:18 -0500 Subject: [PATCH 23/44] 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 24/44] 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 25/44] 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 26/44] 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 27/44] 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 28/44] 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 29/44] 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 30/44] 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 31/44] 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 32/44] 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 33/44] 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 34/44] 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 35/44] 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 36/44] 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 37/44] 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 38/44] 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 39/44] 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 40/44] 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 41/44] 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 42/44] 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 43/44] 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 44/44] 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;