mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-25 22:42:41 +00:00
Merge branch 'master' into fixMonsterBg
This commit is contained in:
177
changelog.md
177
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 `` 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
|
||||
|
||||
|
||||
@@ -104,8 +104,9 @@ const BrewRenderer = (props)=>{
|
||||
|
||||
const sanitizeScriptTags = (content)=>{
|
||||
return content
|
||||
.replace(/<script/ig, '<script')
|
||||
.replace(/<\/script>/ig, '</script>');
|
||||
?.replace(/<script/ig, '<script')
|
||||
.replace(/<\/script>/ig, '</script>')
|
||||
|| '';
|
||||
};
|
||||
|
||||
const renderPageInfo = ()=>{
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
};
|
||||
},
|
||||
@@ -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'
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -100,7 +103,7 @@ const PrintPage = createClass({
|
||||
<link href={`/themes/${rendererPath}/${themePath}/style.css`} rel='stylesheet'/>
|
||||
{/* Apply CSS from Style tab */}
|
||||
{this.renderStyle()}
|
||||
<div className='pages' ref='pages'>
|
||||
<div className='pages' ref='pages' lang={this.state.brew.lang}>
|
||||
{this.renderPages()}
|
||||
</div>
|
||||
</div>;
|
||||
|
||||
14
package-lock.json
generated
14
package-lock.json
generated
@@ -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": {
|
||||
@@ -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": "*"
|
||||
},
|
||||
|
||||
@@ -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"
|
||||
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user