From fd5ff2c61a38137ec956491a7e31a8bf2ab7287b Mon Sep 17 00:00:00 2001 From: David Bolack Date: Fri, 23 Aug 2024 14:04:04 -0500 Subject: [PATCH 01/45] Relocate more general purposes snippets from 5ePHB to Blank Should include all supporting style content. --- themes/V3/5ePHB/snippets.js | 128 ------------------ themes/V3/Blank/snippets.js | 73 +++++++++- .../V3/{5ePHB => Blank}/snippets/index.gen.js | 0 .../snippets/tableOfContents.gen.js | 0 themes/V3/Blank/style.less | 127 +++++++++++++++++ 5 files changed, 199 insertions(+), 129 deletions(-) rename themes/V3/{5ePHB => Blank}/snippets/index.gen.js (100%) rename themes/V3/{5ePHB => Blank}/snippets/tableOfContents.gen.js (100%) diff --git a/themes/V3/5ePHB/snippets.js b/themes/V3/5ePHB/snippets.js index 4daa05c51..f5c8120c1 100644 --- a/themes/V3/5ePHB/snippets.js +++ b/themes/V3/5ePHB/snippets.js @@ -6,138 +6,13 @@ const MonsterBlockGen = require('./snippets/monsterblock.gen.js'); const scriptGen = require('./snippets/script.gen.js'); const ClassFeatureGen = require('./snippets/classfeature.gen.js'); const CoverPageGen = require('./snippets/coverpage.gen.js'); -const TableOfContentsGen = require('./snippets/tableOfContents.gen.js'); -const indexGen = require('./snippets/index.gen.js'); const QuoteGen = require('./snippets/quote.gen.js'); const dedent = require('dedent-tabs').default; module.exports = [ - - { - groupName : 'Text Editor', - icon : 'fas fa-pencil-alt', - view : 'text', - snippets : [ - { - name : 'Table of Contents', - icon : 'fas fa-book', - gen : TableOfContentsGen, - experimental : true, - subsnippets : [ - { - name : 'Table of Contents', - icon : 'fas fa-book', - gen : TableOfContentsGen, - experimental : true - }, - { - name : 'Include in ToC up to H3', - icon : 'fas fa-dice-three', - gen : dedent `\n{{tocDepthH3 - }}\n`, - - }, - { - name : 'Include in ToC up to H4', - icon : 'fas fa-dice-four', - gen : dedent `\n{{tocDepthH4 - }}\n`, - }, - { - name : 'Include in ToC up to H5', - icon : 'fas fa-dice-five', - gen : dedent `\n{{tocDepthH5 - }}\n`, - }, - { - name : 'Include in ToC up to H6', - icon : 'fas fa-dice-six', - gen : dedent `\n{{tocDepthH6 - }}\n`, - } - ] - }, - { - name : 'Index', - icon : 'fas fa-bars', - gen : indexGen, - experimental : true - } - ] - }, - { - groupName : 'Style Editor', - icon : 'fas fa-pencil-alt', - view : 'style', - snippets : [ - { - name : 'Remove Drop Cap', - icon : 'fas fa-remove-format', - gen : dedent`/* Removes Drop Caps */ - .page h1+p:first-letter { - all: unset; - }\n\n - /* Removes Small-Caps in first line */ - .page h1+p:first-line { - all: unset; - }` - }, - { - name : 'Tweak Drop Cap', - icon : 'fas fa-sliders-h', - gen : dedent`/* Drop Cap settings */ - .page h1 + p::first-letter { - font-family: SolberaImitationRemake; - font-size: 3.5cm; - background-image: linear-gradient(-45deg, #322814, #998250, #322814); - line-height: 1em; - }\n\n` - } - ] - }, - - /*********************** IMAGES *******************/ - { - groupName : 'Images', - icon : 'fas fa-images', - view : 'text', - snippets : [ - { - name : 'Image', - icon : 'fas fa-image', - gen : dedent` - ![cat warrior](https://s-media-cache-ak0.pinimg.com/736x/4a/81/79/4a8179462cfdf39054a418efd4cb743e.jpg) {width:325px,mix-blend-mode:multiply} - - {{artist,position:relative,top:-230px,left:10px,margin-bottom:-30px - ##### Cat Warrior - [Kyoung Hwan Kim](https://www.artstation.com/tahra) - }}` - }, - { - name : 'Background Image', - icon : 'fas fa-tree', - gen : dedent` - ![homebrew mug](http://i.imgur.com/hMna6G0.png) {position:absolute,top:50px,right:30px,width:280px} - - {{artist,top:80px,right:30px - ##### Homebrew Mug - [naturalcrit](https://homebrew.naturalcrit.com) - }}` - }, - { - name : 'Watermark', - icon : 'fas fa-id-card', - gen : dedent` - {{watermark Homebrewery}}\n` - }, - ] - }, - - /************************* PHB ********************/ - { groupName : 'PHB', icon : 'fas fa-book', @@ -332,9 +207,6 @@ module.exports = [ ] }, - - - /**************** PAGE *************/ { diff --git a/themes/V3/Blank/snippets.js b/themes/V3/Blank/snippets.js index 8d45560c5..b30412bd0 100644 --- a/themes/V3/Blank/snippets.js +++ b/themes/V3/Blank/snippets.js @@ -4,6 +4,8 @@ const WatercolorGen = require('./snippets/watercolor.gen.js'); const ImageMaskGen = require('./snippets/imageMask.gen.js'); const FooterGen = require('./snippets/footer.gen.js'); const dedent = require('dedent-tabs').default; +const TableOfContentsGen = require('./snippets/tableOfContents.gen.js'); +const indexGen = require('./snippets/index.gen.js'); module.exports = [ @@ -125,7 +127,53 @@ module.exports = [ [Homebrewery.Naturalcrit.com](https://homebrewery.naturalcrit.com) }}\n\n`; }, - } + }, + { + name : 'Table of Contents', + icon : 'fas fa-book', + gen : TableOfContentsGen, + experimental : true, + subsnippets : [ + { + name : 'Table of Contents', + icon : 'fas fa-book', + gen : TableOfContentsGen, + experimental : true + }, + { + name : 'Include in ToC up to H3', + icon : 'fas fa-dice-three', + gen : dedent `\n{{tocDepthH3 + }}\n`, + + }, + { + name : 'Include in ToC up to H4', + icon : 'fas fa-dice-four', + gen : dedent `\n{{tocDepthH4 + }}\n`, + }, + { + name : 'Include in ToC up to H5', + icon : 'fas fa-dice-five', + gen : dedent `\n{{tocDepthH5 + }}\n`, + }, + { + name : 'Include in ToC up to H6', + icon : 'fas fa-dice-six', + gen : dedent `\n{{tocDepthH6 + }}\n`, + } + ] + }, + { + name : 'Index', + icon : 'fas fa-bars', + gen : indexGen, + experimental : true + }, + ] }, { @@ -138,6 +186,29 @@ module.exports = [ icon : 'fas fa-code', gen : '/* This is a comment that will not be rendered into your brew. */' }, + { + name : 'Remove Drop Cap', + icon : 'fas fa-remove-format', + gen : dedent`/* Removes Drop Caps */ + .page h1+p:first-letter { + all: unset; + }\n\n + /* Removes Small-Caps in first line */ + .page h1+p:first-line { + all: unset; + }` + }, + { + name : 'Tweak Drop Cap', + icon : 'fas fa-sliders-h', + gen : dedent`/* Drop Cap settings */ + .page h1 + p::first-letter { + font-family: SolberaImitationRemake; + font-size: 3.5cm; + background-image: linear-gradient(-45deg, #322814, #998250, #322814); + line-height: 1em; + }\n\n` + }, ] }, diff --git a/themes/V3/5ePHB/snippets/index.gen.js b/themes/V3/Blank/snippets/index.gen.js similarity index 100% rename from themes/V3/5ePHB/snippets/index.gen.js rename to themes/V3/Blank/snippets/index.gen.js diff --git a/themes/V3/5ePHB/snippets/tableOfContents.gen.js b/themes/V3/Blank/snippets/tableOfContents.gen.js similarity index 100% rename from themes/V3/5ePHB/snippets/tableOfContents.gen.js rename to themes/V3/Blank/snippets/tableOfContents.gen.js diff --git a/themes/V3/Blank/style.less b/themes/V3/Blank/style.less index 18a478cf9..4b0653f4b 100644 --- a/themes/V3/Blank/style.less +++ b/themes/V3/Blank/style.less @@ -482,3 +482,130 @@ body { counter-reset : page-numbers; } .pageNumber { left : 30px; } } } + +// ***************************** +// * INDEX +// *****************************/ +.page { + .index { + font-size : 0.218cm; + + ul ul { margin : 0; } + + ul { + padding-left : 0; + text-indent : 0; + list-style-type : none; + } + + & > ul > li { + padding-left : 1.5em; + text-indent : -1.5em; + } + } +} + +// ***************************** +// * TABLE OF CONTENTS +// *****************************/ + +// Default Exclusions +// Anything not exlcuded is included, default Headers are H1, H2, and H3. +h4, +h5, +h6, +.page:has(.frontCover), +.page:has(.backCover), +.page:has(.insideCover), +.monster, +.noToC, +.toc { --TOC: exclude; } + +.tocDepthH2 :is(h1, h2) {--TOC: include; } +.tocDepthH3 :is(h1, h2, h3) {--TOC: include; } +.tocDepthH4 :is(h1, h2, h3, h4) {--TOC: include; } +.tocDepthH5 :is(h1, h2, h3, h4, h5) {--TOC: include; } +.tocDepthH6 :is(h1, h2, h3, h4, h5, h6) {--TOC: include; } + +.tocIncludeH1 h1 {--TOC: include; } +.tocIncludeH2 h2 {--TOC: include; } +.tocIncludeH3 h3 {--TOC: include; } +.tocIncludeH4 h4 {--TOC: include; } +.tocIncludeH5 h5 {--TOC: include; } +.tocIncludeH6 h6 {--TOC: include; } + +.page:has(.partCover) { + --TOC: exclude; + & h1 { + --TOC: include; + } + } + +.page { + &:has(.toc)::after { display : none; } + .toc { + -webkit-column-break-inside : avoid; + page-break-inside : avoid; + break-inside : avoid; + h1 { + margin-bottom : 0.3cm; + text-align : center; + } + a { + display : inline; + color : inherit; + text-decoration : none; + &:hover { text-decoration : underline; } + } + h4 { + margin-top : 0.2cm; + line-height : 0.4cm; + & + ul li { line-height : 1.2em; } + } + ul { + padding-left : 0; + margin-top : 0; + list-style-type : none; + a { + display : flex; + flex-flow : row nowrap; + justify-content : space-between; + width : 100%; + } + li + li h3 { + margin-top : 0.26cm; + line-height : 1em; + } + h3 span:first-child::after { border : none; } + span { + display : contents; + &:first-child::after { + bottom : 0.08cm; + flex : 1; + margin-right : 0.16cm; + margin-bottom : 0.08cm; + margin-left : 0.08cm; /* Spacing before dot leaders */ + content : ''; + border-bottom : 0.05cm dotted #000000; + } + &:last-child { + display : inline-block; + align-self : flex-end; + font-family : 'BookInsanityRemake'; + font-size : 0.34cm; + font-weight : normal; + color : #000000; + } + } + ul { /* List indent */ + margin-left : 1em; + } + } + &.wide { + .useColumns(0.96, @fillMode: balance); + } + } + .toc.wide li { + break-inside: auto; + } +} From 2c573bfef5dee6829418318c99822c223af0cc8e Mon Sep 17 00:00:00 2001 From: David Bolack Date: Fri, 23 Aug 2024 14:18:58 -0500 Subject: [PATCH 02/45] Failed to save one file's changes. --- themes/V3/5ePHB/style.less | 126 ------------------------------------- 1 file changed, 126 deletions(-) diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index ddffbec2f..e4bbb3514 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -792,111 +792,6 @@ } } -// ***************************** -// * TABLE OF CONTENTS -// *****************************/ - -// Default Exclusions -// Anything not exlcuded is included, default Headers are H1, H2, and H3. -h4, -h5, -h6, -.page:has(.frontCover), -.page:has(.backCover), -.page:has(.insideCover), -.monster, -.noToC, -.toc { --TOC: exclude; } - -.tocDepthH2 :is(h1, h2) {--TOC: include; } -.tocDepthH3 :is(h1, h2, h3) {--TOC: include; } -.tocDepthH4 :is(h1, h2, h3, h4) {--TOC: include; } -.tocDepthH5 :is(h1, h2, h3, h4, h5) {--TOC: include; } -.tocDepthH6 :is(h1, h2, h3, h4, h5, h6) {--TOC: include; } - -.tocIncludeH1 h1 {--TOC: include; } -.tocIncludeH2 h2 {--TOC: include; } -.tocIncludeH3 h3 {--TOC: include; } -.tocIncludeH4 h4 {--TOC: include; } -.tocIncludeH5 h5 {--TOC: include; } -.tocIncludeH6 h6 {--TOC: include; } - -.page:has(.partCover) { - --TOC: exclude; - & h1 { - --TOC: include; - } - } - -.page { - &:has(.toc)::after { display : none; } - .toc { - -webkit-column-break-inside : avoid; - page-break-inside : avoid; - break-inside : avoid; - h1 { - margin-bottom : 0.3cm; - text-align : center; - } - a { - display : inline; - color : inherit; - text-decoration : none; - &:hover { text-decoration : underline; } - } - h4 { - margin-top : 0.2cm; - line-height : 0.4cm; - & + ul li { line-height : 1.2em; } - } - ul { - padding-left : 0; - margin-top : 0; - list-style-type : none; - a { - display : flex; - flex-flow : row nowrap; - justify-content : space-between; - width : 100%; - } - li + li h3 { - margin-top : 0.26cm; - line-height : 1em; - } - h3 span:first-child::after { border : none; } - span { - display : contents; - &:first-child::after { - bottom : 0.08cm; - flex : 1; - margin-right : 0.16cm; - margin-bottom : 0.08cm; - margin-left : 0.08cm; /* Spacing before dot leaders */ - content : ''; - border-bottom : 0.05cm dotted #000000; - } - &:last-child { - display : inline-block; - align-self : flex-end; - font-family : 'BookInsanityRemake'; - font-size : 0.34cm; - font-weight : normal; - color : #000000; - } - } - ul { /* List indent */ - margin-left : 1em; - } - } - &.wide { - .useColumns(0.96, @fillMode: balance); - } - } - .toc.wide li { - break-inside: auto; - } -} - // ***************************** // * DEFINITION LISTS // *****************************/ @@ -958,24 +853,3 @@ h6, } } } -// ***************************** -// * INDEX -// *****************************/ -.page { - .index { - font-size : 0.218cm; - - ul ul { margin : 0; } - - ul { - padding-left : 0; - text-indent : 0; - list-style-type : none; - } - - & > ul > li { - padding-left : 1.5em; - text-indent : -1.5em; - } - } -} From ad1dfc8e2bc10f82f581c3267882df2cc1545235 Mon Sep 17 00:00:00 2001 From: David Bolack Date: Fri, 23 Aug 2024 16:52:35 -0500 Subject: [PATCH 03/45] Move Page styles ( cover Page, etc ) to Blank from 5ePHB --- themes/V3/5ePHB/style.less | 264 ------------------------------------ themes/V3/Blank/style.less | 265 +++++++++++++++++++++++++++++++++++++ 2 files changed, 265 insertions(+), 264 deletions(-) diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index e4bbb3514..e33a0b2be 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -538,259 +538,6 @@ } h5 + table { margin-top : 0.2cm; } } -// ***************************** -// * FRONT COVER PAGE -// *****************************/ -.page:has(.frontCover) { - columns : 1; - text-align : center; - &::after { display : none; } - h1 { - margin-top : 1.2cm; - margin-bottom : 0; - font-family : 'NodestoCapsCondensed'; - font-size : 2.245cm; - font-weight : normal; - line-height : 1.9cm; - color : white; - text-shadow : unset; - text-transform : uppercase; - -webkit-text-stroke: 0.2cm black; - paint-order:stroke; - } - h2 { - font-family : 'NodestoCapsCondensed'; - font-size : 0.85cm; - font-weight : normal; - color : white; - letter-spacing : 0.1cm; - -webkit-text-stroke: 0.14cm black; - paint-order:stroke; - } - hr { - position : relative; - display : block; - width : 12cm; - height : 0.5cm; - margin : auto; - visibility : visible; - background-image : @horizontalRule; - filter : drop-shadow(0 0 3px black); - background-size : 100% 100%; - border : none; - } - .banner { - position : absolute; - bottom : 4.2cm; - left : 0; - display : flex; - flex-direction : column; - justify-content : center; - width : 10.5cm; - height : 1.7cm; - padding-top : 0.1cm; - padding-left : 1cm; - font-family : 'NodestoCapsCondensed'; - font-size : 1cm; - font-weight : normal; - color : white; - text-align : left; - letter-spacing : 0.014cm; - background-image : url('/assets/coverPageBanner.svg'); - filter : drop-shadow(2px 2px 2px black); - } - .footnote { - position : absolute; - right : 0; - bottom : 1.3cm; - left : 0; - width : 70%; - margin-right : auto; - margin-left : auto; - font-family : 'Overpass'; - font-size : 0.496cm; - color : white; - text-align : center; - -webkit-text-stroke: 0.1cm black; - paint-order:stroke; - } - .logo { - position : absolute; - top : 0.5cm; - right : 0; - left : 0; - filter : drop-shadow(0 0 0.075cm black); - img { - width : 100%; - height : 2cm; - } - } -} -// ***************************** -// * INSIDE COVER PAGE -// *****************************/ -.page:has(.insideCover) { - columns : 1; - text-align : center; - &::after { display : none; } - h1 { - margin-top : 1.2cm; - margin-bottom : 0; - font-family : 'NodestoCapsCondensed'; - font-size : 2.1cm; - font-weight : normal; - line-height : 1.785cm; - text-transform : uppercase; - } - h2 { - font-family : 'NodestoCapsCondensed'; - font-size : 0.85cm; - font-weight : normal; - letter-spacing : 0.5cm; - } - hr { - position : relative; - display : block; - width : 12cm; - height : 0.5cm; - margin : auto; - visibility : visible; - background-image : @horizontalRule; - background-size : 100% 100%; - border : none; - } - .logo { - position : absolute; - right : 0; - bottom : 1cm; - left : 0; - height : 2cm; - img { - width : 100%; - height : 2cm; - } - } -} -// ***************************** -// * BACK COVER -// *****************************/ -.page:has(.backCover) { - padding : 2.25cm 1.3cm 2cm 1.3cm; - color : #FFFFFF; - columns : 1; - &::after { display : none; } - .columnWrapper { width : 7.6cm; } - .backCover { - position : absolute; - inset : 0; - z-index : -1; - width : 11cm; - background-image : @backCover; - background-repeat : no-repeat; - background-size : contain; - } - .blank { height : 1.4em; } - h1 { - margin-bottom : 0.3cm; - font-family : 'NodestoCapsCondensed'; - font-size : 1.35cm; - line-height : 1.28cm; - color : #ED1C24; - text-align : center; - } - h1 + p::first-line, - h1 + p::first-letter { all : unset; } - img { - position : absolute; - top : 0px; - z-index : -2; - height : 100%; - } - hr { - width : 4.5cm; - height : 0.53cm; - margin-top : 1.1cm; - margin-right : auto; - margin-left : auto; - visibility : visible; - background-image : @horizontalRule; - background-size : 100% 100%; - border : none; - } - p { - font-family : 'Overpass'; - font-size : 0.332cm; - line-height : 0.35cm; - } - hr + p { - margin-top : 0.6cm; - text-align : center; - } - .logo { - position : absolute; - bottom : 2cm; - left : 1.2cm; - z-index : 0; - width : 7.6cm; - height : 1.5cm; - img { - position : relative; - z-index : 0; - width : 100%; - height : 1.5cm; - } - p { - position : relative; - width : 100%; - font-family : 'NodestoCapsWide'; - font-size : 0.4cm; - line-height : 1em; - line-height : 1.28cm; - color : #FFFFFF; - text-align : center; - text-indent : 0; - } - } -} - -// ***************************** -// * PART COVER -// *****************************/ -.page:has(.partCover) { - padding-top : 0; - text-align : center; - columns : 1; - - .partCover { - position : absolute; - top : 0; - left : 0; - width : 100%; - height : 6cm; - background-image : @partCoverHeaderPHB; - background-repeat : no-repeat; - background-size : 100%; - } - - h1 { - position : relative; - margin-top : 0.4cm; - font-family : 'NodestoCapsCondensed'; - font-size : 2.3cm; - text-align : center; - text-transform : uppercase; - } - - h2 { - position : relative; - margin-top : -0.7em; - margin-right : auto; - margin-left : auto; - font-family : 'Overpass'; - font-size : 0.45cm; - line-height : 0.495cm; - } -} // ***************************** // * DEFINITION LISTS @@ -807,17 +554,6 @@ } } -// ***************************** -// * WIDE -// *****************************/ -.page .wide { margin-bottom : 0.325cm; } - -.page h1 + * { margin-top : 0; } - -.page .descriptive.wide + * { - margin-top: 0; -} - //***************************** // * RUNE TABLE // *****************************/ diff --git a/themes/V3/Blank/style.less b/themes/V3/Blank/style.less index 4b0653f4b..791ebce73 100644 --- a/themes/V3/Blank/style.less +++ b/themes/V3/Blank/style.less @@ -609,3 +609,268 @@ h6, break-inside: auto; } } + +// ***************************** +// * WIDE +// *****************************/ +.page .wide { margin-bottom : 0.325cm; } + +.page h1 + * { margin-top : 0; } + +.page .descriptive.wide + * { + margin-top: 0; +} + +// ***************************** +// * FRONT COVER PAGE +// *****************************/ +.page:has(.frontCover) { + columns : 1; + text-align : center; + &::after { display : none; } + h1 { + margin-top : 1.2cm; + margin-bottom : 0; + font-family : 'NodestoCapsCondensed'; + font-size : 2.245cm; + font-weight : normal; + line-height : 1.9cm; + color : white; + text-shadow : unset; + text-transform : uppercase; + -webkit-text-stroke: 0.2cm black; + paint-order:stroke; + } + h2 { + font-family : 'NodestoCapsCondensed'; + font-size : 0.85cm; + font-weight : normal; + color : white; + letter-spacing : 0.1cm; + -webkit-text-stroke: 0.14cm black; + paint-order:stroke; + } + hr { + position : relative; + display : block; + width : 12cm; + height : 0.5cm; + margin : auto; + visibility : visible; + background-image : @horizontalRule; + filter : drop-shadow(0 0 3px black); + background-size : 100% 100%; + border : none; + } + .banner { + position : absolute; + bottom : 4.2cm; + left : 0; + display : flex; + flex-direction : column; + justify-content : center; + width : 10.5cm; + height : 1.7cm; + padding-top : 0.1cm; + padding-left : 1cm; + font-family : 'NodestoCapsCondensed'; + font-size : 1cm; + font-weight : normal; + color : white; + text-align : left; + letter-spacing : 0.014cm; + background-image : url('/assets/coverPageBanner.svg'); + filter : drop-shadow(2px 2px 2px black); + } + .footnote { + position : absolute; + right : 0; + bottom : 1.3cm; + left : 0; + width : 70%; + margin-right : auto; + margin-left : auto; + font-family : 'Overpass'; + font-size : 0.496cm; + color : white; + text-align : center; + -webkit-text-stroke: 0.1cm black; + paint-order:stroke; + } + .logo { + position : absolute; + top : 0.5cm; + right : 0; + left : 0; + filter : drop-shadow(0 0 0.075cm black); + img { + width : 100%; + height : 2cm; + } + } +} +// ***************************** +// * INSIDE COVER PAGE +// *****************************/ +.page:has(.insideCover) { + columns : 1; + text-align : center; + &::after { display : none; } + h1 { + margin-top : 1.2cm; + margin-bottom : 0; + font-family : 'NodestoCapsCondensed'; + font-size : 2.1cm; + font-weight : normal; + line-height : 1.785cm; + text-transform : uppercase; + } + h2 { + font-family : 'NodestoCapsCondensed'; + font-size : 0.85cm; + font-weight : normal; + letter-spacing : 0.5cm; + } + hr { + position : relative; + display : block; + width : 12cm; + height : 0.5cm; + margin : auto; + visibility : visible; + background-image : @horizontalRule; + background-size : 100% 100%; + border : none; + } + .logo { + position : absolute; + right : 0; + bottom : 1cm; + left : 0; + height : 2cm; + img { + width : 100%; + height : 2cm; + } + } +} +// ***************************** +// * BACK COVER +// *****************************/ +.page:has(.backCover) { + padding : 2.25cm 1.3cm 2cm 1.3cm; + color : #FFFFFF; + columns : 1; + &::after { display : none; } + .columnWrapper { width : 7.6cm; } + .backCover { + position : absolute; + inset : 0; + z-index : -1; + width : 11cm; + background-image : @backCover; + background-repeat : no-repeat; + background-size : contain; + } + .blank { height : 1.4em; } + h1 { + margin-bottom : 0.3cm; + font-family : 'NodestoCapsCondensed'; + font-size : 1.35cm; + line-height : 1.28cm; + color : #ED1C24; + text-align : center; + } + h1 + p::first-line, + h1 + p::first-letter { all : unset; } + img { + position : absolute; + top : 0px; + z-index : -2; + height : 100%; + } + hr { + width : 4.5cm; + height : 0.53cm; + margin-top : 1.1cm; + margin-right : auto; + margin-left : auto; + visibility : visible; + background-image : @horizontalRule; + background-size : 100% 100%; + border : none; + } + p { + font-family : 'Overpass'; + font-size : 0.332cm; + line-height : 0.35cm; + } + hr + p { + margin-top : 0.6cm; + text-align : center; + } + .logo { + position : absolute; + bottom : 2cm; + left : 1.2cm; + z-index : 0; + width : 7.6cm; + height : 1.5cm; + img { + position : relative; + z-index : 0; + width : 100%; + height : 1.5cm; + } + p { + position : relative; + width : 100%; + font-family : 'NodestoCapsWide'; + font-size : 0.4cm; + line-height : 1em; + line-height : 1.28cm; + color : #FFFFFF; + text-align : center; + text-indent : 0; + } + } +} + +// ***************************** +// * PART COVER +// *****************************/ +.page:has(.partCover) { + padding-top : 0; + text-align : center; + columns : 1; + + .partCover { + position : absolute; + top : 0; + left : 0; + width : 100%; + height : 6cm; + background-image : @partCoverHeaderPHB; + background-repeat : no-repeat; + background-size : 100%; + } + + h1 { + position : relative; + margin-top : 0.4cm; + font-family : 'NodestoCapsCondensed'; + font-size : 2.3cm; + text-align : center; + text-transform : uppercase; + } + + h2 { + position : relative; + margin-top : -0.7em; + margin-right : auto; + margin-left : auto; + font-family : 'Overpass'; + font-size : 0.45cm; + line-height : 0.495cm; + } +} From a3c01305df17b78d860de1d0c407941103516393 Mon Sep 17 00:00:00 2001 From: David Bolack Date: Sun, 25 Aug 2024 19:15:57 -0500 Subject: [PATCH 04/45] Revert "Move Page styles ( cover Page, etc ) to Blank from 5ePHB" This reverts commit ad1dfc8e2bc10f82f581c3267882df2cc1545235. --- themes/V3/5ePHB/style.less | 264 ++++++++++++++++++++++++++++++++++++ themes/V3/Blank/style.less | 265 ------------------------------------- 2 files changed, 264 insertions(+), 265 deletions(-) diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index e33a0b2be..e4bbb3514 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -538,6 +538,259 @@ } h5 + table { margin-top : 0.2cm; } } +// ***************************** +// * FRONT COVER PAGE +// *****************************/ +.page:has(.frontCover) { + columns : 1; + text-align : center; + &::after { display : none; } + h1 { + margin-top : 1.2cm; + margin-bottom : 0; + font-family : 'NodestoCapsCondensed'; + font-size : 2.245cm; + font-weight : normal; + line-height : 1.9cm; + color : white; + text-shadow : unset; + text-transform : uppercase; + -webkit-text-stroke: 0.2cm black; + paint-order:stroke; + } + h2 { + font-family : 'NodestoCapsCondensed'; + font-size : 0.85cm; + font-weight : normal; + color : white; + letter-spacing : 0.1cm; + -webkit-text-stroke: 0.14cm black; + paint-order:stroke; + } + hr { + position : relative; + display : block; + width : 12cm; + height : 0.5cm; + margin : auto; + visibility : visible; + background-image : @horizontalRule; + filter : drop-shadow(0 0 3px black); + background-size : 100% 100%; + border : none; + } + .banner { + position : absolute; + bottom : 4.2cm; + left : 0; + display : flex; + flex-direction : column; + justify-content : center; + width : 10.5cm; + height : 1.7cm; + padding-top : 0.1cm; + padding-left : 1cm; + font-family : 'NodestoCapsCondensed'; + font-size : 1cm; + font-weight : normal; + color : white; + text-align : left; + letter-spacing : 0.014cm; + background-image : url('/assets/coverPageBanner.svg'); + filter : drop-shadow(2px 2px 2px black); + } + .footnote { + position : absolute; + right : 0; + bottom : 1.3cm; + left : 0; + width : 70%; + margin-right : auto; + margin-left : auto; + font-family : 'Overpass'; + font-size : 0.496cm; + color : white; + text-align : center; + -webkit-text-stroke: 0.1cm black; + paint-order:stroke; + } + .logo { + position : absolute; + top : 0.5cm; + right : 0; + left : 0; + filter : drop-shadow(0 0 0.075cm black); + img { + width : 100%; + height : 2cm; + } + } +} +// ***************************** +// * INSIDE COVER PAGE +// *****************************/ +.page:has(.insideCover) { + columns : 1; + text-align : center; + &::after { display : none; } + h1 { + margin-top : 1.2cm; + margin-bottom : 0; + font-family : 'NodestoCapsCondensed'; + font-size : 2.1cm; + font-weight : normal; + line-height : 1.785cm; + text-transform : uppercase; + } + h2 { + font-family : 'NodestoCapsCondensed'; + font-size : 0.85cm; + font-weight : normal; + letter-spacing : 0.5cm; + } + hr { + position : relative; + display : block; + width : 12cm; + height : 0.5cm; + margin : auto; + visibility : visible; + background-image : @horizontalRule; + background-size : 100% 100%; + border : none; + } + .logo { + position : absolute; + right : 0; + bottom : 1cm; + left : 0; + height : 2cm; + img { + width : 100%; + height : 2cm; + } + } +} +// ***************************** +// * BACK COVER +// *****************************/ +.page:has(.backCover) { + padding : 2.25cm 1.3cm 2cm 1.3cm; + color : #FFFFFF; + columns : 1; + &::after { display : none; } + .columnWrapper { width : 7.6cm; } + .backCover { + position : absolute; + inset : 0; + z-index : -1; + width : 11cm; + background-image : @backCover; + background-repeat : no-repeat; + background-size : contain; + } + .blank { height : 1.4em; } + h1 { + margin-bottom : 0.3cm; + font-family : 'NodestoCapsCondensed'; + font-size : 1.35cm; + line-height : 1.28cm; + color : #ED1C24; + text-align : center; + } + h1 + p::first-line, + h1 + p::first-letter { all : unset; } + img { + position : absolute; + top : 0px; + z-index : -2; + height : 100%; + } + hr { + width : 4.5cm; + height : 0.53cm; + margin-top : 1.1cm; + margin-right : auto; + margin-left : auto; + visibility : visible; + background-image : @horizontalRule; + background-size : 100% 100%; + border : none; + } + p { + font-family : 'Overpass'; + font-size : 0.332cm; + line-height : 0.35cm; + } + hr + p { + margin-top : 0.6cm; + text-align : center; + } + .logo { + position : absolute; + bottom : 2cm; + left : 1.2cm; + z-index : 0; + width : 7.6cm; + height : 1.5cm; + img { + position : relative; + z-index : 0; + width : 100%; + height : 1.5cm; + } + p { + position : relative; + width : 100%; + font-family : 'NodestoCapsWide'; + font-size : 0.4cm; + line-height : 1em; + line-height : 1.28cm; + color : #FFFFFF; + text-align : center; + text-indent : 0; + } + } +} + +// ***************************** +// * PART COVER +// *****************************/ +.page:has(.partCover) { + padding-top : 0; + text-align : center; + columns : 1; + + .partCover { + position : absolute; + top : 0; + left : 0; + width : 100%; + height : 6cm; + background-image : @partCoverHeaderPHB; + background-repeat : no-repeat; + background-size : 100%; + } + + h1 { + position : relative; + margin-top : 0.4cm; + font-family : 'NodestoCapsCondensed'; + font-size : 2.3cm; + text-align : center; + text-transform : uppercase; + } + + h2 { + position : relative; + margin-top : -0.7em; + margin-right : auto; + margin-left : auto; + font-family : 'Overpass'; + font-size : 0.45cm; + line-height : 0.495cm; + } +} // ***************************** // * DEFINITION LISTS @@ -554,6 +807,17 @@ } } +// ***************************** +// * WIDE +// *****************************/ +.page .wide { margin-bottom : 0.325cm; } + +.page h1 + * { margin-top : 0; } + +.page .descriptive.wide + * { + margin-top: 0; +} + //***************************** // * RUNE TABLE // *****************************/ diff --git a/themes/V3/Blank/style.less b/themes/V3/Blank/style.less index 791ebce73..4b0653f4b 100644 --- a/themes/V3/Blank/style.less +++ b/themes/V3/Blank/style.less @@ -609,268 +609,3 @@ h6, break-inside: auto; } } - -// ***************************** -// * WIDE -// *****************************/ -.page .wide { margin-bottom : 0.325cm; } - -.page h1 + * { margin-top : 0; } - -.page .descriptive.wide + * { - margin-top: 0; -} - -// ***************************** -// * FRONT COVER PAGE -// *****************************/ -.page:has(.frontCover) { - columns : 1; - text-align : center; - &::after { display : none; } - h1 { - margin-top : 1.2cm; - margin-bottom : 0; - font-family : 'NodestoCapsCondensed'; - font-size : 2.245cm; - font-weight : normal; - line-height : 1.9cm; - color : white; - text-shadow : unset; - text-transform : uppercase; - -webkit-text-stroke: 0.2cm black; - paint-order:stroke; - } - h2 { - font-family : 'NodestoCapsCondensed'; - font-size : 0.85cm; - font-weight : normal; - color : white; - letter-spacing : 0.1cm; - -webkit-text-stroke: 0.14cm black; - paint-order:stroke; - } - hr { - position : relative; - display : block; - width : 12cm; - height : 0.5cm; - margin : auto; - visibility : visible; - background-image : @horizontalRule; - filter : drop-shadow(0 0 3px black); - background-size : 100% 100%; - border : none; - } - .banner { - position : absolute; - bottom : 4.2cm; - left : 0; - display : flex; - flex-direction : column; - justify-content : center; - width : 10.5cm; - height : 1.7cm; - padding-top : 0.1cm; - padding-left : 1cm; - font-family : 'NodestoCapsCondensed'; - font-size : 1cm; - font-weight : normal; - color : white; - text-align : left; - letter-spacing : 0.014cm; - background-image : url('/assets/coverPageBanner.svg'); - filter : drop-shadow(2px 2px 2px black); - } - .footnote { - position : absolute; - right : 0; - bottom : 1.3cm; - left : 0; - width : 70%; - margin-right : auto; - margin-left : auto; - font-family : 'Overpass'; - font-size : 0.496cm; - color : white; - text-align : center; - -webkit-text-stroke: 0.1cm black; - paint-order:stroke; - } - .logo { - position : absolute; - top : 0.5cm; - right : 0; - left : 0; - filter : drop-shadow(0 0 0.075cm black); - img { - width : 100%; - height : 2cm; - } - } -} -// ***************************** -// * INSIDE COVER PAGE -// *****************************/ -.page:has(.insideCover) { - columns : 1; - text-align : center; - &::after { display : none; } - h1 { - margin-top : 1.2cm; - margin-bottom : 0; - font-family : 'NodestoCapsCondensed'; - font-size : 2.1cm; - font-weight : normal; - line-height : 1.785cm; - text-transform : uppercase; - } - h2 { - font-family : 'NodestoCapsCondensed'; - font-size : 0.85cm; - font-weight : normal; - letter-spacing : 0.5cm; - } - hr { - position : relative; - display : block; - width : 12cm; - height : 0.5cm; - margin : auto; - visibility : visible; - background-image : @horizontalRule; - background-size : 100% 100%; - border : none; - } - .logo { - position : absolute; - right : 0; - bottom : 1cm; - left : 0; - height : 2cm; - img { - width : 100%; - height : 2cm; - } - } -} -// ***************************** -// * BACK COVER -// *****************************/ -.page:has(.backCover) { - padding : 2.25cm 1.3cm 2cm 1.3cm; - color : #FFFFFF; - columns : 1; - &::after { display : none; } - .columnWrapper { width : 7.6cm; } - .backCover { - position : absolute; - inset : 0; - z-index : -1; - width : 11cm; - background-image : @backCover; - background-repeat : no-repeat; - background-size : contain; - } - .blank { height : 1.4em; } - h1 { - margin-bottom : 0.3cm; - font-family : 'NodestoCapsCondensed'; - font-size : 1.35cm; - line-height : 1.28cm; - color : #ED1C24; - text-align : center; - } - h1 + p::first-line, - h1 + p::first-letter { all : unset; } - img { - position : absolute; - top : 0px; - z-index : -2; - height : 100%; - } - hr { - width : 4.5cm; - height : 0.53cm; - margin-top : 1.1cm; - margin-right : auto; - margin-left : auto; - visibility : visible; - background-image : @horizontalRule; - background-size : 100% 100%; - border : none; - } - p { - font-family : 'Overpass'; - font-size : 0.332cm; - line-height : 0.35cm; - } - hr + p { - margin-top : 0.6cm; - text-align : center; - } - .logo { - position : absolute; - bottom : 2cm; - left : 1.2cm; - z-index : 0; - width : 7.6cm; - height : 1.5cm; - img { - position : relative; - z-index : 0; - width : 100%; - height : 1.5cm; - } - p { - position : relative; - width : 100%; - font-family : 'NodestoCapsWide'; - font-size : 0.4cm; - line-height : 1em; - line-height : 1.28cm; - color : #FFFFFF; - text-align : center; - text-indent : 0; - } - } -} - -// ***************************** -// * PART COVER -// *****************************/ -.page:has(.partCover) { - padding-top : 0; - text-align : center; - columns : 1; - - .partCover { - position : absolute; - top : 0; - left : 0; - width : 100%; - height : 6cm; - background-image : @partCoverHeaderPHB; - background-repeat : no-repeat; - background-size : 100%; - } - - h1 { - position : relative; - margin-top : 0.4cm; - font-family : 'NodestoCapsCondensed'; - font-size : 2.3cm; - text-align : center; - text-transform : uppercase; - } - - h2 { - position : relative; - margin-top : -0.7em; - margin-right : auto; - margin-left : auto; - font-family : 'Overpass'; - font-size : 0.45cm; - line-height : 0.495cm; - } -} From f1eb6e1ce473bd1a6cacbbbce0bac9bb55875dda Mon Sep 17 00:00:00 2001 From: David Bolack Date: Tue, 28 Jan 2025 21:31:43 -0600 Subject: [PATCH 05/45] Alter varCallInline content to alig with preceeding varDefBlock in inline definitions. This was failing due to both labels having the extraneous spaces cleaned up but the variable label portion of the varCallInline did not, preventing them from being matched during variable resolution. --- 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 99766b536..1914cd201 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -735,7 +735,7 @@ function MarkedVariables() { varsQueue.push( { type : 'varCallInline', varName : label, - content : match[9] + content : match[9].replace(/\s+/g, ' ').replace(/\[\s+/, '[').replace(/\s+\]/, ']') }); } if(match[12]) { // Inline Call From 564f5d71b2549dbc86bb8fa0d2f4b033340a4764 Mon Sep 17 00:00:00 2001 From: David Bolack Date: Fri, 31 Jan 2025 16:12:00 -0600 Subject: [PATCH 06/45] WIP --- shared/naturalcrit/markdown.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 1914cd201..1cd11d7b5 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -59,6 +59,12 @@ mathParser.functions.signed = function (a) { return `${a}`; }; +// Make sure we normalize variable names consistantly. +const normalizeVarNames = (label)=>{ + return label.trim() + .replace(/\s+/g, ' '); +}; + //Processes the markdown within an HTML block if it's just a class-wrapper renderer.html = function (html) { if(_.startsWith(_.trim(html), '')){ @@ -533,7 +539,7 @@ const replaceVar = function(input, hoist=false, allowUnresolved=false) { const match = regex.exec(input); const prefix = match[1]; - const label = match[2]; + const label = normalizeVarNames(match[2]); // Ensure the label name is normalized as it should be in the var stack. //v=====--------------------< HANDLE MATH >-------------------=====v// const mathRegex = /[a-z]+\(|[+\-*/^(),]/g; @@ -688,7 +694,7 @@ function MarkedVariables() { }); } if(match[3]) { // Block Definition - const label = match[4] ? match[4].trim().replace(/\s+/g, ' ') : null; // Trim edge spaces and shorten blocks of whitespace to 1 space + const label = match[4] ? normalizeVarNames(match[4]) : null; // Trim edge spaces and shorten blocks of whitespace to 1 space const content = match[5] ? match[5].trim().replace(/[ \t]+/g, ' ') : null; // Trim edge spaces and shorten blocks of whitespace to 1 space varsQueue.push( @@ -698,7 +704,7 @@ function MarkedVariables() { }); } if(match[6]) { // Block Call - const label = match[7] ? match[7].trim().replace(/\s+/g, ' ') : null; // Trim edge spaces and shorten blocks of whitespace to 1 space + const label = match[7] ? normalizeVarNames(match[7]) : null; // Trim edge spaces and shorten blocks of whitespace to 1 space varsQueue.push( { type : 'varCallBlock', @@ -707,7 +713,7 @@ function MarkedVariables() { }); } if(match[8]) { // Inline Definition - const label = match[10] ? match[10].trim().replace(/\s+/g, ' ') : null; // Trim edge spaces and shorten blocks of whitespace to 1 space + const label = match[10] ? normalizeVarNames(match[10]) : null; // Trim edge spaces and shorten blocks of whitespace to 1 space let content = match[11] || null; // In case of nested (), find the correct matching end ) @@ -735,11 +741,11 @@ function MarkedVariables() { varsQueue.push( { type : 'varCallInline', varName : label, - content : match[9].replace(/\s+/g, ' ').replace(/\[\s+/, '[').replace(/\s+\]/, ']') + content : match[9] }); } if(match[12]) { // Inline Call - const label = match[13] ? match[13].trim().replace(/\s+/g, ' ') : null; // Trim edge spaces and shorten blocks of whitespace to 1 space + const label = match[13] ? normalizeVarNames(match[13]) : null; // Trim edge spaces and shorten blocks of whitespace to 1 space varsQueue.push( { type : 'varCallInline', From b1ff68c3b1df577a8e51654373ac62024f0baaf9 Mon Sep 17 00:00:00 2001 From: David Bolack Date: Fri, 31 Jan 2025 16:12:00 -0600 Subject: [PATCH 07/45] Update code to use helper function to ensure unifrom normalization of Variable labels. --- shared/naturalcrit/markdown.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 1914cd201..1cd11d7b5 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -59,6 +59,12 @@ mathParser.functions.signed = function (a) { return `${a}`; }; +// Make sure we normalize variable names consistantly. +const normalizeVarNames = (label)=>{ + return label.trim() + .replace(/\s+/g, ' '); +}; + //Processes the markdown within an HTML block if it's just a class-wrapper renderer.html = function (html) { if(_.startsWith(_.trim(html), '')){ @@ -533,7 +539,7 @@ const replaceVar = function(input, hoist=false, allowUnresolved=false) { const match = regex.exec(input); const prefix = match[1]; - const label = match[2]; + const label = normalizeVarNames(match[2]); // Ensure the label name is normalized as it should be in the var stack. //v=====--------------------< HANDLE MATH >-------------------=====v// const mathRegex = /[a-z]+\(|[+\-*/^(),]/g; @@ -688,7 +694,7 @@ function MarkedVariables() { }); } if(match[3]) { // Block Definition - const label = match[4] ? match[4].trim().replace(/\s+/g, ' ') : null; // Trim edge spaces and shorten blocks of whitespace to 1 space + const label = match[4] ? normalizeVarNames(match[4]) : null; // Trim edge spaces and shorten blocks of whitespace to 1 space const content = match[5] ? match[5].trim().replace(/[ \t]+/g, ' ') : null; // Trim edge spaces and shorten blocks of whitespace to 1 space varsQueue.push( @@ -698,7 +704,7 @@ function MarkedVariables() { }); } if(match[6]) { // Block Call - const label = match[7] ? match[7].trim().replace(/\s+/g, ' ') : null; // Trim edge spaces and shorten blocks of whitespace to 1 space + const label = match[7] ? normalizeVarNames(match[7]) : null; // Trim edge spaces and shorten blocks of whitespace to 1 space varsQueue.push( { type : 'varCallBlock', @@ -707,7 +713,7 @@ function MarkedVariables() { }); } if(match[8]) { // Inline Definition - const label = match[10] ? match[10].trim().replace(/\s+/g, ' ') : null; // Trim edge spaces and shorten blocks of whitespace to 1 space + const label = match[10] ? normalizeVarNames(match[10]) : null; // Trim edge spaces and shorten blocks of whitespace to 1 space let content = match[11] || null; // In case of nested (), find the correct matching end ) @@ -735,11 +741,11 @@ function MarkedVariables() { varsQueue.push( { type : 'varCallInline', varName : label, - content : match[9].replace(/\s+/g, ' ').replace(/\[\s+/, '[').replace(/\s+\]/, ']') + content : match[9] }); } if(match[12]) { // Inline Call - const label = match[13] ? match[13].trim().replace(/\s+/g, ' ') : null; // Trim edge spaces and shorten blocks of whitespace to 1 space + const label = match[13] ? normalizeVarNames(match[13]) : null; // Trim edge spaces and shorten blocks of whitespace to 1 space varsQueue.push( { type : 'varCallInline', From d061b902d5c8ddf03bf7d8abfa2c7c8e62377dec Mon Sep 17 00:00:00 2001 From: David Bolack Date: Fri, 7 Feb 2025 19:26:56 -0600 Subject: [PATCH 08/45] Make all typefaces available via blank - for now. --- themes/V3/Blank/style.less | 1 + 1 file changed, 1 insertion(+) diff --git a/themes/V3/Blank/style.less b/themes/V3/Blank/style.less index 82a101d09..ded7370ba 100644 --- a/themes/V3/Blank/style.less +++ b/themes/V3/Blank/style.less @@ -5,6 +5,7 @@ @import (less) './themes/fonts/iconFonts/diceFont.less'; @import (less) './themes/fonts/iconFonts/gameIcons.less'; @import (less) './themes/fonts/iconFonts/fontAwesome.less'; +@import (less) './themes/fonts/Journal/fonts.less'; :root { //Colors From dc8d0e94839e943f26e6c17d7c2ecf756fdfd8d4 Mon Sep 17 00:00:00 2001 From: David Bolack Date: Tue, 11 Feb 2025 14:37:25 -0600 Subject: [PATCH 09/45] Restore .monster --- themes/V3/5ePHB/style.less | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index 46d7e3239..55f89c670 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -793,6 +793,14 @@ } } +// ***************************** +// * TABLE OF CONTENTS +// *****************************/ + +// Default Exclusions +// Anything not excluded is included, default Headers are H1, H2, and H3. +.monster { --TOC: exclude; } + // ***************************** // * DEFINITION LISTS // *****************************/ From 3ffdb3431275aca6c45932021435a89b9a5e9a0a Mon Sep 17 00:00:00 2001 From: David Bolack Date: Tue, 11 Feb 2025 14:45:39 -0600 Subject: [PATCH 10/45] Tweaks in response to CC comments --- themes/V3/5ePHB/style.less | 101 ++++++++++++++++++++++++++++++++++++- themes/V3/Blank/style.less | 11 ---- 2 files changed, 99 insertions(+), 13 deletions(-) diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index 55f89c670..9e2ce5064 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -797,10 +797,85 @@ // * TABLE OF CONTENTS // *****************************/ -// Default Exclusions -// Anything not excluded is included, default Headers are H1, H2, and H3. +// Additional Default Exclusions .monster { --TOC: exclude; } +.page:has(.partCover) { + --TOC: exclude; + & h1 { + --TOC: include; + } + } + +.page { + &:has(.toc)::after { display : none; } + .toc { + -webkit-column-break-inside : avoid; + page-break-inside : avoid; + break-inside : avoid; + h1 { + margin-bottom : 0.3cm; + text-align : center; + } + a { + display : inline; + color : inherit; + text-decoration : none; + &:hover { text-decoration : underline; } + } + h4 { + margin-top : 0.2cm; + line-height : 0.4cm; + & + ul li { line-height : 1.2em; } + } + ul { + padding-left : 0; + margin-top : 0; + list-style-type : none; + a { + display : flex; + flex-flow : row nowrap; + justify-content : space-between; + width : 100%; + } + li + li h3 { + margin-top : 0.26cm; + line-height : 1em; + } + h3 span:first-child::after { border : none; } + span { + display : contents; + &:first-child::after { + bottom : 0.08cm; + flex : 1; + margin-right : 0.16cm; + margin-bottom : 0.08cm; + margin-left : 0.08cm; /* Spacing before dot leaders */ + content : ''; + border-bottom : 0.05cm dotted #000000; + } + &:last-child { + display : inline-block; + align-self : flex-end; + font-family : 'BookInsanityRemake'; + font-size : 0.34cm; + font-weight : normal; + color : #000000; + } + } + ul { /* List indent */ + margin-left : 1em; + } + } + &.wide { + .useColumns(0.96, @fillMode: balance); + } + } + .toc.wide li { + break-inside: auto; + } +} + // ***************************** // * DEFINITION LISTS // *****************************/ @@ -862,3 +937,25 @@ } } } + +// ***************************** +// * INDEX +// *****************************/ +.page { + .index { + font-size : 0.218cm; + + ul ul { margin : 0; } + + ul { + padding-left : 0; + text-indent : 0; + list-style-type : none; + } + + & > ul > li { + padding-left : 1.5em; + text-indent : -1.5em; + } + } +} diff --git a/themes/V3/Blank/style.less b/themes/V3/Blank/style.less index ded7370ba..c3a792b16 100644 --- a/themes/V3/Blank/style.less +++ b/themes/V3/Blank/style.less @@ -513,7 +513,6 @@ body { counter-reset : page-numbers 0; } // *****************************/ .page { .index { - font-size : 0.218cm; ul ul { margin : 0; } @@ -542,7 +541,6 @@ h6, .page:has(.frontCover), .page:has(.backCover), .page:has(.insideCover), -.monster, .noToC, .toc { --TOC: exclude; } @@ -559,13 +557,6 @@ h6, .tocIncludeH5 h5 {--TOC: include; } .tocIncludeH6 h6 {--TOC: include; } -.page:has(.partCover) { - --TOC: exclude; - & h1 { - --TOC: include; - } - } - .page { &:has(.toc)::after { display : none; } .toc { @@ -616,10 +607,8 @@ h6, &:last-child { display : inline-block; align-self : flex-end; - font-family : 'BookInsanityRemake'; font-size : 0.34cm; font-weight : normal; - color : #000000; } } ul { /* List indent */ From 20baa9984f27deb29432210f85e12602cf4b29c7 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Thu, 6 Mar 2025 11:13:39 -0500 Subject: [PATCH 11/45] Cleanup --- shared/naturalcrit/markdown.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index c5d93d73d..40a7584cf 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -60,10 +60,9 @@ mathParser.functions.signed = function (a) { return `${a}`; }; -// Make sure we normalize variable names consistantly. +// Normalize variable names; trim edge spaces and shorten blocks of whitespace to 1 space const normalizeVarNames = (label)=>{ - return label.trim() - .replace(/\s+/g, ' '); + return label.trim().replace(/\s+/g, ' '); }; //Processes the markdown within an HTML block if it's just a class-wrapper @@ -666,8 +665,8 @@ function MarkedVariables() { }); } if(match[3]) { // Block Definition - const label = match[4] ? normalizeVarNames(match[4]) : null; // Trim edge spaces and shorten blocks of whitespace to 1 space - const content = match[5] ? match[5].trim().replace(/[ \t]+/g, ' ') : null; // Trim edge spaces and shorten blocks of whitespace to 1 space + const label = match[4] ? normalizeVarNames(match[4]) : null; + const content = match[5] ? match[5].trim().replace(/[ \t]+/g, ' ') : null; // Normalize text content (except newlines for block-level content) varsQueue.push( { type : 'varDefBlock', @@ -676,7 +675,7 @@ function MarkedVariables() { }); } if(match[6]) { // Block Call - const label = match[7] ? normalizeVarNames(match[7]) : null; // Trim edge spaces and shorten blocks of whitespace to 1 space + const label = match[7] ? normalizeVarNames(match[7]) : null; varsQueue.push( { type : 'varCallBlock', @@ -685,7 +684,7 @@ function MarkedVariables() { }); } if(match[8]) { // Inline Definition - const label = match[10] ? normalizeVarNames(match[10]) : null; // Trim edge spaces and shorten blocks of whitespace to 1 space + const label = match[10] ? normalizeVarNames(match[10]) : null; let content = match[11] || null; // In case of nested (), find the correct matching end ) @@ -717,7 +716,7 @@ function MarkedVariables() { }); } if(match[12]) { // Inline Call - const label = match[13] ? normalizeVarNames(match[13]) : null; // Trim edge spaces and shorten blocks of whitespace to 1 space + const label = match[13] ? normalizeVarNames(match[13]) : null; varsQueue.push( { type : 'varCallInline', From aec958249aa96012794fc631beafdf7be9e0cace Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Wed, 12 Mar 2025 10:21:22 +1300 Subject: [PATCH 12/45] Add automatic pageNumber variable to globalVarsList --- shared/naturalcrit/markdown.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index bed109772..38397873c 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -902,7 +902,12 @@ let globalPageNumber = 0; const Markdown = { marked : Marked, render : (rawBrewText, pageNumber=0)=>{ - globalVarsList[pageNumber] = {}; //Reset global links for current page, to ensure values are parsed in order + globalVarsList[pageNumber] = { //Reset global links for current page, to ensure values are parsed in order + 'pageNumber' : { //Add document variables for this page + content : pageNumber + 1, + resolved : true + } + }; varsQueue = []; //Could move into MarkedVariables() globalPageNumber = pageNumber; if(pageNumber==0) { From edc4f8ec63f654a874e62fcdd496e764bd8071ca Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Wed, 12 Mar 2025 13:28:43 +1300 Subject: [PATCH 13/45] Change to increment previous --- shared/naturalcrit/markdown.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 38397873c..069d09dbd 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -902,9 +902,10 @@ let globalPageNumber = 0; const Markdown = { marked : Marked, render : (rawBrewText, pageNumber=0)=>{ + const lastPageNumber = pageNumber > 0 ? globalVarsList[pageNumber - 1].pageNumber.content : 0; globalVarsList[pageNumber] = { //Reset global links for current page, to ensure values are parsed in order 'pageNumber' : { //Add document variables for this page - content : pageNumber + 1, + content : !isNaN(Number(lastPageNumber)) ? Number(lastPageNumber) + 1 : lastPageNumber, resolved : true } }; From e787a688598b0aa66cee5afcecfb115b2c0193fd Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Thu, 13 Mar 2025 10:49:59 +1300 Subject: [PATCH 14/45] Add roman numeral package --- package-lock.json | 7 +++++++ package.json | 1 + 2 files changed, 8 insertions(+) diff --git a/package-lock.json b/package-lock.json index ac8ca11af..35bc0c147 100644 --- a/package-lock.json +++ b/package-lock.json @@ -48,6 +48,7 @@ "react-dom": "^18.3.1", "react-frame-component": "^4.1.3", "react-router": "^7.3.0", + "romans": "^3.0.0", "sanitize-filename": "1.6.3", "superagent": "^10.1.1", "vitreum": "git+https://git@github.com/calculuschild/vitreum.git" @@ -12058,6 +12059,12 @@ "inherits": "^2.0.1" } }, + "node_modules/romans": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/romans/-/romans-3.0.0.tgz", + "integrity": "sha512-7DDsAfhtpRr/ZFQXiHDrC3Pe00agcAsFiNt5nNx4ZAQlsc6yJG0mvXA5WAvO8YZyOg349twm2GYhHLw7rCXAzw==", + "license": "MIT" + }, "node_modules/rrweb-cssom": { "version": "0.7.1", "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.7.1.tgz", diff --git a/package.json b/package.json index 50dda84ce..43638d326 100644 --- a/package.json +++ b/package.json @@ -122,6 +122,7 @@ "react-dom": "^18.3.1", "react-frame-component": "^4.1.3", "react-router": "^7.3.0", + "romans": "^3.0.0", "sanitize-filename": "1.6.3", "superagent": "^10.1.1", "vitreum": "git+https://git@github.com/calculuschild/vitreum.git" From b67eb59461e84df5d32f20241a4950c48f979148 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Thu, 13 Mar 2025 10:50:18 +1300 Subject: [PATCH 15/45] Add Roman numerals function --- shared/naturalcrit/markdown.js | 39 ++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 069d09dbd..93567a4d7 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -8,6 +8,7 @@ import { markedSmartypantsLite as MarkedSmartypantsLite } import { gfmHeadingId as MarkedGFMHeadingId, resetHeadings as MarkedGFMResetHeadingIDs } from 'marked-gfm-heading-id'; import { markedEmoji as MarkedEmojis } from 'marked-emoji'; import MarkedSubSuperText from 'marked-subsuper-text'; +import { romanize } from 'romans'; //Icon fonts included so they can appear in emoji autosuggest dropdown import diceFont from '../../themes/fonts/iconFonts/diceFont.js'; @@ -59,6 +60,16 @@ mathParser.functions.signed = function (a) { if(a >= 0) return `+${a}`; return `${a}`; }; +// Add Roman numeral functions +mathParser.functions.toRomans = function (a) { + return romanize(a); +}; +mathParser.functions.toRomansUpper = function (a) { + return romanize(a).toUpperCase(); +}; +mathParser.functions.toRomansLower = function (a) { + return romanize(a).toLowerCase(); +}; //Processes the markdown within an HTML block if it's just a class-wrapper renderer.html = function (token) { @@ -86,8 +97,8 @@ renderer.paragraph = function(token){ //Fix local links in the Preview iFrame to link inside the frame renderer.link = function (token) { - let {href, title, tokens} = token; - const text = this.parser.parseInline(tokens) + let { href, title, tokens } = token; + const text = this.parser.parseInline(tokens); let self = false; if(href[0] == '#') { self = true; @@ -110,7 +121,7 @@ renderer.link = function (token) { // Expose `src` attribute as `--HB_src` to make the URL accessible via CSS renderer.image = function (token) { - let {href, title, text} = token; + const { href, title, text } = token; if(href === null) return text; @@ -776,7 +787,7 @@ Marked.use({ extensions : [justifiedParagraphs, definitionListsMultiLine, defini Marked.use(mustacheInjectBlock); Marked.use(MarkedSubSuperText()); Marked.use({ renderer: renderer, tokenizer: tokenizer, mangle: false }); -Marked.use(MarkedExtendedTables({interruptPatterns : tableTerminators}), MarkedGFMHeadingId({ globalSlugs: true }), +Marked.use(MarkedExtendedTables({ interruptPatterns: tableTerminators }), MarkedGFMHeadingId({ globalSlugs: true }), MarkedSmartypantsLite(), MarkedEmojis(MarkedEmojiOptions)); function cleanUrl(href) { @@ -841,12 +852,12 @@ const processStyleTags = (string)=>{ obj[key.trim()] = value.trim(); return obj; }, {}) || null; - const styles = tags?.length ? tags.reduce((styleObj, style) => { - const index = style.indexOf(':'); - const [key, value] = [style.substring(0, index), style.substring(index + 1)]; - styleObj[key.trim()] = value.replace(/"?([^"]*)"?/g, '$1').trim(); - return styleObj; - }, {}) : null; + const styles = tags?.length ? tags.reduce((styleObj, style)=>{ + const index = style.indexOf(':'); + const [key, value] = [style.substring(0, index), style.substring(index + 1)]; + styleObj[key.trim()] = value.replace(/"?([^"]*)"?/g, '$1').trim(); + return styleObj; + }, {}) : null; return { id : id, @@ -862,8 +873,8 @@ const extractHTMLStyleTags = (htmlString)=>{ const id = firstElementOnly.match(/id="([^"]*)"/)?.[1] || null; const classes = firstElementOnly.match(/class="([^"]*)"/)?.[1] || null; const styles = firstElementOnly.match(/style="([^"]*)"/)?.[1] - ?.split(';').reduce((styleObj, style) => { - if (style.trim() === '') return styleObj; + ?.split(';').reduce((styleObj, style)=>{ + if(style.trim() === '') return styleObj; const index = style.indexOf(':'); const [key, value] = [style.substring(0, index), style.substring(index + 1)]; styleObj[key.trim()] = value.trim(); @@ -873,7 +884,7 @@ const extractHTMLStyleTags = (htmlString)=>{ ?.filter((attr)=>!attr.startsWith('class="') && !attr.startsWith('style="') && !attr.startsWith('id="')) .reduce((obj, attr)=>{ const index = attr.indexOf('='); - let [key, value] = [attr.substring(0, index), attr.substring(index + 1)]; + const [key, value] = [attr.substring(0, index), attr.substring(index + 1)]; obj[key.trim()] = value.replace(/"/g, ''); return obj; }, {}) || null; @@ -886,7 +897,7 @@ const extractHTMLStyleTags = (htmlString)=>{ }; }; -const mergeHTMLTags = (originalTags, newTags) => { +const mergeHTMLTags = (originalTags, newTags)=>{ return { id : newTags.id || originalTags.id || null, classes : [originalTags.classes, newTags.classes].join(' ').trim() || null, From ee543b7090fd2d1cdd493041b3a0a8a642140923 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Thu, 13 Mar 2025 11:59:12 +1300 Subject: [PATCH 16/45] Add int to char functions --- shared/naturalcrit/markdown.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 93567a4d7..de2a5aeec 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -70,6 +70,20 @@ mathParser.functions.toRomansUpper = function (a) { mathParser.functions.toRomansLower = function (a) { return romanize(a).toLowerCase(); }; +// Add character functions +mathParser.functions.toChar = function (a) { + if(a <= 0) return a; + const genChars = function (i) { + return (i > 26 ? genChars(Math.floor((i - 1) / 26)) : '') + 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'[(i - 1) % 26]; + }; + return genChars(a); +}; +mathParser.functions.toCharUpper = function (a) { + return mathParser.functions.toChar(a).toUpperCase(); +}; +mathParser.functions.toCharLower = function (a) { + return mathParser.functions.toChar(a).toLowerCase(); +}; //Processes the markdown within an HTML block if it's just a class-wrapper renderer.html = function (token) { From 7371f57ded96ffba18a8e3824f4d5b79e46b5b58 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Thu, 13 Mar 2025 12:21:53 +1300 Subject: [PATCH 17/45] Add written number package --- package-lock.json | 9 ++++++++- package.json | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 35bc0c147..d9c8cbc7a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -51,7 +51,8 @@ "romans": "^3.0.0", "sanitize-filename": "1.6.3", "superagent": "^10.1.1", - "vitreum": "git+https://git@github.com/calculuschild/vitreum.git" + "vitreum": "git+https://git@github.com/calculuschild/vitreum.git", + "written-number": "^0.11.1" }, "devDependencies": { "@stylistic/stylelint-plugin": "^3.1.2", @@ -14848,6 +14849,12 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/written-number": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/written-number/-/written-number-0.11.1.tgz", + "integrity": "sha512-LhQ68uUnzHH0bwm/QiGA9JwqgadSDOwqB2AIs/LBsrOY6ScqVXKRN2slTCeKAhstDBJ/Of/Yxcjn0pnQmVlmtg==", + "license": "MIT" + }, "node_modules/ws": { "version": "7.5.10", "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", diff --git a/package.json b/package.json index 43638d326..6d59138f6 100644 --- a/package.json +++ b/package.json @@ -125,7 +125,8 @@ "romans": "^3.0.0", "sanitize-filename": "1.6.3", "superagent": "^10.1.1", - "vitreum": "git+https://git@github.com/calculuschild/vitreum.git" + "vitreum": "git+https://git@github.com/calculuschild/vitreum.git", + "written-number": "^0.11.1" }, "devDependencies": { "@stylistic/stylelint-plugin": "^3.1.2", From 543d18f9d942bf64fd45e41c1286d8489a2eb246 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Thu, 13 Mar 2025 12:22:08 +1300 Subject: [PATCH 18/45] Add written number functions --- shared/naturalcrit/markdown.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index de2a5aeec..fda410c36 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -9,6 +9,7 @@ import { gfmHeadingId as MarkedGFMHeadingId, resetHeadings as MarkedGFMResetHead import { markedEmoji as MarkedEmojis } from 'marked-emoji'; import MarkedSubSuperText from 'marked-subsuper-text'; import { romanize } from 'romans'; +import writtenNumber from 'written-number'; //Icon fonts included so they can appear in emoji autosuggest dropdown import diceFont from '../../themes/fonts/iconFonts/diceFont.js'; @@ -84,6 +85,22 @@ mathParser.functions.toCharUpper = function (a) { mathParser.functions.toCharLower = function (a) { return mathParser.functions.toChar(a).toLowerCase(); }; +// Add word functions +mathParser.functions.toWords = function (a) { + return writtenNumber(a); +}; +mathParser.functions.toWordsUpper = function (a) { + return mathParser.functions.toWords(a).toUpperCase(); +}; +mathParser.functions.toWordsLower = function (a) { + return mathParser.functions.toWords(a).toLowerCase(); +}; +mathParser.functions.toWordsCamel = function (a) { + const words = mathParser.functions.toWords(a).split(' '); + return words.map((word)=>{ + return _.capitalize(word); + }).join(' '); +}; //Processes the markdown within an HTML block if it's just a class-wrapper renderer.html = function (token) { From 44a01f27fe48799fcab04a02a3e70fcf016cb6e0 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Thu, 13 Mar 2025 13:58:06 +1300 Subject: [PATCH 19/45] Add tests for custom math functions --- tests/markdown/variables.test.js | 74 ++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/tests/markdown/variables.test.js b/tests/markdown/variables.test.js index 41259da7e..96400d834 100644 --- a/tests/markdown/variables.test.js +++ b/tests/markdown/variables.test.js @@ -410,4 +410,78 @@ describe('Regression Tests', ()=>{ const rendered = Markdown.render(source).trimReturns(); expect(rendered).toBe('
title 1title 2title 3title 4
fooIpsum))
'); }); +}); + +describe('Custom Math Function Tests', ()=>{ + it('Sign Test', function() { + const source = `[a]: 13\n\n[b]: -11\n\nPositive: $[sign(a)]\n\nNegative: $[sign(b)]`; + const rendered = Markdown.render(source).trimReturns(); + expect(rendered).toBe('

Positive: +

Negative: -

'); + }); + + it('Signed Test', function() { + const source = `[a]: 13\n\n[b]: -11\n\nPositive: $[signed(a)]\n\nNegative: $[signed(b)]`; + const rendered = Markdown.render(source).trimReturns(); + expect(rendered).toBe('

Positive: +13

Negative: -11

'); + }); + + it('Roman Numerals Test', function() { + const source = `[a]: 18\n\nRoman Numeral: $[toRomans(a)]`; + const rendered = Markdown.render(source).trimReturns(); + expect(rendered).toBe('

Roman Numeral: XVIII

'); + }); + + it('Roman Numerals Test - Uppercase', function() { + const source = `[a]: 18\n\nRoman Numeral: $[toRomansUpper(a)]`; + const rendered = Markdown.render(source).trimReturns(); + expect(rendered).toBe('

Roman Numeral: XVIII

'); + }); + + it('Roman Numerals Test - Lowercase', function() { + const source = `[a]: 18\n\nRoman Numeral: $[toRomansLower(a)]`; + const rendered = Markdown.render(source).trimReturns(); + expect(rendered).toBe('

Roman Numeral: xviii

'); + }); + + it('Number to Characters Test', function() { + const source = `[a]: 18\n\n[b]: 39\n\nCharacters: $[toChar(a)] $[toChar(b)]`; + const rendered = Markdown.render(source).trimReturns(); + expect(rendered).toBe('

Characters: R AM

'); + }); + + it('Number to Characters Test - Uppercase', function() { + const source = `[a]: 18\n\n[b]: 39\n\nCharacters: $[toCharUpper(a)] $[toCharUpper(b)]`; + const rendered = Markdown.render(source).trimReturns(); + expect(rendered).toBe('

Characters: R AM

'); + }); + + it('Number to Characters Test - Lowercase', function() { + const source = `[a]: 18\n\n[b]: 39\n\nCharacters: $[toCharLower(a)] $[toCharLower(b)]`; + const rendered = Markdown.render(source).trimReturns(); + expect(rendered).toBe('

Characters: r am

'); + }); + + it('Number to Words Test', function() { + const source = `[a]: 80085\n\nWords: $[toWords(a)]`; + const rendered = Markdown.render(source).trimReturns(); + expect(rendered).toBe('

Words: eighty thousand and eighty-five

'); + }); + + it('Number to Words Test - Uppercase', function() { + const source = `[a]: 80085\n\nWords: $[toWordsUpper(a)]`; + const rendered = Markdown.render(source).trimReturns(); + expect(rendered).toBe('

Words: EIGHTY THOUSAND AND EIGHTY-FIVE

'); + }); + + it('Number to Words Test - Lowercase', function() { + const source = `[a]: 80085\n\nWords: $[toWordsLower(a)]`; + const rendered = Markdown.render(source).trimReturns(); + expect(rendered).toBe('

Words: eighty thousand and eighty-five

'); + }); + + it('Number to Words Test - Camelcase', function() { + const source = `[a]: 80085\n\nWords: $[toWordsCamel(a)]`; + const rendered = Markdown.render(source).trimReturns(); + expect(rendered).toBe('

Words: Eighty Thousand And Eighty-five

'); + }); }); \ No newline at end of file From 8b9e084b17ab67a165c787b753ed46aa366946db Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Thu, 13 Mar 2025 14:16:41 +1300 Subject: [PATCH 20/45] Add variable page numbering snippet --- themes/V3/Blank/snippets.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/themes/V3/Blank/snippets.js b/themes/V3/Blank/snippets.js index e92e757cf..16b18ef01 100644 --- a/themes/V3/Blank/snippets.js +++ b/themes/V3/Blank/snippets.js @@ -36,6 +36,11 @@ module.exports = [ icon : 'fas fa-sort-numeric-down', gen : '{{pageNumber,auto}}\n' }, + { + name : 'Variable Auto Page Number', + icon : 'fas fa-sort-numeric-down', + gen : '{{pageNumber $[pageNumber]}}\n' + }, { name : 'Skip Page Number Increment this Page', icon : 'fas fa-xmark', From baafb6d2f9dc350ee2ea571ff5ec5c0fa6fac8b8 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Thu, 13 Mar 2025 14:54:45 +1300 Subject: [PATCH 21/45] Tweak camelcase function --- shared/naturalcrit/markdown.js | 4 +++- tests/markdown/variables.test.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index fda410c36..f8b79e286 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -98,7 +98,9 @@ mathParser.functions.toWordsLower = function (a) { mathParser.functions.toWordsCamel = function (a) { const words = mathParser.functions.toWords(a).split(' '); return words.map((word)=>{ - return _.capitalize(word); + return word.replace(/(?:^|\b|\s)(\w)/g, function(w, index) { + return index === 0 ? w.toLowerCase() : w.toUpperCase(); + }); }).join(' '); }; diff --git a/tests/markdown/variables.test.js b/tests/markdown/variables.test.js index 96400d834..8c58f4925 100644 --- a/tests/markdown/variables.test.js +++ b/tests/markdown/variables.test.js @@ -482,6 +482,6 @@ describe('Custom Math Function Tests', ()=>{ it('Number to Words Test - Camelcase', function() { const source = `[a]: 80085\n\nWords: $[toWordsCamel(a)]`; const rendered = Markdown.render(source).trimReturns(); - expect(rendered).toBe('

Words: Eighty Thousand And Eighty-five

'); + expect(rendered).toBe('

Words: Eighty Thousand And Eighty-Five

'); }); }); \ No newline at end of file From f4afc91df71aaff9c7228afdf850abeff782337c Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Fri, 14 Mar 2025 08:08:30 +1300 Subject: [PATCH 22/45] Rename toWordsCamel to toWordsCaps --- shared/naturalcrit/markdown.js | 2 +- tests/markdown/variables.test.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index f8b79e286..1ab70eac7 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -95,7 +95,7 @@ mathParser.functions.toWordsUpper = function (a) { mathParser.functions.toWordsLower = function (a) { return mathParser.functions.toWords(a).toLowerCase(); }; -mathParser.functions.toWordsCamel = function (a) { +mathParser.functions.toWordsCaps = function (a) { const words = mathParser.functions.toWords(a).split(' '); return words.map((word)=>{ return word.replace(/(?:^|\b|\s)(\w)/g, function(w, index) { diff --git a/tests/markdown/variables.test.js b/tests/markdown/variables.test.js index 8c58f4925..3773097ab 100644 --- a/tests/markdown/variables.test.js +++ b/tests/markdown/variables.test.js @@ -479,8 +479,8 @@ describe('Custom Math Function Tests', ()=>{ expect(rendered).toBe('

Words: eighty thousand and eighty-five

'); }); - it('Number to Words Test - Camelcase', function() { - const source = `[a]: 80085\n\nWords: $[toWordsCamel(a)]`; + it('Number to Words Test - Capitalized', function() { + const source = `[a]: 80085\n\nWords: $[toWordsCaps(a)]`; const rendered = Markdown.render(source).trimReturns(); expect(rendered).toBe('

Words: Eighty Thousand And Eighty-Five

'); }); From 9a26626412fbcfee06c0c3893a3faae8d1418bfe Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Fri, 14 Mar 2025 08:12:30 +1300 Subject: [PATCH 23/45] Change automatic var name to HB_PageNumber --- shared/naturalcrit/markdown.js | 2 +- themes/V3/Blank/snippets.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 1ab70eac7..92e063e5a 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -948,7 +948,7 @@ const Markdown = { render : (rawBrewText, pageNumber=0)=>{ const lastPageNumber = pageNumber > 0 ? globalVarsList[pageNumber - 1].pageNumber.content : 0; globalVarsList[pageNumber] = { //Reset global links for current page, to ensure values are parsed in order - 'pageNumber' : { //Add document variables for this page + 'HB_PageNumber' : { //Add document variables for this page content : !isNaN(Number(lastPageNumber)) ? Number(lastPageNumber) + 1 : lastPageNumber, resolved : true } diff --git a/themes/V3/Blank/snippets.js b/themes/V3/Blank/snippets.js index 16b18ef01..067c35a83 100644 --- a/themes/V3/Blank/snippets.js +++ b/themes/V3/Blank/snippets.js @@ -39,7 +39,7 @@ module.exports = [ { name : 'Variable Auto Page Number', icon : 'fas fa-sort-numeric-down', - gen : '{{pageNumber $[pageNumber]}}\n' + gen : '{{pageNumber $[HB_PageNumber]}}\n' }, { name : 'Skip Page Number Increment this Page', From 20f0d16a58ed149c0a85051c85f4d996d7d31ccc Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Fri, 14 Mar 2025 08:18:30 +1300 Subject: [PATCH 24/45] Fix missed var name update --- 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 92e063e5a..9c38487b6 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -946,7 +946,7 @@ let globalPageNumber = 0; const Markdown = { marked : Marked, render : (rawBrewText, pageNumber=0)=>{ - const lastPageNumber = pageNumber > 0 ? globalVarsList[pageNumber - 1].pageNumber.content : 0; + const lastPageNumber = pageNumber > 0 ? globalVarsList[pageNumber - 1].HB_PageNumber.content : 0; globalVarsList[pageNumber] = { //Reset global links for current page, to ensure values are parsed in order 'HB_PageNumber' : { //Add document variables for this page content : !isNaN(Number(lastPageNumber)) ? Number(lastPageNumber) + 1 : lastPageNumber, From 86ff2ab96be56339ecf540b25d68ad8b45a77d50 Mon Sep 17 00:00:00 2001 From: David Bolack Date: Fri, 14 Mar 2025 19:51:35 -0500 Subject: [PATCH 25/45] Add tests for regression --- tests/markdown/variables.test.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/markdown/variables.test.js b/tests/markdown/variables.test.js index 41259da7e..4c91d7d00 100644 --- a/tests/markdown/variables.test.js +++ b/tests/markdown/variables.test.js @@ -410,4 +410,29 @@ describe('Regression Tests', ()=>{ const rendered = Markdown.render(source).trimReturns(); expect(rendered).toBe('
title 1title 2title 3title 4
fooIpsum))
'); }); + + it('Handle Extra spaces in image alt-text 1', function(){ + const source='![ where is my image??](http://i.imgur.com/hMna6G0.png)'; + const rendered = Markdown.render(source).trimReturns(); + expect(rendered).toBe('

\"where

'); + }); + + it('Handle Extra spaces in image alt-text 2', function(){ + const source='![where is my image??](http://i.imgur.com/hMna6G0.png)'; + const rendered = Markdown.render(source).trimReturns(); + expect(rendered).toBe('

\"where

'); + }); + + it('Handle Extra spaces in image alt-text 3', function(){ + const source='![where is my image?? ](http://i.imgur.com/hMna6G0.png)'; + const rendered = Markdown.render(source).trimReturns(); + expect(rendered).toBe('

\"where

'); + }); + + it('Handle Extra spaces in image alt-text 4', function(){ + const source='![where is my image??](http://i.imgur.com/hMna6G0.png){height=20%,width=20%}'; + const rendered = Markdown.render(source).trimReturns(); + expect(rendered).toBe('

\"where

'); + }); + }); \ No newline at end of file From 48285e67383bf6841c22ac930600e95b493677e6 Mon Sep 17 00:00:00 2001 From: David Bolack Date: Wed, 19 Mar 2025 17:45:47 -0500 Subject: [PATCH 26/45] Add validation to ensure \page mustaches have return valid contents from the lexar --- client/homebrew/brewRenderer/brewRenderer.jsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/client/homebrew/brewRenderer/brewRenderer.jsx b/client/homebrew/brewRenderer/brewRenderer.jsx index 21c0608bd..f666d9ba9 100644 --- a/client/homebrew/brewRenderer/brewRenderer.jsx +++ b/client/homebrew/brewRenderer/brewRenderer.jsx @@ -186,12 +186,14 @@ const BrewRenderer = (props)=>{ } else { if(pageText.startsWith('\\page')) { 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)=>k.startsWith('--') ? k : _.camelCase(k)); // Convert CSS to camelCase for React - classes = [classes, injectedTags.classes].join(' ').trim(); - attributes = injectedTags.attributes; + if(firstLineTokens) { // Catch invalid/empty mustache blocks + const injectedTags = firstLineTokens.find((obj)=>obj.injectedTags !== undefined)?.injectedTags; + if(injectedTags) { + styles = { ...styles, ...injectedTags.styles }; + 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; + } } pageText = pageText.includes('\n') ? pageText.substring(pageText.indexOf('\n') + 1) : ''; // Remove the \page line } From 481219402c34aa6b49235a2174dad968fa49fe1a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Mar 2025 03:29:48 +0000 Subject: [PATCH 27/45] Bump supertest from 7.0.0 to 7.1.0 Bumps [supertest](https://github.com/ladjs/supertest) from 7.0.0 to 7.1.0. - [Release notes](https://github.com/ladjs/supertest/releases) - [Commits](https://github.com/ladjs/supertest/compare/v7.0.0...v7.1.0) --- updated-dependencies: - dependency-name: supertest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 69cc1cade..9220e4e12 100644 --- a/package-lock.json +++ b/package-lock.json @@ -66,7 +66,7 @@ "stylelint": "^16.16.0", "stylelint-config-recess-order": "^6.0.0", "stylelint-config-recommended": "^15.0.0", - "supertest": "^7.0.0" + "supertest": "^7.1.0" }, "engines": { "node": "^20.18.x", @@ -13426,9 +13426,9 @@ } }, "node_modules/supertest": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/supertest/-/supertest-7.0.0.tgz", - "integrity": "sha512-qlsr7fIC0lSddmA3tzojvzubYxvlGtzumcdHgPwbFWMISQwL22MhM2Y3LNt+6w9Yyx7559VW5ab70dgphm8qQA==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supertest/-/supertest-7.1.0.tgz", + "integrity": "sha512-5QeSO8hSrKghtcWEoPiO036fxH0Ii2wVQfFZSP0oqQhmjk8bOLhDFXr4JrvaFmPuEWUoq4znY3uSi8UzLKxGqw==", "dev": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 96528b786..7f7b10bf5 100644 --- a/package.json +++ b/package.json @@ -140,6 +140,6 @@ "stylelint": "^16.16.0", "stylelint-config-recess-order": "^6.0.0", "stylelint-config-recommended": "^15.0.0", - "supertest": "^7.0.0" + "supertest": "^7.1.0" } } From cb618914506f55bcf4523657227bad294cdd1031 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sat, 22 Mar 2025 12:31:38 +1300 Subject: [PATCH 28/45] Change local regex testing --- server/app.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/server/app.js b/server/app.js index 079f5e03c..6bd0c7c9a 100644 --- a/server/app.js +++ b/server/app.js @@ -69,14 +69,11 @@ const corsOptions = { 'https://homebrewery-stage.herokuapp.com', ]; - if(isLocalEnvironment) { - const localNetworkRegex = /^http:\/\/(localhost|127\.0\.0\.1|10\.\d+\.\d+\.\d+|192\.168\.\d+\.\d+|172\.(1[6-9]|2\d|3[0-1])\.\d+\.\d+):\d+$/; - allowedOrigins.push(localNetworkRegex); - } + const localNetworkRegex = /^http:\/\/(localhost|127\.0\.0\.1|10\.\d+\.\d+\.\d+|192\.168\.\d+\.\d+|172\.(1[6-9]|2\d|3[0-1])\.\d+\.\d+):\d+$/; const herokuRegex = /^https:\/\/(?:homebrewery-pr-\d+\.herokuapp\.com|naturalcrit-pr-\d+\.herokuapp\.com)$/; // Matches any Heroku app - if(!origin || allowedOrigins.includes(origin) || herokuRegex.test(origin)) { + if(!origin || allowedOrigins.includes(origin) || herokuRegex.test(origin) || (isLocalEnvironment && localNetworkRegex.test(origin))) { callback(null, true); } else { console.log(origin, 'not allowed'); From 0fc7571c35940bd5252a0f190f2a5767672a46e9 Mon Sep 17 00:00:00 2001 From: David Bolack Date: Sun, 23 Mar 2025 20:41:14 -0500 Subject: [PATCH 29/45] Somehow this change did not get commited or pushed. This swaps the if block for an optional chaining --- client/homebrew/brewRenderer/brewRenderer.jsx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/client/homebrew/brewRenderer/brewRenderer.jsx b/client/homebrew/brewRenderer/brewRenderer.jsx index f666d9ba9..c83a2029b 100644 --- a/client/homebrew/brewRenderer/brewRenderer.jsx +++ b/client/homebrew/brewRenderer/brewRenderer.jsx @@ -186,14 +186,12 @@ const BrewRenderer = (props)=>{ } else { if(pageText.startsWith('\\page')) { const firstLineTokens = Markdown.marked.lexer(pageText.split('\n', 1)[0])[0].tokens; - if(firstLineTokens) { // Catch invalid/empty mustache blocks - const injectedTags = firstLineTokens.find((obj)=>obj.injectedTags !== undefined)?.injectedTags; - if(injectedTags) { - styles = { ...styles, ...injectedTags.styles }; - 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; - } + const injectedTags = firstLineTokens?.find((obj)=>obj.injectedTags !== undefined)?.injectedTags; + if(injectedTags) { + styles = { ...styles, ...injectedTags.styles }; + 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; } pageText = pageText.includes('\n') ? pageText.substring(pageText.indexOf('\n') + 1) : ''; // Remove the \page line } From 712ee111d4480121eff300b09b4ab8522135a9da Mon Sep 17 00:00:00 2001 From: David Bolack Date: Sun, 23 Mar 2025 20:48:30 -0500 Subject: [PATCH 30/45] Move Dropcap settings back to PHB --- themes/V3/5ePHB/snippets.js | 30 ++++++++++++++++++++++++++++++ themes/V3/Blank/snippets.js | 25 +------------------------ 2 files changed, 31 insertions(+), 24 deletions(-) diff --git a/themes/V3/5ePHB/snippets.js b/themes/V3/5ePHB/snippets.js index f5c8120c1..27ea62bea 100644 --- a/themes/V3/5ePHB/snippets.js +++ b/themes/V3/5ePHB/snippets.js @@ -12,6 +12,36 @@ const dedent = require('dedent-tabs').default; module.exports = [ + { + groupName : 'Style Editor', + icon : 'fas fa-pencil-alt', + view : 'style', + snippets : [ + { + name : 'Remove Drop Cap', + icon : 'fas fa-remove-format', + gen : dedent`/* Removes Drop Caps */ + .page h1+p:first-letter { + all: unset; + }\n\n + /* Removes Small-Caps in first line */ + .page h1+p:first-line { + all: unset; + }` + }, + { + name : 'Tweak Drop Cap', + icon : 'fas fa-sliders-h', + gen : dedent`/* Drop Cap settings */ + .page h1 + p::first-letter { + font-family: SolberaImitationRemake; + font-size: 3.5cm; + background-image: linear-gradient(-45deg, #322814, #998250, #322814); + line-height: 1em; + }\n\n` + }, + ] + }, /************************* PHB ********************/ { groupName : 'PHB', diff --git a/themes/V3/Blank/snippets.js b/themes/V3/Blank/snippets.js index 08e378490..809035a3a 100644 --- a/themes/V3/Blank/snippets.js +++ b/themes/V3/Blank/snippets.js @@ -201,30 +201,7 @@ module.exports = [ name : 'Add Comment', icon : 'fas fa-code', gen : '/* This is a comment that will not be rendered into your brew. */' - }, - { - name : 'Remove Drop Cap', - icon : 'fas fa-remove-format', - gen : dedent`/* Removes Drop Caps */ - .page h1+p:first-letter { - all: unset; - }\n\n - /* Removes Small-Caps in first line */ - .page h1+p:first-line { - all: unset; - }` - }, - { - name : 'Tweak Drop Cap', - icon : 'fas fa-sliders-h', - gen : dedent`/* Drop Cap settings */ - .page h1 + p::first-letter { - font-family: SolberaImitationRemake; - font-size: 3.5cm; - background-image: linear-gradient(-45deg, #322814, #998250, #322814); - line-height: 1em; - }\n\n` - }, + } ] }, From 3672285e923a2f5de9cef4a2ae7bffff02df47c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Mon, 24 Mar 2025 13:09:56 +0100 Subject: [PATCH 31/45] additional linting pass through themes --- themes/Legacy/5ePHB/style.less | 26 +++++++++++++------------- themes/V3/5eDMG/style.less | 4 ++-- themes/V3/5ePHB/style.less | 2 +- themes/V3/Blank/style.less | 28 +++++++++++++--------------- themes/V3/Journal/style.less | 30 +++++++++++++++--------------- 5 files changed, 44 insertions(+), 46 deletions(-) diff --git a/themes/Legacy/5ePHB/style.less b/themes/Legacy/5ePHB/style.less index 56d1bed94..41524c74c 100644 --- a/themes/Legacy/5ePHB/style.less +++ b/themes/Legacy/5ePHB/style.less @@ -13,13 +13,13 @@ body { counter-reset : phb-page-numbers; } * { -webkit-print-color-adjust : exact; } .useSansSerif() { - font-family : "ScalySans"; + font-family : 'ScalySans'; em { - font-family : "ScalySans"; + font-family : 'ScalySans'; font-style : italic; } strong { - font-family : "ScalySans"; + font-family : 'ScalySans'; font-weight : 800; letter-spacing : -0.02em; } @@ -46,7 +46,7 @@ body { counter-reset : phb-page-numbers; } padding : 1.0cm 1.7cm; padding-bottom : 1.5cm; overflow : hidden; - font-family : "BookSanity"; + font-family : 'BookSanity'; font-size : 0.317cm; counter-increment : phb-page-numbers; background-color : @background; @@ -106,7 +106,7 @@ body { counter-reset : phb-page-numbers; } h1,h2,h3,h4 { margin-top : 0.2em; margin-bottom : 0.2em; - font-family : "MrJeeves"; + font-family : 'MrJeeves'; font-weight : 800; color : @headerText; } @@ -117,7 +117,7 @@ body { counter-reset : phb-page-numbers; } -moz-column-span : all; & + p::first-letter { float : left; - font-family : "Solberry"; + font-family : 'Solberry'; font-size : 10em; line-height : 0.795em; color : #222222; @@ -134,7 +134,7 @@ body { counter-reset : phb-page-numbers; } } h5 { margin-bottom : 0.2em; - font-family : "ScalySansSmallCaps"; + font-family : 'ScalySansSmallCaps'; font-size : 0.423cm; font-weight : 900; } @@ -200,7 +200,7 @@ body { counter-reset : phb-page-numbers; } & + p { padding-bottom : 0px; } } h3 { - font-family : "ScalySans"; + font-family : 'ScalySans'; font-weight : normal; border-bottom : 1px solid @headerText; } @@ -380,7 +380,7 @@ body { counter-reset : phb-page-numbers; } // ************************************/ .phb .descriptive { margin-bottom : 1em; - font-family : "ScalySans"; + font-family : 'ScalySans'; background-color : #FAF7EA; border-style : solid; border-width : 7px; @@ -394,11 +394,11 @@ body { counter-reset : phb-page-numbers; } } p + p { padding-top : 0.8em; } em { - font-family : "ScalySans"; + font-family : 'ScalySans'; font-style : italic; } strong { - font-family : "ScalySans"; + font-family : 'ScalySans'; font-weight : 800; letter-spacing : -0.02em; } @@ -411,7 +411,7 @@ body { counter-reset : phb-page-numbers; } .phb { .artist { position : absolute; - font-family : "WalterTurncoat"; + font-family : 'WalterTurncoat'; font-size : 0.27cm; color : @captionText; text-align : center; @@ -421,7 +421,7 @@ body { counter-reset : phb-page-numbers; } text-indent : unset; } h5 { - font-family : "WalterTurncoat"; + font-family : 'WalterTurncoat'; font-size : 1.3em; } a { diff --git a/themes/V3/5eDMG/style.less b/themes/V3/5eDMG/style.less index cbc3fa890..d79533c2c 100644 --- a/themes/V3/5eDMG/style.less +++ b/themes/V3/5eDMG/style.less @@ -7,7 +7,7 @@ } .page { - background-image : url("/assets/DMG_background.png"); + background-image : url('/assets/DMG_background.png'); background-size : cover; /* TABLES WITHIN NOTES */ @@ -23,7 +23,7 @@ &::after { height : 58px; - background-image : url("/assets/DMG_footerAccent.png"); + background-image : url('/assets/DMG_footerAccent.png'); } .footnote { bottom : 40px; } diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index d51cfd313..555866ba4 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -792,7 +792,7 @@ // *****************************/ // Additional Default Exclusions -.monster { --TOC: exclude; } +.monster { --TOC : exclude; } .page:has(.partCover) { --TOC : exclude; diff --git a/themes/V3/Blank/style.less b/themes/V3/Blank/style.less index 519b60207..01b85326f 100644 --- a/themes/V3/Blank/style.less +++ b/themes/V3/Blank/style.less @@ -532,20 +532,20 @@ h6, .page:has(.backCover), .page:has(.insideCover), .noToC, -.toc { --TOC: exclude; } +.toc { --TOC : exclude; } -.tocDepthH2 :is(h1, h2) {--TOC: include; } -.tocDepthH3 :is(h1, h2, h3) {--TOC: include; } -.tocDepthH4 :is(h1, h2, h3, h4) {--TOC: include; } -.tocDepthH5 :is(h1, h2, h3, h4, h5) {--TOC: include; } -.tocDepthH6 :is(h1, h2, h3, h4, h5, h6) {--TOC: include; } +.tocDepthH2 :is(h1, h2) {--TOC : include; } +.tocDepthH3 :is(h1, h2, h3) {--TOC : include; } +.tocDepthH4 :is(h1, h2, h3, h4) {--TOC : include; } +.tocDepthH5 :is(h1, h2, h3, h4, h5) {--TOC : include; } +.tocDepthH6 :is(h1, h2, h3, h4, h5, h6) {--TOC : include; } -.tocIncludeH1 h1 {--TOC: include; } -.tocIncludeH2 h2 {--TOC: include; } -.tocIncludeH3 h3 {--TOC: include; } -.tocIncludeH4 h4 {--TOC: include; } -.tocIncludeH5 h5 {--TOC: include; } -.tocIncludeH6 h6 {--TOC: include; } +.tocIncludeH1 h1 {--TOC : include; } +.tocIncludeH2 h2 {--TOC : include; } +.tocIncludeH3 h3 {--TOC : include; } +.tocIncludeH4 h4 {--TOC : include; } +.tocIncludeH5 h5 {--TOC : include; } +.tocIncludeH6 h6 {--TOC : include; } .page { &:has(.toc)::after { display : none; } @@ -609,7 +609,5 @@ h6, .useColumns(0.96, @fillMode: balance); } } - .toc.wide li { - break-inside: auto; - } + .toc.wide li { break-inside : auto; } } diff --git a/themes/V3/Journal/style.less b/themes/V3/Journal/style.less index bddefb749..74c976f47 100644 --- a/themes/V3/Journal/style.less +++ b/themes/V3/Journal/style.less @@ -12,7 +12,7 @@ } .useSansSerif() { - font-family : "PermanentMarker"; + font-family : 'PermanentMarker'; font-size : 0.3cm; line-height : 1.2em; color : var(--HB_Color_Text2); @@ -29,7 +29,7 @@ .page { padding : 2.1cm 1.9cm 1.7cm 3.8cm; - background-image : url("/assets/Journal/Background1.webp"); + background-image : url('/assets/Journal/Background1.webp'); background-repeat : no-repeat; background-size : 200% 100%; filter : drop-shadow(1px 4px 14px black); @@ -39,7 +39,7 @@ background-position : right; } &:nth-of-type(2) { - background-image : url("/assets/Journal/Background2.webp"); //Only first page should show ribbon + background-image : url('/assets/Journal/Background2.webp'); //Only first page should show ribbon } & .columnWrapper { @@ -51,7 +51,7 @@ // * BASE // *****************************/ .page { - font-family : "ReenieBeanie"; + font-family : 'ReenieBeanie'; font-size : 0.53cm; line-height : 0.8em; color : var(--HB_Color_Text); @@ -71,7 +71,7 @@ // * HEADERS // *****************************/ h1,h2,h3,h4,h5 { - font-family : "FrederickaTheGreat"; + font-family : 'FrederickaTheGreat'; font-weight : unset; color : var(--HB_Color_HeaderText); } @@ -89,7 +89,7 @@ margin-right : 0.1em; margin-bottom : -20px; margin-left : -40px; - font-family : "FrederickaTheGreat"; + font-family : 'FrederickaTheGreat'; font-size : 1.9em; line-height : 1em; } @@ -114,7 +114,7 @@ &:nth-of-type(3n) { transform : rotate(-1.5deg); } } h5 { - font-family : "PermanentMarker"; + font-family : 'PermanentMarker'; font-size : 0.4cm; font-weight : bold; line-height : 0.951em; //Font is misaligned. Shift up slightly @@ -146,14 +146,14 @@ .note { .useSansSerif(); padding : 0.2cm; - background-image : url("/assets/Journal/HashMarks.png"), + background-image : url('/assets/Journal/HashMarks.png'), linear-gradient(to bottom right, #FF000000, #A36A4E14, #41212100); background-repeat : no-repeat; background-position : center; background-size : 120% 120%; border-style : solid; border-width : 1px; - border-image-source : url("/assets/Journal/Border1.png"); + border-image-source : url('/assets/Journal/Border1.png'); border-image-slice : 18 18 18 18; border-image-width : 6px 6px 6px 6px; border-image-outset : 5px 5px 5px 5px; @@ -173,7 +173,7 @@ .descriptive { .useSansSerif(); padding : 0.2cm; - background-image : url("/assets/Journal/HashMarks.png"), + background-image : url('/assets/Journal/HashMarks.png'), linear-gradient(to bottom right, #FF000000, #41212114, #41212100); background-repeat : no-repeat; background-position : center; @@ -201,7 +201,7 @@ .artist { position : absolute; width : auto; - font-family : "WalterTurncoat"; + font-family : 'WalterTurncoat'; font-size : 0.27cm; color : var(--HB_Color_CaptionText); text-align : center; @@ -211,7 +211,7 @@ text-indent : unset; } h5 { - font-family : "WalterTurncoat"; + font-family : 'WalterTurncoat'; font-size : 1.3em; } a { @@ -309,7 +309,7 @@ .pageNumber { right : 3cm; bottom : 1.25cm; - font-family : "FrederickaTheGreat"; + font-family : 'FrederickaTheGreat'; color : var(--HB_Color_HeaderText); } .footnote { @@ -370,7 +370,7 @@ .page .spellList { .useSansSerif(); - font-family : "PermanentMarker"; + font-family : 'PermanentMarker'; column-count : 2; ul + h5 { margin-top : 15px; } ul { @@ -439,7 +439,7 @@ &:last-child { width : 1%; padding-left : 0.06cm; /* Spacing after dot leaders */ - font-family : "ReenieBeanie"; + font-family : 'ReenieBeanie'; font-size : 0.34cm; font-weight : normal; vertical-align : bottom; /* Keep page number bottom-aligned */ From 7bc323c92c54b1aa0e663319d0537b1008e68945 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Mar 2025 15:06:16 +0000 Subject: [PATCH 32/45] Bump nanoid from 5.1.3 to 5.1.5 Bumps [nanoid](https://github.com/ai/nanoid) from 5.1.3 to 5.1.5. - [Release notes](https://github.com/ai/nanoid/releases) - [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md) - [Commits](https://github.com/ai/nanoid/compare/5.1.3...5.1.5) --- updated-dependencies: - dependency-name: nanoid dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9220e4e12..36e94533a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,7 +42,7 @@ "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.30.1", "mongoose": "^8.12.1", - "nanoid": "5.1.3", + "nanoid": "5.1.5", "nconf": "^0.12.1", "react": "^18.3.1", "react-dom": "^18.3.1", @@ -10480,9 +10480,9 @@ "optional": true }, "node_modules/nanoid": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.1.3.tgz", - "integrity": "sha512-zAbEOEr7u2CbxwoMRlz/pNSpRP0FdAU4pRaYunCdEezWohXFs+a0Xw7RfkKaezMsmSM1vttcLthJtwRnVtOfHQ==", + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.1.5.tgz", + "integrity": "sha512-Ir/+ZpE9fDsNH0hQ3C68uyThDXzYcim2EqcZ8zn8Chtt1iylPT9xXJB0kPCnqzgcEGikO9RxSrh63MsmVCU7Fw==", "funding": [ { "type": "github", diff --git a/package.json b/package.json index 7f7b10bf5..74fd4ab9a 100644 --- a/package.json +++ b/package.json @@ -116,7 +116,7 @@ "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.30.1", "mongoose": "^8.12.1", - "nanoid": "5.1.3", + "nanoid": "5.1.5", "nconf": "^0.12.1", "react": "^18.3.1", "react-dom": "^18.3.1", From c8cf9e3002073c21233f7e31791ad40f70ad23fa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Mar 2025 15:06:30 +0000 Subject: [PATCH 33/45] Bump @googleapis/drive from 8.16.0 to 11.0.0 Bumps [@googleapis/drive](https://github.com/googleapis/google-api-nodejs-client) from 8.16.0 to 11.0.0. - [Release notes](https://github.com/googleapis/google-api-nodejs-client/releases) - [Changelog](https://github.com/googleapis/google-api-nodejs-client/blob/11.0.0/CHANGELOG.md) - [Commits](https://github.com/googleapis/google-api-nodejs-client/compare/drive-v8.16.0...11.0.0) --- updated-dependencies: - dependency-name: "@googleapis/drive" dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9220e4e12..579c0c65c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "@babel/plugin-transform-runtime": "^7.26.9", "@babel/preset-env": "^7.26.9", "@babel/preset-react": "^7.26.3", - "@googleapis/drive": "^8.16.0", + "@googleapis/drive": "^11.0.0", "body-parser": "^1.20.2", "classnames": "^2.5.1", "codemirror": "^5.65.6", @@ -1972,9 +1972,9 @@ } }, "node_modules/@googleapis/drive": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/@googleapis/drive/-/drive-8.16.0.tgz", - "integrity": "sha512-Xi2mMrUTQ+gsfyouRGd0pfnL+jjg4n4sjKsJruM1y4DknuRfdSBTk5E//WrL0YJ/CqpcBgyd7L8DvaPRtxZD3Q==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@googleapis/drive/-/drive-11.0.0.tgz", + "integrity": "sha512-vhkl6/MZ8k5h5XOyenWOD4ys+SNdb8wKYvzU6OBGFx/TzJyHRm4JwgvE8uVDFU6efzNRS0mOiNRfY6nrmHOTtg==", "license": "Apache-2.0", "dependencies": { "googleapis-common": "^7.0.0" diff --git a/package.json b/package.json index 7f7b10bf5..21cd55db1 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "@babel/plugin-transform-runtime": "^7.26.9", "@babel/preset-env": "^7.26.9", "@babel/preset-react": "^7.26.3", - "@googleapis/drive": "^8.16.0", + "@googleapis/drive": "^11.0.0", "body-parser": "^1.20.2", "classnames": "^2.5.1", "codemirror": "^5.65.6", From 8e10e9dea9c16e295e1468c051d6ed9568ba7a86 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Mar 2025 15:13:56 +0000 Subject: [PATCH 34/45] Bump react-router from 7.3.0 to 7.4.0 Bumps [react-router](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router) from 7.3.0 to 7.4.0. - [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.4.0/packages/react-router) --- updated-dependencies: - dependency-name: react-router dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index d019bb561..bc68da76a 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.3.0", + "react-router": "^7.4.0", "sanitize-filename": "1.6.3", "superagent": "^10.1.1", "vitreum": "git+https://git@github.com/calculuschild/vitreum.git" @@ -11753,9 +11753,9 @@ "license": "MIT" }, "node_modules/react-router": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.3.0.tgz", - "integrity": "sha512-466f2W7HIWaNXTKM5nHTqNxLrHTyXybm7R0eBlVSt0k/u55tTCDO194OIx/NrYD4TS5SXKTNekXfT37kMKUjgw==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.4.0.tgz", + "integrity": "sha512-Y2g5ObjkvX3VFeVt+0CIPuYd9PpgqCslG7ASSIdN73LwA1nNWzcMLaoMRJfP3prZFI92svxFwbn7XkLJ+UPQ6A==", "license": "MIT", "dependencies": { "@types/cookie": "^0.6.0", diff --git a/package.json b/package.json index 294c301e6..944431e07 100644 --- a/package.json +++ b/package.json @@ -121,7 +121,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "react-frame-component": "^4.1.3", - "react-router": "^7.3.0", + "react-router": "^7.4.0", "sanitize-filename": "1.6.3", "superagent": "^10.1.1", "vitreum": "git+https://git@github.com/calculuschild/vitreum.git" From 0095e4582b8b96776a0b3a42edf98285ad9f72d5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Mar 2025 15:18:49 +0000 Subject: [PATCH 35/45] Bump superagent from 10.1.1 to 10.2.0 Bumps [superagent](https://github.com/ladjs/superagent) from 10.1.1 to 10.2.0. - [Release notes](https://github.com/ladjs/superagent/releases) - [Changelog](https://github.com/ladjs/superagent/blob/master/HISTORY.md) - [Commits](https://github.com/ladjs/superagent/compare/v10.1.1...v10.2.0) --- updated-dependencies: - dependency-name: superagent dependency-type: direct:production update-type: version-update:semver-minor ... 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 bc68da76a..678fa39cb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -49,7 +49,7 @@ "react-frame-component": "^4.1.3", "react-router": "^7.4.0", "sanitize-filename": "1.6.3", - "superagent": "^10.1.1", + "superagent": "^10.2.0", "vitreum": "git+https://git@github.com/calculuschild/vitreum.git" }, "devDependencies": { @@ -13395,9 +13395,10 @@ } }, "node_modules/superagent": { - "version": "10.1.1", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-10.1.1.tgz", - "integrity": "sha512-9pIwrHrOj3uAnqg9gDlW7EA2xv+N5au/dSM0kM22HTqmUu8jBxNT+8uA7tA3UoCnmiqzpSbu8rasIUZvbyamMQ==", + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-10.2.0.tgz", + "integrity": "sha512-IKeoGox6oG9zyDeizaezkJ2/aK0wc5la9st7WsAKyrAkfJ56W3whVbVtF68k6wuc87/y9T85NyON5FLz7Mrzzw==", + "license": "MIT", "dependencies": { "component-emitter": "^1.3.0", "cookiejar": "^2.1.4", diff --git a/package.json b/package.json index 944431e07..0ce9d56a2 100644 --- a/package.json +++ b/package.json @@ -123,7 +123,7 @@ "react-frame-component": "^4.1.3", "react-router": "^7.4.0", "sanitize-filename": "1.6.3", - "superagent": "^10.1.1", + "superagent": "^10.2.0", "vitreum": "git+https://git@github.com/calculuschild/vitreum.git" }, "devDependencies": { From cdacaac049d1bbe810fa3472a71184cbe5d28114 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Mar 2025 15:26:53 +0000 Subject: [PATCH 36/45] Bump eslint from 9.22.0 to 9.23.0 Bumps [eslint](https://github.com/eslint/eslint) from 9.22.0 to 9.23.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.22.0...v9.23.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 38 +++++++++++++++++++------------------- package.json | 2 +- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/package-lock.json b/package-lock.json index 678fa39cb..a8118abce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -55,7 +55,7 @@ "devDependencies": { "@stylistic/stylelint-plugin": "^3.1.2", "babel-plugin-transform-import-meta": "^2.3.2", - "eslint": "^9.22.0", + "eslint": "^9.23.0", "eslint-plugin-jest": "^28.11.0", "eslint-plugin-react": "^7.37.4", "globals": "^16.0.0", @@ -1878,9 +1878,9 @@ } }, "node_modules/@eslint/config-helpers": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.1.0.tgz", - "integrity": "sha512-kLrdPDJE1ckPo94kmPPf9Hfd0DU0Jw6oKYrhe+pwSC0iTUInmTa+w6fw8sGgcfkFJGNdWOUeOaDM4quW4a7OkA==", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.2.0.tgz", + "integrity": "sha512-yJLLmLexii32mGrhW29qvU3QBVTu0GUmEf/J4XsBtVhp4JkIUFN/BjWqTF63yRvGApIDpZm5fa97LtYtINmfeQ==", "dev": true, "license": "Apache-2.0", "engines": { @@ -1901,9 +1901,9 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.0.tgz", - "integrity": "sha512-yaVPAiNAalnCZedKLdR21GOGILMLKPyqSLWaAjQFvYA2i/ciDi8ArYVr69Anohb6cH2Ukhqti4aFnYyPm8wdwQ==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz", + "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==", "dev": true, "license": "MIT", "dependencies": { @@ -1938,9 +1938,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.22.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.22.0.tgz", - "integrity": "sha512-vLFajx9o8d1/oL2ZkpMYbkLv8nDB6yaIwFNt7nI4+I80U/z03SxmfOMsLbvWr3p7C+Wnoh//aOu2pQW8cS0HCQ==", + "version": "9.23.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.23.0.tgz", + "integrity": "sha512-35MJ8vCPU0ZMxo7zfev2pypqTwWTofFZO6m4KAtdoFhRpLJUpHTZZ+KB3C7Hb1d7bULYwO4lJXGCi5Se+8OMbw==", "dev": true, "license": "MIT", "engines": { @@ -3140,9 +3140,9 @@ } }, "node_modules/acorn": { - "version": "8.14.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", - "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", + "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", "dev": true, "license": "MIT", "bin": { @@ -5697,19 +5697,19 @@ "license": "MIT" }, "node_modules/eslint": { - "version": "9.22.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.22.0.tgz", - "integrity": "sha512-9V/QURhsRN40xuHXWjV64yvrzMjcz7ZyNoF2jJFmy9j/SLk0u1OLSZgXi28MrXjymnjEGSR80WCdab3RGMDveQ==", + "version": "9.23.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.23.0.tgz", + "integrity": "sha512-jV7AbNoFPAY1EkFYpLq5bslU9NLNO8xnEeQXwErNibVryjk67wHVmddTBilc5srIttJDBrB0eMHKZBFbSIABCw==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", "@eslint/config-array": "^0.19.2", - "@eslint/config-helpers": "^0.1.0", + "@eslint/config-helpers": "^0.2.0", "@eslint/core": "^0.12.0", - "@eslint/eslintrc": "^3.3.0", - "@eslint/js": "9.22.0", + "@eslint/eslintrc": "^3.3.1", + "@eslint/js": "9.23.0", "@eslint/plugin-kit": "^0.2.7", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", diff --git a/package.json b/package.json index 0ce9d56a2..94738a27d 100644 --- a/package.json +++ b/package.json @@ -129,7 +129,7 @@ "devDependencies": { "@stylistic/stylelint-plugin": "^3.1.2", "babel-plugin-transform-import-meta": "^2.3.2", - "eslint": "^9.22.0", + "eslint": "^9.23.0", "eslint-plugin-jest": "^28.11.0", "eslint-plugin-react": "^7.37.4", "globals": "^16.0.0", From d315e4f008600bb1f28eaaeeacc2a191a01be764 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Mar 2025 15:28:21 +0000 Subject: [PATCH 37/45] Bump mongoose from 8.12.1 to 8.13.0 Bumps [mongoose](https://github.com/Automattic/mongoose) from 8.12.1 to 8.13.0. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md) - [Commits](https://github.com/Automattic/mongoose/compare/8.12.1...8.13.0) --- updated-dependencies: - dependency-name: mongoose dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 30 +++++++++++++++--------------- package.json | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index a8118abce..3ebb25945 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,7 +41,7 @@ "marked-subsuper-text": "^1.0.3", "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.30.1", - "mongoose": "^8.12.1", + "mongoose": "^8.13.0", "nanoid": "5.1.5", "nconf": "^0.12.1", "react": "^18.3.1", @@ -10284,9 +10284,9 @@ } }, "node_modules/mongodb-connection-string-url/node_modules/tr46": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.0.0.tgz", - "integrity": "sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.1.0.tgz", + "integrity": "sha512-IUWnUK7ADYR5Sl1fZlO1INDUhVhatWl7BtJWsIhwJ0UAK7ilzzIa8uIqOO/aYVWHZPJkKbEL+362wrzoeRF7bw==", "license": "MIT", "dependencies": { "punycode": "^2.3.1" @@ -10305,12 +10305,12 @@ } }, "node_modules/mongodb-connection-string-url/node_modules/whatwg-url": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.1.1.tgz", - "integrity": "sha512-mDGf9diDad/giZ/Sm9Xi2YcyzaFpbdLpJPr+E9fSkyQ7KpQD4SdFcugkRQYzhmfI4KeV4Qpnn2sKPdo+kmsgRQ==", + "version": "14.2.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.2.0.tgz", + "integrity": "sha512-De72GdQZzNTUBBChsXueQUnPKDkg/5A5zp7pFDuQAj5UFoENpiACU0wlCvzpAGnTkj++ihpKwKyYewn/XNUbKw==", "license": "MIT", "dependencies": { - "tr46": "^5.0.0", + "tr46": "^5.1.0", "webidl-conversions": "^7.0.0" }, "engines": { @@ -10318,14 +10318,14 @@ } }, "node_modules/mongoose": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.12.1.tgz", - "integrity": "sha512-UW22y8QFVYmrb36hm8cGncfn4ARc/XsYWQwRTaj0gxtQk1rDuhzDO1eBantS+hTTatfAIS96LlRCJrcNHvW5+Q==", + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.13.0.tgz", + "integrity": "sha512-e/iYV1mPeOkg+SWAMHzt3t42/EZyER3OB1H2pjP9C3vQ+Qb5DMeV9Kb+YCUycKgScA3fbwL7dKG4EpinGlg21g==", "license": "MIT", "dependencies": { "bson": "^6.10.3", "kareem": "2.6.3", - "mongodb": "~6.14.0", + "mongodb": "~6.15.0", "mpath": "0.9.0", "mquery": "5.0.0", "ms": "2.1.3", @@ -10401,9 +10401,9 @@ } }, "node_modules/mongoose/node_modules/mongodb": { - "version": "6.14.2", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.14.2.tgz", - "integrity": "sha512-kMEHNo0F3P6QKDq17zcDuPeaywK/YaJVCEQRzPF3TOM/Bl9MFg64YE5Tu7ifj37qZJMhwU1tl2Ioivws5gRG5Q==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.15.0.tgz", + "integrity": "sha512-ifBhQ0rRzHDzqp9jAQP6OwHSH7dbYIQjD3SbJs9YYk9AikKEettW/9s/tbSFDTpXcRbF+u1aLrhHxDFaYtZpFQ==", "license": "Apache-2.0", "dependencies": { "@mongodb-js/saslprep": "^1.1.9", diff --git a/package.json b/package.json index 94738a27d..e22ec0714 100644 --- a/package.json +++ b/package.json @@ -115,7 +115,7 @@ "marked-subsuper-text": "^1.0.3", "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.30.1", - "mongoose": "^8.12.1", + "mongoose": "^8.13.0", "nanoid": "5.1.5", "nconf": "^0.12.1", "react": "^18.3.1", From 8fc1919d7ccfa2f85616bb911d65f9dc3116ac34 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Mar 2025 15:40:50 +0000 Subject: [PATCH 38/45] Bump @babel/plugin-transform-runtime from 7.26.9 to 7.26.10 Bumps [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-runtime) from 7.26.9 to 7.26.10. - [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.10/packages/babel-plugin-transform-runtime) --- updated-dependencies: - dependency-name: "@babel/plugin-transform-runtime" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 34 +++++++++++----------------------- package.json | 2 +- 2 files changed, 12 insertions(+), 24 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3ebb25945..901e6b1f0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "license": "MIT", "dependencies": { "@babel/core": "^7.26.9", - "@babel/plugin-transform-runtime": "^7.26.9", + "@babel/plugin-transform-runtime": "^7.26.10", "@babel/preset-env": "^7.26.9", "@babel/preset-react": "^7.26.3", "@googleapis/drive": "^11.0.0", @@ -1406,15 +1406,15 @@ } }, "node_modules/@babel/plugin-transform-runtime": { - "version": "7.26.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.26.9.tgz", - "integrity": "sha512-Jf+8y9wXQbbxvVYTM8gO5oEF2POdNji0NMltEkG7FtmzD9PVz7/lxpqSdTvwsjTMU5HIHuDVNf2SOxLkWi+wPQ==", + "version": "7.26.10", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.26.10.tgz", + "integrity": "sha512-NWaL2qG6HRpONTnj4JvDU6th4jYeZOJgu3QhmFTCihib0ermtOJqktA5BduGm3suhhVe9EMP9c9+mfJ/I9slqw==", "license": "MIT", "dependencies": { "@babel/helper-module-imports": "^7.25.9", "@babel/helper-plugin-utils": "^7.26.5", "babel-plugin-polyfill-corejs2": "^0.4.10", - "babel-plugin-polyfill-corejs3": "^0.10.6", + "babel-plugin-polyfill-corejs3": "^0.11.0", "babel-plugin-polyfill-regenerator": "^0.6.1", "semver": "^6.3.1" }, @@ -1640,19 +1640,6 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/preset-env/node_modules/babel-plugin-polyfill-corejs3": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.11.1.tgz", - "integrity": "sha512-yGCqvBT4rwMczo28xkH/noxJ6MZ4nJfkVYdoDaC/utLtWrXxv27HVrzAeSbqR8SxDsp46n0YF47EbHoixy6rXQ==", - "license": "MIT", - "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.6.3", - "core-js-compat": "^3.40.0" - }, - "peerDependencies": { - "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" - } - }, "node_modules/@babel/preset-modules": { "version": "0.1.6-no-external-plugins", "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.6-no-external-plugins.tgz", @@ -3704,12 +3691,13 @@ } }, "node_modules/babel-plugin-polyfill-corejs3": { - "version": "0.10.6", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.10.6.tgz", - "integrity": "sha512-b37+KR2i/khY5sKmWNVQAnitvquQbNdWy6lJdsr0kmquCKEEUgMKK4SboVM3HtfnZilfjr4MMQ7vY58FVWDtIA==", + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.11.1.tgz", + "integrity": "sha512-yGCqvBT4rwMczo28xkH/noxJ6MZ4nJfkVYdoDaC/utLtWrXxv27HVrzAeSbqR8SxDsp46n0YF47EbHoixy6rXQ==", + "license": "MIT", "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.6.2", - "core-js-compat": "^3.38.0" + "@babel/helper-define-polyfill-provider": "^0.6.3", + "core-js-compat": "^3.40.0" }, "peerDependencies": { "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" diff --git a/package.json b/package.json index e22ec0714..c95ba6470 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,7 @@ }, "dependencies": { "@babel/core": "^7.26.9", - "@babel/plugin-transform-runtime": "^7.26.9", + "@babel/plugin-transform-runtime": "^7.26.10", "@babel/preset-env": "^7.26.9", "@babel/preset-react": "^7.26.3", "@googleapis/drive": "^11.0.0", From 1c1808378b0393a510e8bb8fd27c6de48abeb2b7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Mar 2025 15:47:08 +0000 Subject: [PATCH 39/45] Bump @babel/core from 7.26.9 to 7.26.10 Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.26.9 to 7.26.10. - [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.10/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 | 66 +++++++++++++++++++++++------------------------ package.json | 2 +- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/package-lock.json b/package-lock.json index 901e6b1f0..4a55cb477 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "hasInstallScript": true, "license": "MIT", "dependencies": { - "@babel/core": "^7.26.9", + "@babel/core": "^7.26.10", "@babel/plugin-transform-runtime": "^7.26.10", "@babel/preset-env": "^7.26.9", "@babel/preset-react": "^7.26.3", @@ -110,21 +110,21 @@ } }, "node_modules/@babel/core": { - "version": "7.26.9", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.9.tgz", - "integrity": "sha512-lWBYIrF7qK5+GjY5Uy+/hEgp8OJWOD/rpy74GplYRhEauvbHDeFB8t5hPOZxCZ0Oxf4Cc36tK51/l3ymJysrKw==", + "version": "7.26.10", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.10.tgz", + "integrity": "sha512-vMqyb7XCDMPvJFFOaT9kxtiRh42GwlZEg1/uIgtZshS5a/8OaduUfCi7kynKgc3Tw/6Uo2D+db9qBttghhmxwQ==", "license": "MIT", "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.26.2", - "@babel/generator": "^7.26.9", + "@babel/generator": "^7.26.10", "@babel/helper-compilation-targets": "^7.26.5", "@babel/helper-module-transforms": "^7.26.0", - "@babel/helpers": "^7.26.9", - "@babel/parser": "^7.26.9", + "@babel/helpers": "^7.26.10", + "@babel/parser": "^7.26.10", "@babel/template": "^7.26.9", - "@babel/traverse": "^7.26.9", - "@babel/types": "^7.26.9", + "@babel/traverse": "^7.26.10", + "@babel/types": "^7.26.10", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -140,13 +140,13 @@ } }, "node_modules/@babel/generator": { - "version": "7.26.9", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.9.tgz", - "integrity": "sha512-kEWdzjOAUMW4hAyrzJ0ZaTOu9OmpyDIQicIh0zg0EEcEkYXZb2TjtBhnHi2ViX7PKwZqF4xwqfAm299/QMP3lg==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.27.0.tgz", + "integrity": "sha512-VybsKvpiN1gU1sdMZIp7FcqphVVKEwcuj02x73uvcHE0PTihx1nlBcowYWhDwjpoAXRv43+gDzyggGnn1XZhVw==", "license": "MIT", "dependencies": { - "@babel/parser": "^7.26.9", - "@babel/types": "^7.26.9", + "@babel/parser": "^7.27.0", + "@babel/types": "^7.27.0", "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^3.0.2" @@ -389,12 +389,12 @@ } }, "node_modules/@babel/parser": { - "version": "7.26.9", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.9.tgz", - "integrity": "sha512-81NWa1njQblgZbQHxWHpxxCzNsa3ZwvFqpUg7P+NNUU6f3UU2jBEg4OlF/J6rl8+PQGh1q6/zWScd001YwcA5A==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.0.tgz", + "integrity": "sha512-iaepho73/2Pz7w2eMS0Q5f83+0RKI7i4xmiYeBmDzfRVbQtTOG7Ts0S4HzJVsTMGI9keU8rNfuZr8DKfSt7Yyg==", "license": "MIT", "dependencies": { - "@babel/types": "^7.26.9" + "@babel/types": "^7.27.0" }, "bin": { "parser": "bin/babel-parser.js" @@ -1687,30 +1687,30 @@ } }, "node_modules/@babel/template": { - "version": "7.26.9", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.26.9.tgz", - "integrity": "sha512-qyRplbeIpNZhmzOysF/wFMuP9sctmh2cFzRAZOn1YapxBsE1i9bJIY586R/WBLfLcmcBlM8ROBiQURnnNy+zfA==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.0.tgz", + "integrity": "sha512-2ncevenBqXI6qRMukPlXwHKHchC7RyMuu4xv5JBXRfOGVcTy1mXCD12qrp7Jsoxll1EV3+9sE4GugBVRjT2jFA==", "license": "MIT", "dependencies": { "@babel/code-frame": "^7.26.2", - "@babel/parser": "^7.26.9", - "@babel/types": "^7.26.9" + "@babel/parser": "^7.27.0", + "@babel/types": "^7.27.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.26.9", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.9.tgz", - "integrity": "sha512-ZYW7L+pL8ahU5fXmNbPF+iZFHCv5scFak7MZ9bwaRPLUhHh7QQEMjZUg0HevihoqCM5iSYHN61EyCoZvqC+bxg==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.27.0.tgz", + "integrity": "sha512-19lYZFzYVQkkHkl4Cy4WrAVcqBkgvV2YM2TU3xG6DIwO7O3ecbDPfW3yM3bjAGcqcQHi+CCtjMR3dIEHxsd6bA==", "license": "MIT", "dependencies": { "@babel/code-frame": "^7.26.2", - "@babel/generator": "^7.26.9", - "@babel/parser": "^7.26.9", - "@babel/template": "^7.26.9", - "@babel/types": "^7.26.9", + "@babel/generator": "^7.27.0", + "@babel/parser": "^7.27.0", + "@babel/template": "^7.27.0", + "@babel/types": "^7.27.0", "debug": "^4.3.1", "globals": "^11.1.0" }, @@ -1728,9 +1728,9 @@ } }, "node_modules/@babel/types": { - "version": "7.26.10", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.10.tgz", - "integrity": "sha512-emqcG3vHrpxUKTrxcblR36dcrcoRDvKmnL/dCL6ZsHaShW80qxCAcNhzQZrpeM765VzEos+xOi4s+r4IXzTwdQ==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.0.tgz", + "integrity": "sha512-H45s8fVLYjbhFH62dIJ3WtmJ6RSPt/3DRO0ZcT2SUiYiQyz3BLVb9ADEnLl91m74aQPS3AzzeajZHYOalWe3bg==", "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.25.9", diff --git a/package.json b/package.json index c95ba6470..3a68d15d7 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ ] }, "dependencies": { - "@babel/core": "^7.26.9", + "@babel/core": "^7.26.10", "@babel/plugin-transform-runtime": "^7.26.10", "@babel/preset-env": "^7.26.9", "@babel/preset-react": "^7.26.3", From 225fcef291faf1d7737754c09c47cb0faaebfa42 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Wed, 26 Mar 2025 18:03:22 -0400 Subject: [PATCH 40/45] up Marked to v14.1.4 --- 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 4a55cb477..87d573e8e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,7 +33,7 @@ "jwt-simple": "^0.5.6", "less": "^3.13.1", "lodash": "^4.17.21", - "marked": "14.0.0", + "marked": "14.1.4", "marked-emoji": "^2.0.0", "marked-extended-tables": "^2.0.1", "marked-gfm-heading-id": "^4.0.1", @@ -9892,9 +9892,9 @@ } }, "node_modules/marked": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-14.0.0.tgz", - "integrity": "sha512-uIj4+faQ+MgHgwUW1l2PsPglZLOLOT1uErt06dAPtx2kjteLAkbsd/0FiYg/MGS+i7ZKLb7w2WClxHkzOOuryQ==", + "version": "14.1.4", + "resolved": "https://registry.npmjs.org/marked/-/marked-14.1.4.tgz", + "integrity": "sha512-vkVZ8ONmUdPnjCKc5uTRvmkRbx4EAi2OkTOXmfTDhZz3OFqMNBM1oTTWwTr4HY4uAEojhzPf+Fy8F1DWa3Sndg==", "license": "MIT", "bin": { "marked": "bin/marked.js" diff --git a/package.json b/package.json index 3a68d15d7..9e2a8450d 100644 --- a/package.json +++ b/package.json @@ -107,7 +107,7 @@ "jwt-simple": "^0.5.6", "less": "^3.13.1", "lodash": "^4.17.21", - "marked": "14.0.0", + "marked": "14.1.4", "marked-emoji": "^2.0.0", "marked-extended-tables": "^2.0.1", "marked-gfm-heading-id": "^4.0.1", From 6ec37d3fa46451e8fbe2a5d155d60a06d88ad82a Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Thu, 27 Mar 2025 12:03:00 +1300 Subject: [PATCH 41/45] Rename HB_PageNumber to HB_pageNumber --- shared/naturalcrit/markdown.js | 4 ++-- themes/V3/Blank/snippets.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 251c8d3bc..a0a5f3a00 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -951,9 +951,9 @@ let globalPageNumber = 0; const Markdown = { marked : Marked, render : (rawBrewText, pageNumber=0)=>{ - const lastPageNumber = pageNumber > 0 ? globalVarsList[pageNumber - 1].HB_PageNumber.content : 0; + const lastPageNumber = pageNumber > 0 ? globalVarsList[pageNumber - 1].HB_pageNumber.content : 0; globalVarsList[pageNumber] = { //Reset global links for current page, to ensure values are parsed in order - 'HB_PageNumber' : { //Add document variables for this page + 'HB_pageNumber' : { //Add document variables for this page content : !isNaN(Number(lastPageNumber)) ? Number(lastPageNumber) + 1 : lastPageNumber, resolved : true } diff --git a/themes/V3/Blank/snippets.js b/themes/V3/Blank/snippets.js index 65af13aef..c5198fd87 100644 --- a/themes/V3/Blank/snippets.js +++ b/themes/V3/Blank/snippets.js @@ -41,7 +41,7 @@ module.exports = [ { name : 'Variable Auto Page Number', icon : 'fas fa-sort-numeric-down', - gen : '{{pageNumber $[HB_PageNumber]}}\n' + gen : '{{pageNumber $[HB_pageNumber]}}\n' }, { name : 'Skip Page Number Increment this Page', From 65001c44e6690b4afc35a0c12cf81b11ee5ecfff Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Thu, 27 Mar 2025 12:03:22 +1300 Subject: [PATCH 42/45] Add tests for variable page numbering --- tests/markdown/variables.test.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/tests/markdown/variables.test.js b/tests/markdown/variables.test.js index bba1341e1..1f9d8b55a 100644 --- a/tests/markdown/variables.test.js +++ b/tests/markdown/variables.test.js @@ -370,6 +370,22 @@ describe('Cross-page variables', ()=>{ const rendered = renderAllPages([source0, source1]).join('\n\\page\n').trimReturns(); expect(rendered, `Input:\n${[source0, source1].join('\n\\page\n')}`, { showPrefix: false }).toBe('

two

one

\\page

two

'); }); + + it('Page numbering across pages', function() { + const source0 = `$[HB_pageNumber]\n\n`; + const source1 = `$[HB_pageNumber]\n\n`; + renderAllPages([source0, source1]).join('\n\\page\n').trimReturns(); //Requires one full render of document before hoisting is picked up + const rendered = renderAllPages([source0, source1]).join('\n\\page\n').trimReturns(); + expect(rendered, `Input:\n${[source0, source1].join('\n\\page\n')}`, { showPrefix: false }).toBe('

1

\\page

2

'); + }); + + it('Page numbering across pages - custom page number', function() { + const source0 = `[HB_pageNumber]:100\n\n$[HB_pageNumber]\n\n`; + const source1 = `$[HB_pageNumber]\n\n`; + renderAllPages([source0, source1]).join('\n\\page\n').trimReturns(); //Requires one full render of document before hoisting is picked up + const rendered = renderAllPages([source0, source1]).join('\n\\page\n').trimReturns(); + expect(rendered, `Input:\n${[source0, source1].join('\n\\page\n')}`, { showPrefix: false }).toBe('

100

\\page

101

'); + }); }); describe('Math function parameter handling', ()=>{ @@ -410,7 +426,7 @@ describe('Regression Tests', ()=>{ const rendered = Markdown.render(source).trimReturns(); expect(rendered).toBe('
title 1title 2title 3title 4
fooIpsum))
'); }); - + it('Handle Extra spaces in image alt-text 1', function(){ const source='![ where is my image??](http://i.imgur.com/hMna6G0.png)'; const rendered = Markdown.render(source).trimReturns(); @@ -433,7 +449,7 @@ describe('Regression Tests', ()=>{ const source='![where is my image??](http://i.imgur.com/hMna6G0.png){height=20%,width=20%}'; const rendered = Markdown.render(source).trimReturns(); expect(rendered).toBe('

\"where

'); - }); + }); }); describe('Custom Math Function Tests', ()=>{ From 848c68689d2741e23a4657bd3d4941fe631e2b32 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Thu, 27 Mar 2025 12:09:58 +1300 Subject: [PATCH 43/45] Add NaN custom pageNumber test --- tests/markdown/variables.test.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/markdown/variables.test.js b/tests/markdown/variables.test.js index 1f9d8b55a..ea98fe56c 100644 --- a/tests/markdown/variables.test.js +++ b/tests/markdown/variables.test.js @@ -371,7 +371,7 @@ describe('Cross-page variables', ()=>{ expect(rendered, `Input:\n${[source0, source1].join('\n\\page\n')}`, { showPrefix: false }).toBe('

two

one

\\page

two

'); }); - it('Page numbering across pages', function() { + it('Page numbering across pages : default', function() { const source0 = `$[HB_pageNumber]\n\n`; const source1 = `$[HB_pageNumber]\n\n`; renderAllPages([source0, source1]).join('\n\\page\n').trimReturns(); //Requires one full render of document before hoisting is picked up @@ -379,13 +379,21 @@ describe('Cross-page variables', ()=>{ expect(rendered, `Input:\n${[source0, source1].join('\n\\page\n')}`, { showPrefix: false }).toBe('

1

\\page

2

'); }); - it('Page numbering across pages - custom page number', function() { + it('Page numbering across pages : custom page number (Number)', function() { const source0 = `[HB_pageNumber]:100\n\n$[HB_pageNumber]\n\n`; const source1 = `$[HB_pageNumber]\n\n`; renderAllPages([source0, source1]).join('\n\\page\n').trimReturns(); //Requires one full render of document before hoisting is picked up const rendered = renderAllPages([source0, source1]).join('\n\\page\n').trimReturns(); expect(rendered, `Input:\n${[source0, source1].join('\n\\page\n')}`, { showPrefix: false }).toBe('

100

\\page

101

'); }); + + it('Page numbering across pages : custom page number (NaN)', function() { + const source0 = `[HB_pageNumber]:a\n\n$[HB_pageNumber]\n\n`; + const source1 = `$[HB_pageNumber]\n\n`; + renderAllPages([source0, source1]).join('\n\\page\n').trimReturns(); //Requires one full render of document before hoisting is picked up + const rendered = renderAllPages([source0, source1]).join('\n\\page\n').trimReturns(); + expect(rendered, `Input:\n${[source0, source1].join('\n\\page\n')}`, { showPrefix: false }).toBe('

a

\\page

a

'); + }); }); describe('Math function parameter handling', ()=>{ From eac87b65d8b8804bfd50d232f699919b7ea2c637 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Wed, 26 Mar 2025 19:26:20 -0400 Subject: [PATCH 44/45] Update tests and custom link renderer v15 changes where html gets escaped and escapes plain text more consistently. Needed to update tests to match. --- package-lock.json | 8 ++++---- package.json | 2 +- shared/naturalcrit/markdown.js | 2 +- tests/markdown/non-breaking-spaces.test.js | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 87d573e8e..9ce7a789b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,7 +33,7 @@ "jwt-simple": "^0.5.6", "less": "^3.13.1", "lodash": "^4.17.21", - "marked": "14.1.4", + "marked": "15.0.0", "marked-emoji": "^2.0.0", "marked-extended-tables": "^2.0.1", "marked-gfm-heading-id": "^4.0.1", @@ -9892,9 +9892,9 @@ } }, "node_modules/marked": { - "version": "14.1.4", - "resolved": "https://registry.npmjs.org/marked/-/marked-14.1.4.tgz", - "integrity": "sha512-vkVZ8ONmUdPnjCKc5uTRvmkRbx4EAi2OkTOXmfTDhZz3OFqMNBM1oTTWwTr4HY4uAEojhzPf+Fy8F1DWa3Sndg==", + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-15.0.0.tgz", + "integrity": "sha512-0mouKmBROJv/WSHJBPZZyYofUgawMChnD5je/g+aOBXsHDjb/IsnTQj7mnhQZu+qPJmRQ0ecX3mLGEUm3BgwYA==", "license": "MIT", "bin": { "marked": "bin/marked.js" diff --git a/package.json b/package.json index 9e2a8450d..36471950a 100644 --- a/package.json +++ b/package.json @@ -107,7 +107,7 @@ "jwt-simple": "^0.5.6", "less": "^3.13.1", "lodash": "^4.17.21", - "marked": "14.1.4", + "marked": "15.0.0", "marked-emoji": "^2.0.0", "marked-extended-tables": "^2.0.1", "marked-gfm-heading-id": "^4.0.1", diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 0b90c051c..485aa281f 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -104,7 +104,7 @@ renderer.link = function (token) { } let out = `{ test('I am actually a single-line definition list!', function() { const source = 'Term ::> Definition 1\n'; const rendered = Markdown.render(source).trim(); - expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`
Term
> Definition 1
\n
`); + expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`
Term
> Definition 1
\n
`); }); test('I am actually a definition list!', function() { const source = 'Term\n::> Definition 1\n'; const rendered = Markdown.render(source).trim(); - expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`
Term
\n
> Definition 1
`); + expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`
Term
\n
> Definition 1
`); }); test('I am actually a two-term definition list!', function() { const source = 'Term\n::> Definition 1\n::>> Definition 2'; const rendered = Markdown.render(source).trim(); - expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`
Term
\n
> Definition 1
\n
>> Definition 2
`); + expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`
Term
\n
> Definition 1
\n
>> Definition 2
`); }); }); From 8729407da6a8fe39051bdc159e6828b8061e89f1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 27 Mar 2025 03:39:34 +0000 Subject: [PATCH 45/45] Bump stylelint from 16.16.0 to 16.17.0 Bumps [stylelint](https://github.com/stylelint/stylelint) from 16.16.0 to 16.17.0. - [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.16.0...16.17.0) --- updated-dependencies: - dependency-name: stylelint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9ce7a789b..eccc537ff 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.16.0", + "stylelint": "^16.17.0", "stylelint-config-recess-order": "^6.0.0", "stylelint-config-recommended": "^15.0.0", "supertest": "^7.1.0" @@ -13127,9 +13127,9 @@ "license": "ISC" }, "node_modules/stylelint": { - "version": "16.16.0", - "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-16.16.0.tgz", - "integrity": "sha512-40X5UOb/0CEFnZVEHyN260HlSSUxPES+arrUphOumGWgXERHfwCD0kNBVILgQSij8iliYVwlc0V7M5bcLP9vPg==", + "version": "16.17.0", + "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-16.17.0.tgz", + "integrity": "sha512-I9OwVIWRMqVm2Br5iTbrfSqGRPWQUlvm6oXO1xZuYYu0Gpduy67N8wXOZv15p6E/JdlZiAtQaIoLKZEWk5hrjw==", "dev": true, "funding": [ { diff --git a/package.json b/package.json index 36471950a..94ac51006 100644 --- a/package.json +++ b/package.json @@ -137,7 +137,7 @@ "jest-expect-message": "^1.1.3", "jsdom-global": "^3.0.2", "postcss-less": "^6.0.0", - "stylelint": "^16.16.0", + "stylelint": "^16.17.0", "stylelint-config-recess-order": "^6.0.0", "stylelint-config-recommended": "^15.0.0", "supertest": "^7.1.0"