From 086468d65b5394dc02bf41bc96bacd57f05c0e5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Mon, 12 Feb 2024 08:12:53 +0100 Subject: [PATCH 1/6] initial commit --- client/homebrew/pages/printPage/printPage.jsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/client/homebrew/pages/printPage/printPage.jsx b/client/homebrew/pages/printPage/printPage.jsx index 37376d4b2..8e640424b 100644 --- a/client/homebrew/pages/printPage/printPage.jsx +++ b/client/homebrew/pages/printPage/printPage.jsx @@ -21,7 +21,8 @@ const PrintPage = createClass({ brew : { text : '', style : '', - renderer : 'legacy' + renderer : 'legacy', + lang : '' } }; }, @@ -32,7 +33,8 @@ const PrintPage = createClass({ text : this.props.brew.text || '', style : this.props.brew.style || undefined, renderer : this.props.brew.renderer || 'legacy', - theme : this.props.brew.theme || '5ePHB' + theme : this.props.brew.theme || '5ePHB', + lang : this.props.brew.lang || 'en-US' } }; }, @@ -49,7 +51,8 @@ const PrintPage = createClass({ text : brewStorage, style : styleStorage, renderer : metaStorage?.renderer || 'legacy', - theme : metaStorage?.theme || '5ePHB' + theme : metaStorage?.theme || '5ePHB', + lang : metaStorage?.lang || 'en-US' } }; }); @@ -100,7 +103,7 @@ const PrintPage = createClass({ {/* Apply CSS from Style tab */} {this.renderStyle()} -
+
{this.renderPages()}
; From 209c237b73bbbebba6b96786feade8293e7a2f01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Mon, 12 Feb 2024 08:54:00 +0100 Subject: [PATCH 2/6] en-US to en --- client/homebrew/pages/printPage/printPage.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/homebrew/pages/printPage/printPage.jsx b/client/homebrew/pages/printPage/printPage.jsx index 8e640424b..083410804 100644 --- a/client/homebrew/pages/printPage/printPage.jsx +++ b/client/homebrew/pages/printPage/printPage.jsx @@ -34,7 +34,7 @@ const PrintPage = createClass({ style : this.props.brew.style || undefined, renderer : this.props.brew.renderer || 'legacy', theme : this.props.brew.theme || '5ePHB', - lang : this.props.brew.lang || 'en-US' + lang : this.props.brew.lang || 'en' } }; }, @@ -52,7 +52,7 @@ const PrintPage = createClass({ style : styleStorage, renderer : metaStorage?.renderer || 'legacy', theme : metaStorage?.theme || '5ePHB', - lang : metaStorage?.lang || 'en-US' + lang : metaStorage?.lang || 'en' } }; }); From 7e38271ac6cb7d6d607c2010d6170c1325543bc3 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Wed, 21 Feb 2024 17:30:15 -0500 Subject: [PATCH 3/6] Up to v3.11.0 --- changelog.md | 177 ++++++++++++++++++++++++++++++++++++++++++++++ package-lock.json | 4 +- package.json | 2 +- 3 files changed, 180 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index 9f4a07ab2..e86c2ea0f 100644 --- a/changelog.md +++ b/changelog.md @@ -75,11 +75,188 @@ pre { .page { padding-bottom: 1.5cm; } + +.varSyntaxTable th:first-of-type { + width:6cm; +} ``` ## changelog For a full record of development, visit our [Github Page](https://github.com/naturalcrit/homebrewery). +### Wednesday 21/2/2024 - v3.11.0 +{{taskList + +##### Gazook89 + +* [x] Brew view count no longer increases when viewed by owner + +Fixes issue [#3037](https://github.com/naturalcrit/homebrewery/issues/3037) + +* [x] Small tweak to PHB H3 sizing + +Fixes issue [#2989](https://github.com/naturalcrit/homebrewery/issues/2989) + +* [x] Add **Fold/Unfold All** {{fas,fa-compress-alt}} / {{fas,fa-expand-alt}} buttons to editor bar + +Fixes issue [#2965](https://github.com/naturalcrit/homebrewery/issues/2965) + + +##### G-Ambatte + +* [x] Share link added to Editor Access error page + +Fixes issue [#3086](https://github.com/naturalcrit/homebrewery/issues/3086) + +* [x] Add Darkbrewery theme to Editor theme selector {{fas,fa-palette}} + +Fixes issue [#3034](https://github.com/naturalcrit/homebrewery/issues/3034) + +* [x] Fix Firefox prints with alternating blank pages + +Fixes issue [#3115](https://github.com/naturalcrit/homebrewery/issues/3115) + +* [x] Admin page working again + +Fixes issue [#2657](https://github.com/naturalcrit/homebrewery/issues/2657) + + +##### 5e-Cleric + +* [x] Fix indenting issue with Monster Blocks and italics in Class Feature + +Fixes issues [#527](https://github.com/naturalcrit/homebrewery/issues/527), +[#3247](https://github.com/naturalcrit/homebrewery/issues/3247) + +* [x] Allow CSS vars in curly syntax to be formatted as strings using single quotes + +`{{--customVar:"'a string'"}}` + +Fixes issue [#3066](https://github.com/naturalcrit/homebrewery/issues/3066) + +* [x] Add *Elderberry Inn* icons {{ei,action}} `{{ei,icon-name}}` + +Fixes issue [#3171](https://github.com/naturalcrit/homebrewery/issues/3171) + +* [x] New {{openSans **{{fas,fa-keyboard}} FONTS** }} snippets! + +Fixes issue [#3171](https://github.com/naturalcrit/homebrewery/issues/3171) + +* [x] New page now opens in a new tab + + +##### abquintic (new contributor!) + +* [x] Add ^super^ `^abc^` and ^^sub^^ `^^abc^^` syntax. + +Fixes issue [#2171](https://github.com/naturalcrit/homebrewery/issues/2171) + +* [x] Add HTML tag assignment to curly syntax `{{tag=value}}` + +Fixes issue [1488](https://github.com/naturalcrit/homebrewery/issues/1488) + +* [x] {{openSans **Brew → Clone to New**}} now clones tags + +Fixes issue [1488](https://github.com/naturalcrit/homebrewery/issues/1488) + +##### calculuschild + +* [x] Better error messages for "Out of Google Drive Storage" and "Not logged in to edit" + +Fixes issues [2510](https://github.com/naturalcrit/homebrewery/issues/2510), +[2975](https://github.com/naturalcrit/homebrewery/issues/2975) + +* [x] New Variables syntax. See below for details. +}} + +{{wide + +### Brew Variable Syntax + +You may already be familiar with `[link](url)` and `![image](url)` syntax. We have expanded this to include a third `$[variable](text)` syntax. All three of these syntaxes now share a common set of features: + +{{varSyntaxTable +| syntax | description | +|:-------|-------------| +| `[var]:content` | Assigns a variable (must start on a line by itself, and ends at the next blank line) | +| `[var](content)` | Assigns a variable and outputs it (can be inline) | +| `[var]` | Outputs the variable contents as a link, if formatted as a valid link | +| `![var]` | Outputs as an image, if formatted as a valid image | +| `$[var]` | Outputs as Markdown | +| `$[var1 + var2 - 2 * var3]` | Performs math operations and outputs result if all variables are valid numbers | +}} + +}} + +{{wide,margin-top:0,margin-bottom:0 +### Examples +}} + +{{wide,columns:2,margin-top:0,margin-bottom:0 + +``` +[first]: Bob + +[last]: Jones + +My name is $[first] $[last]. +``` + +\column + +[first]: Bob + +[last]: Jones + +My name is $[first] $[last]. + +}} + +{{wide,columns:2,margin-top:0,margin-bottom:0 + +``` +[myTable]: +| h1 | h2 | +|----|----| +| c1 | c2 | + +Here is my table: +$[myTable] +``` + +\column + +[myTable]: +| h1 | h2 | +|----|----| +| c1 | c2 | + +Here is my table: +$[myTable] +}} + +{{wide,columns:2,margin-top:0,margin-bottom:0 + +``` +There are $[TableNum] tables total. + +#### Table $[TableNum](1): Horses + +#### Table $[TableNum]($[TableNum + 1]): Cows +``` + +\column + +There are $[TableNum] tables in this document. *(note: final value of `$[TableNum]` gets hoisted up if available)* + + +#### Table $[TableNum](1): Horses + +#### Table $[TableNum]($[TableNum + 1]): Cows +}} + +\page + ### Friday 13/10/2023 - v3.10.0 {{taskList diff --git a/package-lock.json b/package-lock.json index be38f6a32..a4073ec11 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "homebrewery", - "version": "3.10.0", + "version": "3.11.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "homebrewery", - "version": "3.10.0", + "version": "3.11.0", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index b3b5342e1..79159d082 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.10.0", + "version": "3.11.0", "engines": { "npm": "^10.2.x", "node": "^20.8.x" From e26885894507db6fdc0563648dc6ccb99a83a988 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Feb 2024 22:31:38 +0000 Subject: [PATCH 4/6] Bump eslint-plugin-jest from 27.6.3 to 27.9.0 Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 27.6.3 to 27.9.0. - [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases) - [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/jest-community/eslint-plugin-jest/compare/v27.6.3...v27.9.0) --- updated-dependencies: - dependency-name: eslint-plugin-jest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 10 +++++----- package.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index a4073ec11..dd74f36c5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -49,7 +49,7 @@ }, "devDependencies": { "eslint": "^8.56.0", - "eslint-plugin-jest": "^27.6.3", + "eslint-plugin-jest": "^27.9.0", "eslint-plugin-react": "^7.33.2", "jest": "^29.7.0", "jest-expect-message": "^1.1.3", @@ -5643,9 +5643,9 @@ } }, "node_modules/eslint-plugin-jest": { - "version": "27.6.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-27.6.3.tgz", - "integrity": "sha512-+YsJFVH6R+tOiO3gCJon5oqn4KWc+mDq2leudk8mrp8RFubLOo9CVyi3cib4L7XMpxExmkmBZQTPDYVBzgpgOA==", + "version": "27.9.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-27.9.0.tgz", + "integrity": "sha512-QIT7FH7fNmd9n4se7FFKHbsLKGQiw885Ds6Y/sxKgCZ6natwCsXdgPOADnYVxN2QrRweF0FZWbJ6S7Rsn7llug==", "dev": true, "dependencies": { "@typescript-eslint/utils": "^5.10.0" @@ -5654,7 +5654,7 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" }, "peerDependencies": { - "@typescript-eslint/eslint-plugin": "^5.0.0 || ^6.0.0", + "@typescript-eslint/eslint-plugin": "^5.0.0 || ^6.0.0 || ^7.0.0", "eslint": "^7.0.0 || ^8.0.0", "jest": "*" }, diff --git a/package.json b/package.json index 79159d082..3852ffe13 100644 --- a/package.json +++ b/package.json @@ -119,7 +119,7 @@ }, "devDependencies": { "eslint": "^8.56.0", - "eslint-plugin-jest": "^27.6.3", + "eslint-plugin-jest": "^27.9.0", "eslint-plugin-react": "^7.33.2", "jest": "^29.7.0", "jest-expect-message": "^1.1.3", From 8779ee3325927ebf05f556ca766271ffdaf0ba52 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Wed, 21 Feb 2024 21:42:03 -0500 Subject: [PATCH 5/6] Variable math requires `$` prefix --- shared/naturalcrit/markdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 79b2c1ce9..09f810907 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -342,7 +342,7 @@ const replaceVar = function(input, hoist=false, allowUnresolved=false) { let replacedLabel = label; - if(mathVars?.[0] !== label.trim()) {// If there was mathy stuff not captured, let's do math! + if(prefix[0] == '$' && mathVars?.[0] !== label.trim()) {// If there was mathy stuff not captured, let's do math! mathVars?.forEach((variable)=>{ const foundVar = lookupVar(variable, globalPageNumber, hoist); if(foundVar && foundVar.resolved && foundVar.content && !isNaN(foundVar.content)) // Only subsitute math values if fully resolved, not empty strings, and numbers From 2c02d4174faab0e48242a4a4f53291faeff0bbb0 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Thu, 22 Feb 2024 17:06:02 +1300 Subject: [PATCH 6/6] Fix sanitizeScriptTags when content is null --- client/homebrew/brewRenderer/brewRenderer.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/homebrew/brewRenderer/brewRenderer.jsx b/client/homebrew/brewRenderer/brewRenderer.jsx index 58dd59bee..f1c9cdeda 100644 --- a/client/homebrew/brewRenderer/brewRenderer.jsx +++ b/client/homebrew/brewRenderer/brewRenderer.jsx @@ -104,8 +104,9 @@ const BrewRenderer = (props)=>{ const sanitizeScriptTags = (content)=>{ return content - .replace(/