From 738fc62b8f31f371fc46a71f3cb8199e2b0a3376 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Wed, 27 Sep 2023 18:20:56 +0200 Subject: [PATCH 01/43] initial commit --- shared/naturalcrit/markdown.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 114229887..52b83a03f 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -34,7 +34,7 @@ const mustacheSpans = { start(src) { return src.match(/{{[^{]/)?.index; }, // Hint to Marked.js to stop and check for a match tokenizer(src, tokens) { const completeSpan = /^{{[^\n]*}}/; // Regex for the complete token - const inlineRegex = /{{(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*)*))\1 *|}}/g; + const inlineRegex = /{{(?=((?::(?:"['\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*)*))\1 *|}}/g; const match = completeSpan.exec(src); if(match) { //Find closing delimiter @@ -84,7 +84,7 @@ const mustacheDivs = { start(src) { return src.match(/\n *{{[^{]/m)?.index; }, // Hint to Marked.js to stop and check for a match tokenizer(src, tokens) { const completeBlock = /^ *{{[^\n}]* *\n.*\n *}}/s; // Regex for the complete token - const blockRegex = /^ *{{(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*)*))\1 *$|^ *}}$/gm; + const blockRegex = /^ *{{(?=((?::(?:"['\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*)*))\1 *$|^ *}}$/gm; const match = completeBlock.exec(src); if(match) { //Find closing delimiter @@ -132,7 +132,7 @@ const mustacheInjectInline = { level : 'inline', start(src) { return src.match(/ *{[^{\n]/)?.index; }, // Hint to Marked.js to stop and check for a match tokenizer(src, tokens) { - const inlineRegex = /^ *{(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*)*))\1}/g; + const inlineRegex = /^ *{(?=((?::(?:"['\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*)*))\1}/g; const match = inlineRegex.exec(src); if(match) { const lastToken = tokens[tokens.length - 1]; @@ -167,7 +167,7 @@ const mustacheInjectBlock = { level : 'block', start(src) { return src.match(/\n *{[^{\n]/m)?.index; }, // Hint to Marked.js to stop and check for a match tokenizer(src, tokens) { - const inlineRegex = /^ *{(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*)*))\1}/ym; + const inlineRegex = /^ *{(?=((?::(?:"['\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*)*))\1}/ym; const match = inlineRegex.exec(src); if(match) { const lastToken = tokens[tokens.length - 1]; From b557144f637f95aa12291f9a4e497da00e089ff4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Wed, 27 Sep 2023 20:11:00 +0200 Subject: [PATCH 02/43] extra tests --- tests/markdown/mustache-syntax.test.js | 34 +++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/tests/markdown/mustache-syntax.test.js b/tests/markdown/mustache-syntax.test.js index d9e1ce6f9..5861b4c7b 100644 --- a/tests/markdown/mustache-syntax.test.js +++ b/tests/markdown/mustache-syntax.test.js @@ -112,18 +112,29 @@ describe('Inline: When using the Inline syntax {{ }}', ()=>{ }); - it.failing('Renders a mustache span with text with quotes and css property which contains quotes', function() { + it.failing('Renders a mustache span with text with quotes and css property which contains double quotes', function() { const source = '{{font-family:"trebuchet ms" text "with quotes"}}'; const rendered = Markdown.render(source); // FIXME: adds extra \s after class names expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('text “with quotes”'); }); + + it.failing('Renders a mustache span with text with quotes and css property which contains double and simple quotes', function() { + const source = `{{--stringVariable:"'string'" text "with quotes"}}`; + const rendered = Markdown.render(source); + // FIXME: adds extra \s after class names + expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`text “with quotes”`); + }); + + it('Renders a mustache span with text, id, class and a couple of css properties', function() { const source = '{{pen,#author,color:orange,font-family:"trebuchet ms" text}}'; const rendered = Markdown.render(source); expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('text'); }); + + }); // BLOCK SYNTAX @@ -191,6 +202,15 @@ describe(`Block: When using the Block syntax {{tags\\ntext\\n}}`, ()=>{ expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

Sample text.

`); }); + it.failing('Renders a div with a style that has a string variable, and text', function() { + const source = dedent`{{--stringVariable:"'string'" + Sample text. + }}`; + const rendered = Markdown.render(source).trimReturns(); + // FIXME: adds two extra \s before closing `>` in opening tag + expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

Sample text.

`); + }); + it.failing('Renders a div with a class, style and text', function() { const source = dedent`{{cat,color:red Sample text. @@ -241,6 +261,12 @@ describe('Injection: When an injection tag follows an element', ()=>{ expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('text'); }); + it.failing('Renders a span "text" with injected style using a string variable', function() { + const source = `{{ text}}{--stringVariable:"'string'"}`; + const rendered = Markdown.render(source); + expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`text`); + }); + it.failing('Renders a span "text" with two injected styles', function() { const source = '{{ text}}{color:red,background:blue}'; const rendered = Markdown.render(source); @@ -291,13 +317,13 @@ describe('Injection: When an injection tag follows an element', ()=>{ expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('

text

'); }); - it.failing('renders a div "text" with two injected styles', function() { + it.failing('renders a div "text" with two injected styles,included quotes', function() { const source = dedent`{{ text }} - {color:red,background:blue}`; + {color:red,--stringVariable:"'string'"}`; const rendered = Markdown.render(source).trimReturns(); - expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('

text

'); + expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

text

`); }); it.failing('renders an h2 header "text" with injected class name', function() { From b7d7f4f2a056a43cc6fbecea7d787bfa08a9cc99 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sun, 1 Oct 2023 13:03:37 +1300 Subject: [PATCH 03/43] Add optimized NC logo --- themes/assets/naturalCritLogo.svg | 1 + 1 file changed, 1 insertion(+) create mode 100644 themes/assets/naturalCritLogo.svg diff --git a/themes/assets/naturalCritLogo.svg b/themes/assets/naturalCritLogo.svg new file mode 100644 index 000000000..88faa64fa --- /dev/null +++ b/themes/assets/naturalCritLogo.svg @@ -0,0 +1 @@ + \ No newline at end of file From 08dbd5638db41af780bcf4a88795544cff057e87 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sun, 1 Oct 2023 14:11:07 +1300 Subject: [PATCH 04/43] New file was unnecessary --- themes/assets/naturalCritLogo.svg | 1 - 1 file changed, 1 deletion(-) delete mode 100644 themes/assets/naturalCritLogo.svg diff --git a/themes/assets/naturalCritLogo.svg b/themes/assets/naturalCritLogo.svg deleted file mode 100644 index 88faa64fa..000000000 --- a/themes/assets/naturalCritLogo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file From 7ee0e914e6e0944f03eeb6274cd66102a097ad75 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sun, 1 Oct 2023 14:13:01 +1300 Subject: [PATCH 05/43] Add Credits styling to 5ePHB theme --- themes/V3/5ePHB/style.less | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index f37dfae2b..efcd48c84 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -1047,3 +1047,28 @@ body { counter-reset : phb-page-numbers; } } } } + +//***************************** +//* CREDITS +//*****************************/ +.page .homebreweryCredits { + font-family: "NodestoCapsWide"; + font-size: .4cm; + line-height: 1em; + color: #FFFFFF; + text-align: center; + text-indent: 0; + letter-spacing: .08em; + } + .page .homebreweryCredits .homebreweryIcon { + margin: 10px auto; + display: block; + height: 75px; + mask: url(/assets/naturalCritLogoWhite.svg) center / contain no-repeat; + -webkit-mask: url(/assets/naturalCritLogoWhite.svg) center / contain no-repeat; + background-color: red; + } + .page .homebreweryCredits .homebreweryIcon.gold { + background-image: linear-gradient(to top left, brown 22.5%, gold 40%, white 60%, gold 67.5%, brown 82.5%); + } + \ No newline at end of file From b8d8c1bebb7bc0f94b8872189bc0e3ca640d7478 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sun, 1 Oct 2023 14:15:58 +1300 Subject: [PATCH 06/43] Add HB Credit snippet --- themes/V3/5ePHB/snippets.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/themes/V3/5ePHB/snippets.js b/themes/V3/5ePHB/snippets.js index c0933d70d..91cbe07b8 100644 --- a/themes/V3/5ePHB/snippets.js +++ b/themes/V3/5ePHB/snippets.js @@ -212,6 +212,21 @@ module.exports = [ }} \n`; }, + }, + { + name : 'Homebrewery Credit', + icon : 'fas fa-dice-d20', + gen : function(){ + return dedent` + {{homebreweryCredits + Made With + + {{homebreweryIcon,gold}} + + Homebrewery.Naturalcrit.com + }} + \n`; + }, } ] }, From 7f6e90fee32f013be048e9a8489a2a8e29443239 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sun, 1 Oct 2023 15:29:46 +1300 Subject: [PATCH 07/43] Capitalize C in NaturalCrit.com --- themes/V3/5ePHB/snippets.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/V3/5ePHB/snippets.js b/themes/V3/5ePHB/snippets.js index 91cbe07b8..a56d8e979 100644 --- a/themes/V3/5ePHB/snippets.js +++ b/themes/V3/5ePHB/snippets.js @@ -223,7 +223,7 @@ module.exports = [ {{homebreweryIcon,gold}} - Homebrewery.Naturalcrit.com + Homebrewery.NaturalCrit.com }} \n`; }, From 90917bb84c34e2b20c27f9388016e6b66f20e440 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sun, 1 Oct 2023 19:52:17 +1300 Subject: [PATCH 08/43] Change the text to include URL link --- themes/V3/5ePHB/snippets.js | 3 ++- themes/V3/5ePHB/style.less | 15 +++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/themes/V3/5ePHB/snippets.js b/themes/V3/5ePHB/snippets.js index a56d8e979..9676647ca 100644 --- a/themes/V3/5ePHB/snippets.js +++ b/themes/V3/5ePHB/snippets.js @@ -223,7 +223,8 @@ module.exports = [ {{homebreweryIcon,gold}} - Homebrewery.NaturalCrit.com + The Homebrewery + [Homebrewery.NaturalCrit.com](https://homebrewery.naturalcrit.com) }} \n`; }, diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index efcd48c84..602c18284 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -1055,20 +1055,23 @@ body { counter-reset : phb-page-numbers; } font-family: "NodestoCapsWide"; font-size: .4cm; line-height: 1em; - color: #FFFFFF; text-align: center; text-indent: 0; letter-spacing: .08em; - } - .page .homebreweryCredits .homebreweryIcon { +} +.page .homebreweryCredits a { + color: inherit; + text-decoration: none; +} +.page .homebreweryCredits .homebreweryIcon { margin: 10px auto; display: block; height: 75px; mask: url(/assets/naturalCritLogoWhite.svg) center / contain no-repeat; -webkit-mask: url(/assets/naturalCritLogoWhite.svg) center / contain no-repeat; background-color: red; - } - .page .homebreweryCredits .homebreweryIcon.gold { +} +.page .homebreweryCredits .homebreweryIcon.gold { background-image: linear-gradient(to top left, brown 22.5%, gold 40%, white 60%, gold 67.5%, brown 82.5%); - } +} \ No newline at end of file From 1e9b71080be8a3913590a9a48ac9b8a1b76915fb Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sun, 1 Oct 2023 19:58:57 +1300 Subject: [PATCH 09/43] Add underline on hover to link in credit --- themes/V3/5ePHB/style.less | 3 +++ 1 file changed, 3 insertions(+) diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index 602c18284..7fc5eadd5 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -1063,6 +1063,9 @@ body { counter-reset : phb-page-numbers; } color: inherit; text-decoration: none; } +.page .homebreweryCredits a:hover { + text-decoration: underline; +} .page .homebreweryCredits .homebreweryIcon { margin: 10px auto; display: block; From cc3a42402a2194865db598f55213bd19c5508f3f Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sun, 1 Oct 2023 20:11:05 +1300 Subject: [PATCH 10/43] Move Credits snippet to Blank --- themes/V3/5ePHB/snippets.js | 16 ---------------- themes/V3/5ePHB/style.less | 31 ------------------------------- themes/V3/Blank/snippets.js | 16 ++++++++++++++++ themes/V3/Blank/style.less | 31 +++++++++++++++++++++++++++++++ 4 files changed, 47 insertions(+), 47 deletions(-) diff --git a/themes/V3/5ePHB/snippets.js b/themes/V3/5ePHB/snippets.js index 9676647ca..c0933d70d 100644 --- a/themes/V3/5ePHB/snippets.js +++ b/themes/V3/5ePHB/snippets.js @@ -212,22 +212,6 @@ module.exports = [ }} \n`; }, - }, - { - name : 'Homebrewery Credit', - icon : 'fas fa-dice-d20', - gen : function(){ - return dedent` - {{homebreweryCredits - Made With - - {{homebreweryIcon,gold}} - - The Homebrewery - [Homebrewery.NaturalCrit.com](https://homebrewery.naturalcrit.com) - }} - \n`; - }, } ] }, diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index 7fc5eadd5..f37dfae2b 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -1047,34 +1047,3 @@ body { counter-reset : phb-page-numbers; } } } } - -//***************************** -//* CREDITS -//*****************************/ -.page .homebreweryCredits { - font-family: "NodestoCapsWide"; - font-size: .4cm; - line-height: 1em; - text-align: center; - text-indent: 0; - letter-spacing: .08em; -} -.page .homebreweryCredits a { - color: inherit; - text-decoration: none; -} -.page .homebreweryCredits a:hover { - text-decoration: underline; -} -.page .homebreweryCredits .homebreweryIcon { - margin: 10px auto; - display: block; - height: 75px; - mask: url(/assets/naturalCritLogoWhite.svg) center / contain no-repeat; - -webkit-mask: url(/assets/naturalCritLogoWhite.svg) center / contain no-repeat; - background-color: red; -} -.page .homebreweryCredits .homebreweryIcon.gold { - background-image: linear-gradient(to top left, brown 22.5%, gold 40%, white 60%, gold 67.5%, brown 82.5%); -} - \ No newline at end of file diff --git a/themes/V3/Blank/snippets.js b/themes/V3/Blank/snippets.js index 72372c297..a12152628 100644 --- a/themes/V3/Blank/snippets.js +++ b/themes/V3/Blank/snippets.js @@ -111,6 +111,22 @@ module.exports = [ icon : 'fas fa-code', gen : '' }, + { + name : 'Homebrewery Credit', + icon : 'fas fa-dice-d20', + gen : function(){ + return dedent` + {{homebreweryCredits + Made With + + {{homebreweryIcon,gold}} + + The Homebrewery + [Homebrewery.NaturalCrit.com](https://homebrewery.naturalcrit.com) + }} + \n`; + }, + } ] }, { diff --git a/themes/V3/Blank/style.less b/themes/V3/Blank/style.less index f233a2347..14bb69804 100644 --- a/themes/V3/Blank/style.less +++ b/themes/V3/Blank/style.less @@ -463,3 +463,34 @@ body { } } } + +//***************************** +//* CREDITS +//*****************************/ +.page .homebreweryCredits { + font-family: "NodestoCapsWide"; + font-size: .4cm; + line-height: 1em; + text-align: center; + text-indent: 0; + letter-spacing: .08em; +} +.page .homebreweryCredits a { + color: inherit; + text-decoration: none; +} +.page .homebreweryCredits a:hover { + text-decoration: underline; +} +.page .homebreweryCredits .homebreweryIcon { + margin: 10px auto; + display: block; + height: 75px; + mask: url(/assets/naturalCritLogoWhite.svg) center / contain no-repeat; + -webkit-mask: url(/assets/naturalCritLogoWhite.svg) center / contain no-repeat; + background-color: red; +} +.page .homebreweryCredits .homebreweryIcon.gold { + background-image: linear-gradient(to top left, brown 22.5%, gold 40%, white 60%, gold 67.5%, brown 82.5%); +} + \ No newline at end of file From 3628ca837af0efe78bab8235388349c41f3abbe6 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sun, 1 Oct 2023 21:09:32 +1300 Subject: [PATCH 11/43] Shift to LESS nested styling --- themes/V3/Blank/style.less | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/themes/V3/Blank/style.less b/themes/V3/Blank/style.less index 14bb69804..9b2c2b8b4 100644 --- a/themes/V3/Blank/style.less +++ b/themes/V3/Blank/style.less @@ -474,23 +474,22 @@ body { text-align: center; text-indent: 0; letter-spacing: .08em; + a { + color: inherit; + text-decoration: none; + } + a:hover { + text-decoration: underline; + } + .homebreweryIcon { + margin: 10px auto; + display: block; + height: 75px; + mask: url(/assets/naturalCritLogoWhite.svg) center / contain no-repeat; + -webkit-mask: url(/assets/naturalCritLogoWhite.svg) center / contain no-repeat; + background-color: red; + } + .homebreweryIcon.gold { + background-image: linear-gradient(to top left, brown 22.5%, gold 40%, white 60%, gold 67.5%, brown 82.5%); + } } -.page .homebreweryCredits a { - color: inherit; - text-decoration: none; -} -.page .homebreweryCredits a:hover { - text-decoration: underline; -} -.page .homebreweryCredits .homebreweryIcon { - margin: 10px auto; - display: block; - height: 75px; - mask: url(/assets/naturalCritLogoWhite.svg) center / contain no-repeat; - -webkit-mask: url(/assets/naturalCritLogoWhite.svg) center / contain no-repeat; - background-color: red; -} -.page .homebreweryCredits .homebreweryIcon.gold { - background-image: linear-gradient(to top left, brown 22.5%, gold 40%, white 60%, gold 67.5%, brown 82.5%); -} - \ No newline at end of file From a420f202d824a2a535c6f539553fac2e9950ed9b Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sun, 1 Oct 2023 21:10:08 +1300 Subject: [PATCH 12/43] Fix a:hover in LESS styling --- themes/V3/Blank/style.less | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/themes/V3/Blank/style.less b/themes/V3/Blank/style.less index 9b2c2b8b4..c291983e0 100644 --- a/themes/V3/Blank/style.less +++ b/themes/V3/Blank/style.less @@ -477,9 +477,9 @@ body { a { color: inherit; text-decoration: none; - } - a:hover { - text-decoration: underline; + &:hover { + text-decoration: underline; + } } .homebreweryIcon { margin: 10px auto; From 12ca82e6e68ce4ca86b86ffd1b77fe240a138af6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Tue, 3 Oct 2023 08:00:20 +0200 Subject: [PATCH 13/43] Initial commit --- themes/V3/5ePHB/style.less | 117 +------------------------------------ 1 file changed, 2 insertions(+), 115 deletions(-) diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index 90320f9be..644443bd5 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -14,13 +14,6 @@ --HB_Color_Footnotes : #C9AD6A; // Gold } -@page { margin: 0; } -body { - counter-reset : phb-page-numbers; -} -*{ - -webkit-print-color-adjust : exact; -} .useSansSerif(){ font-family : ScalySansRemake; font-size : 0.318cm; @@ -43,8 +36,6 @@ body { } } .useColumns(@multiplier : 1, @fillMode: auto){ - column-count : 2; - column-fill : @fillMode; column-gap : 0.9cm; column-width : 8cm * @multiplier; -webkit-column-count : 2; @@ -54,29 +45,11 @@ body { -webkit-column-gap : 0.9cm; -moz-column-gap : 0.9cm; } -.columnWrapper{ - max-height : 100%; - column-span : all; - columns : inherit; - column-gap : inherit; -} .page{ .useColumns(); - counter-increment : phb-page-numbers; - position : relative; - z-index : 15; - box-sizing : border-box; - overflow : hidden; - height : 279.4mm; - width : 215.9mm; - background-color : var(--HB_Color_Background); background-image : @backgroundImage; - padding : 1.4cm 1.9cm 1.7cm; font-family : BookInsanityRemake; font-size : 0.34cm; - text-rendering : optimizeLegibility; - page-break-before : always; - page-break-after : always; } //***************************** // * BASE @@ -85,7 +58,6 @@ body { .page{ p{ overflow-wrap : break-word; //TODO: MAKE ALL MARGINS TOP-ONLY. USE * + * STYLE SELECTORS - display : block; line-height : 1.25em; &+* { margin-top : 0.325cm; @@ -96,17 +68,11 @@ body { } ul{ margin-bottom : 0.8em; - padding-left : 1.4em; line-height : 1.25em; - list-style-position : outside; - list-style-type : disc; } ol{ margin-bottom : 0.8em; - padding-left : 1.4em; line-height : 1.25em; - list-style-position : outside; - list-style-type : decimal; } //Indents after p or lists p+p, ul+p, ol+p{ @@ -116,22 +82,8 @@ body { z-index : -1; } strong{ - font-weight : bold; letter-spacing : -0.02em; } - em{ - font-style : italic; - } - sup{ - vertical-align : super; - font-size : smaller; - line-height : 0; - } - sub{ - vertical-align : sub; - font-size : smaller; - line-height : 0; - } //***************************** // * HEADERS // *****************************/ @@ -213,13 +165,11 @@ body { // *****************************/ table{ .useSansSerif(); - width : 100%; line-height : 16px; & + * { margin-top : 0.325cm; } thead{ - display: table-row-group; font-weight : 800; th{ vertical-align : bottom; @@ -333,43 +283,11 @@ body { /* Watermark */ .watermark { - display : grid !important; - place-items : center; - justify-content : center; - position : absolute; - top : 0; - left : 0; - width : 100%; - height : 100%; - font-size : 120px; - text-transform : uppercase; color : black; - mix-blend-mode : overlay; - opacity : 30%; - transform : rotate(-45deg); - z-index : 500; - p { - margin-bottom : none; - } } /* Watercolor */ - [class*="watercolor"] { - position : absolute; - width : 2000px; /* dimensions need to be real big so the user can set */ - height : 2000px; /* height or width and the image will maintain aspect ratio */ - -webkit-mask-image : var(--wc); - -webkit-mask-size : contain; - -webkit-mask-repeat : no-repeat; - mask-image : var(--wc); - mask-size : contain; - mask-repeat : no-repeat; - background-size : cover; - background-color : var(--HB_Color_WatercolorStain); /*default color*/ - --wc : @watercolor1; /*default image*/ - z-index : -2; - } - + .watercolor1 { --wc : @watercolor1; } .watercolor2 { --wc : @watercolor2; } .watercolor3 { --wc : @watercolor3; } @@ -530,19 +448,14 @@ body { // * CODE BLOCKS // ************************************/ code{ - font-family : "Courier New", Courier, monospace; - font-size : 0.325; + font-size : 0.325cm; padding : 0px 4px; color : #58180d; background-color : #faf7ea; border-radius : 4px; - white-space : pre-wrap; - overflow-wrap : break-word; } pre code{ - width : 100%; - display : inline-block; border-style : solid; border-width : 1px; border-image : @codeBorderImage 26 stretch; @@ -565,19 +478,6 @@ body { visibility : hidden; margin : 0px; } - .columnSplit { - visibility : hidden; - -webkit-column-break-after : always; - break-after : always; - -moz-column-break-after : always; - } - //Avoid breaking up - blockquote,table{ - z-index : 15; - -webkit-column-break-inside : avoid; - page-break-inside : avoid; - break-inside : avoid; - } //Text indent right after table table+p{ text-indent : 1em; @@ -587,11 +487,6 @@ body { margin-bottom : 0px; margin-left : 1.5em; } - li{ - -webkit-column-break-inside : avoid; - page-break-inside : avoid; - break-inside : avoid; - } } //***************************** // * SPELL LIST @@ -1032,8 +927,6 @@ break-inside : avoid; .page { dl { line-height : 1.25em; - padding-left : 1em; - white-space : pre-line; & + * { margin-top : 0.28cm; } @@ -1045,15 +938,9 @@ break-inside : avoid; margin-top: 0.17cm; } dt { - display : inline; margin-right : 5px; margin-left : -1em; } - dd { - display : inline; - margin-left : 0px; - text-indent : 0px; - } } //***************************** From c58c8777f1d9fc9fe46671471c0fd6b9d5219c2f Mon Sep 17 00:00:00 2001 From: David Bolack Date: Tue, 7 Nov 2023 17:43:24 -0600 Subject: [PATCH 14/43] Add arbitrary tag attr assign. in moustaches This adds the ability to include attribute values for any element that can be altered by a moustache. Form: ``` {attribute=value} example: ![homebrew mug](https://i.imgur.com/hMna6G0.png) {position:absolute,bottom:20px,left:130px,width:220px,a=b and c,g=h} ``` In order to permit spaces, the pattern matches for moustache code had to remove the space character as a delimiter. I believe I have adequate compensated. This should solve #1488 --- client/homebrew/editor/editor.jsx | 6 +++--- shared/naturalcrit/markdown.js | 23 ++++++++++++++++------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/client/homebrew/editor/editor.jsx b/client/homebrew/editor/editor.jsx index b4f1fc824..f2fd81646 100644 --- a/client/homebrew/editor/editor.jsx +++ b/client/homebrew/editor/editor.jsx @@ -162,7 +162,7 @@ const Editor = createClass({ // Highlight injectors {style} if(line.includes('{') && line.includes('}')){ - const regex = /(?:^|[^{\n])({(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*)*))\2})/gm; + const regex = /(?:^|[^{\n])({(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\n\r\t\f]*)*))\2})/gm; let match; while ((match = regex.exec(line)) != null) { codeMirror.markText({ line: lineNumber, ch: line.indexOf(match[1]) }, { line: lineNumber, ch: line.indexOf(match[1]) + match[1].length }, { className: 'injection' }); @@ -170,7 +170,7 @@ const Editor = createClass({ } // Highlight inline spans {{content}} if(line.includes('{{') && line.includes('}}')){ - const regex = /{{(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*)*))\1 *|}}/g; + const regex = /{{(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\n\r\t\f]*)*))\1 *|}}/g; let match; let blockCount = 0; while ((match = regex.exec(line)) != null) { @@ -189,7 +189,7 @@ const Editor = createClass({ // Highlight block divs {{\n Content \n}} let endCh = line.length+1; - const match = line.match(/^ *{{(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*)*))\1 *$|^ *}}$/); + const match = line.match(/^ *{{(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\n\r\t\f]*)*))\1 *$|^ *}}$/); if(match) endCh = match.index+match[0].length; codeMirror.markText({ line: lineNumber, ch: 0 }, { line: lineNumber, ch: endCh }, { className: 'block' }); diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 114229887..0fd4fdd8f 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -132,7 +132,7 @@ const mustacheInjectInline = { level : 'inline', start(src) { return src.match(/ *{[^{\n]/)?.index; }, // Hint to Marked.js to stop and check for a match tokenizer(src, tokens) { - const inlineRegex = /^ *{(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*)*))\1}/g; + const inlineRegex = /^ *{(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\n\r\t\f]*)*))\1}/g; const match = inlineRegex.exec(src); if(match) { const lastToken = tokens[tokens.length - 1]; @@ -167,7 +167,7 @@ const mustacheInjectBlock = { level : 'block', start(src) { return src.match(/\n *{[^{\n]/m)?.index; }, // Hint to Marked.js to stop and check for a match tokenizer(src, tokens) { - const inlineRegex = /^ *{(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*)*))\1}/ym; + const inlineRegex = /^ *{(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\n\r\t\f]*)*))\1}/ym; const match = inlineRegex.exec(src); if(match) { const lastToken = tokens[tokens.length - 1]; @@ -328,14 +328,23 @@ const voidTags = new Set([ const processStyleTags = (string)=>{ //split tags up. quotes can only occur right after colons. //TODO: can we simplify to just split on commas? - const tags = string.match(/(?:[^, ":]+|:(?:"[^"]*"|))+/g); + const tags = string.match(/(?:[^,":]+|:(?:"[^"]*"|))+/g); if(!tags) return '"'; - const id = _.remove(tags, (tag)=>tag.startsWith('#')).map((tag)=>tag.slice(1))[0]; - const classes = _.remove(tags, (tag)=>!tag.includes(':')); - const styles = tags.map((tag)=>tag.replace(/:"?([^"]*)"?/g, ':$1;')); - return `${classes.join(' ')}" ${id ? `id="${id}"` : ''} ${styles.length ? `style="${styles.join(' ')}"` : ''}`; + const id = _.remove(tags, (tag)=>tag.startsWith('#')).map((tag)=>tag.slice(1))[0]; + const classes = _.remove(tags, (tag)=>(!tag.includes(':')) && (!tag.includes('='))); + let attributes = _.remove(tags, (tag)=>(!tag.includes(':')) && (!tag.includes('#'))); + const styles = tags.map((tag)=>tag.replace(/:"?([^"]*)"?/g, ':$1;').trim()); + + if(attributes.length) { + attributes = attributes.map((attribute)=>attribute.replace(/(\w+)=(.+)/, '$1="$2"')); + } + + return `${classes.join(' ')}" ` + + `${id ? `id="${id}"` : ''} ` + + `${styles.length ? `style="${styles.join(' ')}"` : ''} ` + + `${attributes.length ? attributes.join(' ') : ''}`; }; module.exports = { From 837306c9a75d2a999971a46b8bf9fdc73afb8abc Mon Sep 17 00:00:00 2001 From: David Bolack Date: Tue, 7 Nov 2023 19:07:58 -0600 Subject: [PATCH 15/43] Add tests for arbitrary attributes. Also shifted around the adding of spaces for the attributes. --- shared/naturalcrit/markdown.js | 6 +++--- tests/markdown/mustache-syntax.test.js | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 0fd4fdd8f..5b2f47309 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -338,13 +338,13 @@ const processStyleTags = (string)=>{ const styles = tags.map((tag)=>tag.replace(/:"?([^"]*)"?/g, ':$1;').trim()); if(attributes.length) { - attributes = attributes.map((attribute)=>attribute.replace(/(\w+)=(.+)/, '$1="$2"')); + attributes = attributes.map((attribute)=>attribute.replace(/(\w+)=(.+)/, ' $1="$2"')); } return `${classes.join(' ')}" ` + `${id ? `id="${id}"` : ''} ` + - `${styles.length ? `style="${styles.join(' ')}"` : ''} ` + - `${attributes.length ? attributes.join(' ') : ''}`; + `${styles.length ? `style="${styles.join(' ')}"` : ''}` + + `${attributes.length ? attributes.join('') : ''}`; }; module.exports = { diff --git a/tests/markdown/mustache-syntax.test.js b/tests/markdown/mustache-syntax.test.js index d9e1ce6f9..6669cc6cb 100644 --- a/tests/markdown/mustache-syntax.test.js +++ b/tests/markdown/mustache-syntax.test.js @@ -124,6 +124,12 @@ describe('Inline: When using the Inline syntax {{ }}', ()=>{ const rendered = Markdown.render(source); expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('text'); }); + + it('Renders an image with added attributes', function() { + const source = dedent`![homebrew mug](https://i.imgur.com/hMna6G0.png) {position:absolute,bottom:20px,left:130px,width:220px,a=b and c,d=e}`; + const rendered = Markdown.render(source).trimReturns(); + expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

homebrew mug

`); + }); }); // BLOCK SYNTAX @@ -216,6 +222,7 @@ describe(`Block: When using the Block syntax {{tags\\ntext\\n}}`, ()=>{ // FIXME: adds extra \s before closing `>` in opening tag, and another after class names expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

Sample text.

`); }); + }); // MUSTACHE INJECTION SYNTAX From 7b85995b4a56ecc382219c1f6be3f1b74843bf3d Mon Sep 17 00:00:00 2001 From: David Bolack Date: Fri, 10 Nov 2023 00:28:25 -0600 Subject: [PATCH 16/43] Updated attribute assignment. Wraps with quotes ( a="b and c" ) Still does not work on Mustache Divs. UNsure where the failure is at the moment. Even regressed "a:b and c" pattern on those. --- shared/naturalcrit/markdown.js | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 5b2f47309..98cfa7c8c 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -34,7 +34,7 @@ const mustacheSpans = { start(src) { return src.match(/{{[^{]/)?.index; }, // Hint to Marked.js to stop and check for a match tokenizer(src, tokens) { const completeSpan = /^{{[^\n]*}}/; // Regex for the complete token - const inlineRegex = /{{(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*)*))\1 *|}}/g; + const inlineRegex = /{{(?=((?:[:=](?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"=':{}\s]*)*))\1 *|}}/g; const match = completeSpan.exec(src); if(match) { //Find closing delimiter @@ -132,13 +132,12 @@ const mustacheInjectInline = { level : 'inline', start(src) { return src.match(/ *{[^{\n]/)?.index; }, // Hint to Marked.js to stop and check for a match tokenizer(src, tokens) { - const inlineRegex = /^ *{(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\n\r\t\f]*)*))\1}/g; + const inlineRegex = /^ *{(?=((?:[:=](?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"=':{}\s]*)*))\1}/g; const match = inlineRegex.exec(src); if(match) { const lastToken = tokens[tokens.length - 1]; if(!lastToken || lastToken.type == 'mustacheInjectInline') return false; - const tags = ` ${processStyleTags(match[1])}`; lastToken.originalType = lastToken.type; lastToken.type = 'mustacheInjectInline'; @@ -167,7 +166,7 @@ const mustacheInjectBlock = { level : 'block', start(src) { return src.match(/\n *{[^{\n]/m)?.index; }, // Hint to Marked.js to stop and check for a match tokenizer(src, tokens) { - const inlineRegex = /^ *{(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\n\r\t\f]*)*))\1}/ym; + const inlineRegex = /^ *{(?=((?:[:=](?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"=':{}\s]*)*))\1}/ym; const match = inlineRegex.exec(src); if(match) { const lastToken = tokens[tokens.length - 1]; @@ -328,19 +327,13 @@ const voidTags = new Set([ const processStyleTags = (string)=>{ //split tags up. quotes can only occur right after colons. //TODO: can we simplify to just split on commas? - const tags = string.match(/(?:[^,":]+|:(?:"[^"]*"|))+/g); - - if(!tags) return '"'; + const tags = string.match(/(?:[^,":=]+|[:=](?:"[^"]*"|))+/g); const id = _.remove(tags, (tag)=>tag.startsWith('#')).map((tag)=>tag.slice(1))[0]; const classes = _.remove(tags, (tag)=>(!tag.includes(':')) && (!tag.includes('='))); - let attributes = _.remove(tags, (tag)=>(!tag.includes(':')) && (!tag.includes('#'))); + const attributes = _.remove(tags, (tag)=>(!tag.includes(':')) && (!tag.includes('#'))); const styles = tags.map((tag)=>tag.replace(/:"?([^"]*)"?/g, ':$1;').trim()); - if(attributes.length) { - attributes = attributes.map((attribute)=>attribute.replace(/(\w+)=(.+)/, ' $1="$2"')); - } - return `${classes.join(' ')}" ` + `${id ? `id="${id}"` : ''} ` + `${styles.length ? `style="${styles.join(' ')}"` : ''}` + From c068aca9ff3a2ec92e1a95c0a0bd6b8e1131179f Mon Sep 17 00:00:00 2001 From: David Bolack Date: Sat, 11 Nov 2023 15:47:27 -0600 Subject: [PATCH 17/43] Small tweaks to processStyle. This changes the output on arbitrary outputs to always wrap the value in quotes instead of only doing so on whitespaced values. --- shared/naturalcrit/markdown.js | 4 ++-- tests/markdown/mustache-syntax.test.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 98cfa7c8c..78a8a269c 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -331,13 +331,13 @@ const processStyleTags = (string)=>{ const id = _.remove(tags, (tag)=>tag.startsWith('#')).map((tag)=>tag.slice(1))[0]; const classes = _.remove(tags, (tag)=>(!tag.includes(':')) && (!tag.includes('='))); - const attributes = _.remove(tags, (tag)=>(!tag.includes(':')) && (!tag.includes('#'))); + const attributes = _.remove(tags, (tag)=>(!tag.includes(':')) && (!tag.includes('#'))).map((attr)=>attr.replace(/="?([^"]*)"?/g, '="$1"'));; const styles = tags.map((tag)=>tag.replace(/:"?([^"]*)"?/g, ':$1;').trim()); return `${classes.join(' ')}" ` + `${id ? `id="${id}"` : ''} ` + `${styles.length ? `style="${styles.join(' ')}"` : ''}` + - `${attributes.length ? attributes.join('') : ''}`; + `${attributes.length ? ` ${attributes.join(' ')}` : ''}`; }; module.exports = { diff --git a/tests/markdown/mustache-syntax.test.js b/tests/markdown/mustache-syntax.test.js index 6669cc6cb..d7323874a 100644 --- a/tests/markdown/mustache-syntax.test.js +++ b/tests/markdown/mustache-syntax.test.js @@ -126,7 +126,7 @@ describe('Inline: When using the Inline syntax {{ }}', ()=>{ }); it('Renders an image with added attributes', function() { - const source = dedent`![homebrew mug](https://i.imgur.com/hMna6G0.png) {position:absolute,bottom:20px,left:130px,width:220px,a=b and c,d=e}`; + const source = dedent`![homebrew mug](https://i.imgur.com/hMna6G0.png) {position:absolute,bottom:20px,left:130px,width:220px,a="b and c",d=e}`; const rendered = Markdown.render(source).trimReturns(); expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

homebrew mug

`); }); From c858c705d2388792a17fa7968ce99cc3b986bd37 Mon Sep 17 00:00:00 2001 From: David Bolack Date: Sat, 11 Nov 2023 22:23:43 -0600 Subject: [PATCH 18/43] Complete mustache div updates for attr --- shared/naturalcrit/markdown.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 78a8a269c..837daf850 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -84,7 +84,7 @@ const mustacheDivs = { start(src) { return src.match(/\n *{{[^{]/m)?.index; }, // Hint to Marked.js to stop and check for a match tokenizer(src, tokens) { const completeBlock = /^ *{{[^\n}]* *\n.*\n *}}/s; // Regex for the complete token - const blockRegex = /^ *{{(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*)*))\1 *$|^ *}}$/gm; + const blockRegex = /^ *{{(?=((?:[=:](?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"'=:{}\s]*)*))\1 *$|^ *}}$/gm; const match = completeBlock.exec(src); if(match) { //Find closing delimiter @@ -331,13 +331,17 @@ const processStyleTags = (string)=>{ const id = _.remove(tags, (tag)=>tag.startsWith('#')).map((tag)=>tag.slice(1))[0]; const classes = _.remove(tags, (tag)=>(!tag.includes(':')) && (!tag.includes('='))); - const attributes = _.remove(tags, (tag)=>(!tag.includes(':')) && (!tag.includes('#'))).map((attr)=>attr.replace(/="?([^"]*)"?/g, '="$1"'));; - const styles = tags.map((tag)=>tag.replace(/:"?([^"]*)"?/g, ':$1;').trim()); + let attributes = _.remove(tags, (tag)=>(!tag.includes(':')) && (!tag.includes('#'))); + const styles = tags?.length ? tags.map((tag)=>tag.replace(/:"?([^"]*)"?/g, ':$1;').trim()) : []; + + if(attributes) { + attributes = attributes.map((attr)=>attr.replace(/="?([^"]*)"?/g, '="$1"')); + } return `${classes.join(' ')}" ` + `${id ? `id="${id}"` : ''} ` + - `${styles.length ? `style="${styles.join(' ')}"` : ''}` + - `${attributes.length ? ` ${attributes.join(' ')}` : ''}`; + `${styles?.length ? `style="${styles.join(' ')}"` : ''}` + + `${attributes?.length ? ` ${attributes.join(' ')}` : ''}`; }; module.exports = { From d6e63604acfc4f0bce84093102186e7abaf80905 Mon Sep 17 00:00:00 2001 From: David Bolack Date: Wed, 22 Nov 2023 13:29:37 -0600 Subject: [PATCH 19/43] Add tests --- tests/markdown/mustache-syntax.test.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/markdown/mustache-syntax.test.js b/tests/markdown/mustache-syntax.test.js index d7323874a..fc531cfdc 100644 --- a/tests/markdown/mustache-syntax.test.js +++ b/tests/markdown/mustache-syntax.test.js @@ -223,6 +223,14 @@ describe(`Block: When using the Block syntax {{tags\\ntext\\n}}`, ()=>{ expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

Sample text.

`); }); + it('Renders a div with an ID, class, style and text, and a variable assignment', function() { + const source = dedent`{{color:red,cat,#dog,a="b and c",d="e" + Sample text. + }}`; + const rendered = Markdown.render(source).trimReturns(); + expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

Sample text.

`); + }); + }); // MUSTACHE INJECTION SYNTAX @@ -242,6 +250,12 @@ describe('Injection: When an injection tag follows an element', ()=>{ expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('text'); }); + it.failing('Renders a span "text" with injected attribute', function() { + const source = '{{ text}}{a="b and c"}'; + const rendered = Markdown.render(source); + expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('text'); + }); + it.failing('Renders a span "text" with injected style', function() { const source = '{{ text}}{color:red}'; const rendered = Markdown.render(source); From 467b728c47759b705f4b800d3e5e6a2b9e3e06fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Wed, 6 Dec 2023 00:24:44 +0100 Subject: [PATCH 20/43] text-re-fix --- tests/markdown/mustache-syntax.test.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/markdown/mustache-syntax.test.js b/tests/markdown/mustache-syntax.test.js index 5861b4c7b..71de867c8 100644 --- a/tests/markdown/mustache-syntax.test.js +++ b/tests/markdown/mustache-syntax.test.js @@ -317,13 +317,22 @@ describe('Injection: When an injection tag follows an element', ()=>{ expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('

text

'); }); - it.failing('renders a div "text" with two injected styles,included quotes', function() { + it.failing('renders a div "text" with two injected styles', function() { const source = dedent`{{ text }} - {color:red,--stringVariable:"'string'"}`; + {color:red,background:blue}`; const rendered = Markdown.render(source).trimReturns(); - expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

text

`); + expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

text

`); + }); + + it.failing('renders a div "text" with injected variable string', function() { + const source = dedent`{{ + text + }} + {--stringVariable:"'string'"}`; + const rendered = Markdown.render(source).trimReturns(); + expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

text

`); }); it.failing('renders an h2 header "text" with injected class name', function() { From 78d4d6fb7c883949b0626e21ef3e795d3600464f Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Wed, 6 Dec 2023 14:33:55 +1300 Subject: [PATCH 21/43] Tweak icon styling --- themes/V3/Blank/snippets.js | 5 ++--- themes/V3/Blank/style.less | 3 +++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/themes/V3/Blank/snippets.js b/themes/V3/Blank/snippets.js index a12152628..632c9e5f7 100644 --- a/themes/V3/Blank/snippets.js +++ b/themes/V3/Blank/snippets.js @@ -119,12 +119,11 @@ module.exports = [ {{homebreweryCredits Made With - {{homebreweryIcon,gold}} + {{homebreweryIcon}} The Homebrewery [Homebrewery.NaturalCrit.com](https://homebrewery.naturalcrit.com) - }} - \n`; + }}\n\n`; }, } ] diff --git a/themes/V3/Blank/style.less b/themes/V3/Blank/style.less index 5d3bb5509..89a4fdb5c 100644 --- a/themes/V3/Blank/style.less +++ b/themes/V3/Blank/style.less @@ -485,6 +485,9 @@ body { height: 75px; mask: url(/assets/naturalCritLogoWhite.svg) center / contain no-repeat; -webkit-mask: url(/assets/naturalCritLogoWhite.svg) center / contain no-repeat; + background-color: black; + } + .homebreweryIcon.red { background-color: red; } .homebreweryIcon.gold { From fcb9a8cdc51c7f3c55f89eabba614a69bed6c696 Mon Sep 17 00:00:00 2001 From: David Bolack Date: Wed, 6 Dec 2023 16:54:28 -0600 Subject: [PATCH 22/43] Update Editor highlighting to handle attribut assignments --- client/homebrew/editor/editor.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/homebrew/editor/editor.jsx b/client/homebrew/editor/editor.jsx index 5ad4e065f..f475bc6b0 100644 --- a/client/homebrew/editor/editor.jsx +++ b/client/homebrew/editor/editor.jsx @@ -162,7 +162,7 @@ const Editor = createClass({ // Highlight injectors {style} if(line.includes('{') && line.includes('}')){ - const regex = /(?:^|[^{\n])({(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\n\r\t\f]*)*))\2})/gm; + const regex = /(?:^|[^{\n])({(?=((?:[:=](?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':={}\s]*)*))\2})/gm; let match; while ((match = regex.exec(line)) != null) { codeMirror.markText({ line: lineNumber, ch: line.indexOf(match[1]) }, { line: lineNumber, ch: line.indexOf(match[1]) + match[1].length }, { className: 'injection' }); @@ -170,7 +170,7 @@ const Editor = createClass({ } // Highlight inline spans {{content}} if(line.includes('{{') && line.includes('}}')){ - const regex = /{{(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\n\r\t\f]*)*))\1 *|}}/g; + const regex = /{{(?=((?:[:=](?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':={}\s]*)*))\1 *|}}/g; let match; let blockCount = 0; while ((match = regex.exec(line)) != null) { @@ -189,7 +189,7 @@ const Editor = createClass({ // Highlight block divs {{\n Content \n}} let endCh = line.length+1; - const match = line.match(/^ *{{(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\n\r\t\f]*)*))\1 *$|^ *}}$/); + const match = line.match(/^ *{{(?=((?:[:=](?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':={}\s]*)*))\1 *$|^ *}}$/); if(match) endCh = match.index+match[0].length; codeMirror.markText({ line: lineNumber, ch: 0 }, { line: lineNumber, ch: endCh }, { className: 'block' }); From 688eca05e1c2c01d7769698191370a9829a6bae0 Mon Sep 17 00:00:00 2001 From: David Bolack Date: Wed, 6 Dec 2023 16:59:53 -0600 Subject: [PATCH 23/43] Update Regex pattern to be consistant. --- 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 a86adbc59..592de4896 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -84,7 +84,7 @@ const mustacheDivs = { start(src) { return src.match(/\n *{{[^{]/m)?.index; }, // Hint to Marked.js to stop and check for a match tokenizer(src, tokens) { const completeBlock = /^ *{{[^\n}]* *\n.*\n *}}/s; // Regex for the complete token - const blockRegex = /^ *{{(?=((?:[=:](?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"'=:{}\s]*)*))\1 *$|^ *}}$/gm; + const blockRegex = /^ *{{(?=((?:[:=](?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"=':{}\s]*)*))\1 *$|^ *}}$/gm; const match = completeBlock.exec(src); if(match) { //Find closing delimiter From 769f636db2b13606d1a411ba45ebc5b480552e4b Mon Sep 17 00:00:00 2001 From: David Bolack Date: Wed, 6 Dec 2023 17:48:51 -0600 Subject: [PATCH 24/43] Small fix and test updates Discovered that classes ( and possibly other splits could end up with an empty/null member that still gets joined so I added a trim to the end of all the joins in processStyleTags. Added tests that SHOULD test for bloc-level and inline-span moustaches with added attributes ( a=b ) --- shared/naturalcrit/markdown.js | 7 ++++--- tests/markdown/mustache-syntax.test.js | 12 ++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 592de4896..fdc1b06ce 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -359,6 +359,7 @@ const processStyleTags = (string)=>{ const id = _.remove(tags, (tag)=>tag.startsWith('#')).map((tag)=>tag.slice(1))[0]; const classes = _.remove(tags, (tag)=>(!tag.includes(':')) && (!tag.includes('='))); + console.log(classes); let attributes = _.remove(tags, (tag)=>(!tag.includes(':')) && (!tag.includes('#'))); const styles = tags?.length ? tags.map((tag)=>tag.replace(/:"?([^"]*)"?/g, ':$1;').trim()) : []; @@ -366,10 +367,10 @@ const processStyleTags = (string)=>{ attributes = attributes.map((attr)=>attr.replace(/="?([^"]*)"?/g, '="$1"')); } - return `${classes.join(' ')}" ` + + return `${classes.join(' ').trim()}" ` + `${id ? `id="${id}"` : ''} ` + - `${styles?.length ? `style="${styles.join(' ')}"` : ''}` + - `${attributes?.length ? ` ${attributes.join(' ')}` : ''}`; + `${styles?.length ? `style="${styles.join(' ').trim()}"` : ''}` + + `${attributes?.length ? ` ${attributes.join(' ').trim()}` : ''}`; }; module.exports = { diff --git a/tests/markdown/mustache-syntax.test.js b/tests/markdown/mustache-syntax.test.js index fc531cfdc..790af84f6 100644 --- a/tests/markdown/mustache-syntax.test.js +++ b/tests/markdown/mustache-syntax.test.js @@ -130,6 +130,18 @@ describe('Inline: When using the Inline syntax {{ }}', ()=>{ const rendered = Markdown.render(source).trimReturns(); expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

homebrew mug

`); }); + + it('Render a span with added attributes', function() { + const source = 'Text and {{pen,#author,color:orange,font-family:"trebuchet ms",a="b and c",d=e, text}} and more text!'; + const rendered = Markdown.render(source); + expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('

Text and text and more text!

\n'); + }); + + it('Render a div with added attributes', function() { + const source = '{{pen,#author,color:orange,font-family:"trebuchet ms",a="b and c",d=e\nText and text and more text!\n}}\n'; + const rendered = Markdown.render(source); + expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('

Text and text and more text!

\n
'); + }); }); // BLOCK SYNTAX From 05e56221f48869a9d590beca24fb88f28244855b Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Thu, 7 Dec 2023 22:32:33 -0500 Subject: [PATCH 25/43] Small tweaks --- themes/V3/Blank/snippets.js | 2 +- themes/V3/Blank/style.less | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/themes/V3/Blank/snippets.js b/themes/V3/Blank/snippets.js index 632c9e5f7..e437c0535 100644 --- a/themes/V3/Blank/snippets.js +++ b/themes/V3/Blank/snippets.js @@ -122,7 +122,7 @@ module.exports = [ {{homebreweryIcon}} The Homebrewery - [Homebrewery.NaturalCrit.com](https://homebrewery.naturalcrit.com) + [Homebrewery.Naturalcrit.com](https://homebrewery.naturalcrit.com) }}\n\n`; }, } diff --git a/themes/V3/Blank/style.less b/themes/V3/Blank/style.less index 89a4fdb5c..5f95d7593 100644 --- a/themes/V3/Blank/style.less +++ b/themes/V3/Blank/style.less @@ -463,15 +463,17 @@ body { } //***************************** -//* CREDITS +//* CREDITS //*****************************/ .page .homebreweryCredits { - font-family: "NodestoCapsWide"; - font-size: .4cm; - line-height: 1em; - text-align: center; - text-indent: 0; - letter-spacing: .08em; + p { + font-family: "NodestoCapsWide"; + font-size: .4cm; + line-height: 1em; + text-align: center; + text-indent: 0; + letter-spacing: .08em; + } a { color: inherit; text-decoration: none; @@ -480,9 +482,9 @@ body { } } .homebreweryIcon { - margin: 10px auto; + margin: 0 auto; display: block; - height: 75px; + height: 1.5cm; mask: url(/assets/naturalCritLogoWhite.svg) center / contain no-repeat; -webkit-mask: url(/assets/naturalCritLogoWhite.svg) center / contain no-repeat; background-color: black; From ef10b71e56c9406b352edd923ec65651fca11713 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 8 Dec 2023 03:44:10 +0000 Subject: [PATCH 26/43] Bump mongoose from 8.0.2 to 8.0.3 Bumps [mongoose](https://github.com/Automattic/mongoose) from 8.0.2 to 8.0.3. - [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.0.2...8.0.3) --- updated-dependencies: - dependency-name: mongoose 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 e52ed4b9d..b66eabc1a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,7 +35,7 @@ "marked-smartypants-lite": "^1.0.1", "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.29.4", - "mongoose": "^8.0.2", + "mongoose": "^8.0.3", "nanoid": "3.3.4", "nconf": "^0.12.1", "react": "^18.2.0", @@ -10453,9 +10453,9 @@ } }, "node_modules/mongoose": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.0.2.tgz", - "integrity": "sha512-Vsi9GzTXjdBVzheT1HZOZ2jHNzzR9Xwb5OyLz/FvDEAhlwrRnXnuqJf0QHINUOQSm7aoyvnPks0q85HJkd6yDw==", + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.0.3.tgz", + "integrity": "sha512-LJRT0yP4TW14HT4r2RkxqyvoTylMSzWpl5QOeVHTnRggCLQSpkoBdgbUtORFq/mSL2o9cLCPJz+6uzFj25qbHw==", "dependencies": { "bson": "^6.2.0", "kareem": "2.5.1", diff --git a/package.json b/package.json index f96a8db94..e03de80ff 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "marked-smartypants-lite": "^1.0.1", "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.29.4", - "mongoose": "^8.0.2", + "mongoose": "^8.0.3", "nanoid": "3.3.4", "nconf": "^0.12.1", "react": "^18.2.0", From ae974b270d7fb86ac72e2e9e41e0f3aed98dd265 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 03:42:57 +0000 Subject: [PATCH 27/43] Bump marked-extended-tables from 1.0.7 to 1.0.8 Bumps [marked-extended-tables](https://github.com/calculuschild/marked-extended-tables) from 1.0.7 to 1.0.8. - [Release notes](https://github.com/calculuschild/marked-extended-tables/releases) - [Changelog](https://github.com/calculuschild/marked-extended-tables/blob/main/release.config.cjs) - [Commits](https://github.com/calculuschild/marked-extended-tables/compare/v1.0.7...v1.0.8) --- updated-dependencies: - dependency-name: marked-extended-tables dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 10 +++++----- package.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index e52ed4b9d..8c8f32140 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,7 +30,7 @@ "less": "^3.13.1", "lodash": "^4.17.21", "marked": "5.1.1", - "marked-extended-tables": "^1.0.7", + "marked-extended-tables": "^1.0.8", "marked-gfm-heading-id": "^3.1.2", "marked-smartypants-lite": "^1.0.1", "markedLegacy": "npm:marked@^0.3.19", @@ -10052,11 +10052,11 @@ } }, "node_modules/marked-extended-tables": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/marked-extended-tables/-/marked-extended-tables-1.0.7.tgz", - "integrity": "sha512-DwURXYCPxhIdEP6y0rI9Od3qPM6ieXK7ce6hqR0/9MpkSmBUMrrBtoH3fMp6+oEXjfmIq4YBGPi9Ios80N3Q2w==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/marked-extended-tables/-/marked-extended-tables-1.0.8.tgz", + "integrity": "sha512-GcVQP7EnfQ98o09ooqM4t4M0qfpKdKuk7/z4qZfgkLyXTXsIyFS1eeBmfC36o1NbR6aSq8ynL/LeTz3w4RS27Q==", "peerDependencies": { - "marked": ">=3 <10" + "marked": ">=3 <12" } }, "node_modules/marked-gfm-heading-id": { diff --git a/package.json b/package.json index f96a8db94..a2cc843f5 100644 --- a/package.json +++ b/package.json @@ -99,7 +99,7 @@ "less": "^3.13.1", "lodash": "^4.17.21", "marked": "5.1.1", - "marked-extended-tables": "^1.0.7", + "marked-extended-tables": "^1.0.8", "marked-gfm-heading-id": "^3.1.2", "marked-smartypants-lite": "^1.0.1", "markedLegacy": "npm:marked@^0.3.19", From c69de1036f001190286e5532b43c9876cf91405d Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Mon, 11 Dec 2023 15:12:40 -0500 Subject: [PATCH 28/43] Lint Blank style.less to match PHB format --- themes/V3/Blank/style.less | 428 +++++++++++++++++-------------------- 1 file changed, 196 insertions(+), 232 deletions(-) diff --git a/themes/V3/Blank/style.less b/themes/V3/Blank/style.less index 5f95d7593..d31919fab 100644 --- a/themes/V3/Blank/style.less +++ b/themes/V3/Blank/style.less @@ -7,13 +7,9 @@ --HB_Color_WatercolorStain : #000000; // Black } -@page { margin: 0; } -body { - counter-reset : phb-page-numbers; -} -*{ - -webkit-print-color-adjust : exact; -} +@page { margin : 0; } +body { counter-reset : phb-page-numbers; } +* { -webkit-print-color-adjust : exact; } //***************************** // * MUSTACHE DIVS/SPANS @@ -23,9 +19,7 @@ body { break-inside : avoid; display : inline-block; width : 100%; - img { - z-index : 0; - } + img { z-index : 0; } } .inline-block { display : inline-block; @@ -33,97 +27,81 @@ body { } } -.useColumns(@multiplier : 1, @fillMode: auto){ +.useColumns(@multiplier : 1, @fillMode: auto) { column-fill : @fillMode; column-count : 2; } -.columnWrapper{ +.columnWrapper { + column-gap : inherit; max-height : 100%; column-span : all; columns : inherit; - column-gap : inherit; column-fill : inherit; } -.page{ +.page { .useColumns(); - height : 279.4mm; - width : 215.9mm; - padding : 1.4cm 1.9cm 1.7cm; - counter-increment : phb-page-numbers; - background-color : var(--HB_Color_Background); position : relative; z-index : 15; box-sizing : border-box; + width : 215.9mm; + height : 279.4mm; + padding : 1.4cm 1.9cm 1.7cm; overflow : hidden; + counter-increment : phb-page-numbers; + background-color : var(--HB_Color_Background); text-rendering : optimizeLegibility; contain : size; } - //***************************** - // * BASE +//***************************** +// * BASE // *****************************/ -.page{ - p{ - overflow-wrap : break-word; +.page { + p { display : block; + overflow-wrap : break-word; } - strong{ - font-weight : bold; - } - em{ - font-style : italic; - } - sup{ + strong { font-weight : bold; } + em { font-style : italic; } + sup { + font-size : smaller; + line-height : 0; vertical-align : super; - font-size : smaller; - line-height : 0; } - sub{ - vertical-align : sub; + sub { font-size : smaller; line-height : 0; + vertical-align : sub; } ul { + padding-left : 1.4em; list-style-position : outside; //Needed for multiline list items list-style-type : disc; - padding-left : 1.4em; } ol { + padding-left : 1.4em; list-style-position : outside; list-style-type : decimal; - padding-left : 1.4em; - } - img{ - z-index : -1; } + img { z-index : -1; } //***************************** // * HEADERS // *****************************/ - h1,h2,h3,h4,h5,h6{ + h1,h2,h3,h4,h5,h6 { font-weight : bold; line-height : 1.2em; } - h1{ - font-size : 2em; - } - h2{ - font-size : 1.5em; - } - h3{ - font-size : 1.17em; - } - h4{ - font-size : 1em; - } - h5{ - font-size : 0.83em; - } + h1 { font-size : 2em; } + h2 { font-size : 1.5em; } + h3 { font-size : 1.17em; } + h4 { font-size : 1em; } + h5 { font-size : 0.83em; } //***************************** // * TABLE // *****************************/ - table{ + table { width : 100%; - thead{ + thead { display : table-row-group; font-weight : bold; } @@ -135,42 +113,40 @@ body { //************************************ // * CODE BLOCKS // ************************************/ - code{ - font-family : "Courier New", Courier, monospace; - white-space : pre-wrap; + code { + font-family : 'Courier New', "Courier", monospace; overflow-wrap : break-word; + white-space : pre-wrap; } - pre code{ - width : 100%; + pre code { display : inline-block; + width : 100%; } //***************************** // * EXTRAS // *****************************/ .columnSplit { + margin-top : 0; visibility : hidden; -webkit-column-break-after : always; break-after : always; -moz-column-break-after : always; - margin-top : 0; - & + * { - margin-top : 0; - } + & + * { margin-top : 0; } } //Avoid breaking up - blockquote,table{ + blockquote,table { z-index : 15; -webkit-column-break-inside : avoid; page-break-inside : avoid; break-inside : avoid; } // Nested lists - ul ul,ol ol,ul ol,ol ul{ + ul ul,ol ol,ul ol,ol ul { margin-bottom : 0px; margin-left : 1.5em; } - li{ + li { -webkit-column-break-inside : avoid; page-break-inside : avoid; break-inside : avoid; @@ -178,69 +154,66 @@ body { /* Watermark */ .watermark { - display : grid !important; - place-items : center; - justify-content : center; position : absolute; - margin : 0; top : 0; left : 0; + z-index : 500; + display : grid !important; + place-items : center; + justify-content : center; width : 100%; height : 100%; + margin : 0; font-size : 120px; - text-transform : uppercase; + text-transform : uppercase; mix-blend-mode : overlay; opacity : 30%; transform : rotate(-45deg); - z-index : 500; - p { - margin-bottom : none; - } + p { margin-bottom : none; } } /* Watercolor */ - [class*="watercolor"] { + [class*='watercolor'] { position : absolute; + z-index : -2; width : 2000px; /* dimensions need to be real big so the user can set */ height : 2000px; /* height or width and the image will maintain aspect ratio */ + background-color : var(--HB_Color_WatercolorStain); /* default color */ + background-size : cover; -webkit-mask-image : var(--wc); -webkit-mask-size : contain; -webkit-mask-repeat : no-repeat; mask-image : var(--wc); mask-size : contain; mask-repeat : no-repeat; - background-size : cover; - background-color : var(--HB_Color_WatercolorStain); /*default color*/ - --wc : @watercolor1; /*default image*/ - z-index : -2; + --wc : @watercolor1; /* default image */ } - .watercolor1 { --wc : @watercolor1; } - .watercolor2 { --wc : @watercolor2; } - .watercolor3 { --wc : @watercolor3; } - .watercolor4 { --wc : @watercolor4; } - .watercolor5 { --wc : @watercolor5; } - .watercolor6 { --wc : @watercolor6; } - .watercolor7 { --wc : @watercolor7; } - .watercolor8 { --wc : @watercolor8; } - .watercolor9 { --wc : @watercolor9; } + .watercolor1 { --wc : @watercolor1; } + .watercolor2 { --wc : @watercolor2; } + .watercolor3 { --wc : @watercolor3; } + .watercolor4 { --wc : @watercolor4; } + .watercolor5 { --wc : @watercolor5; } + .watercolor6 { --wc : @watercolor6; } + .watercolor7 { --wc : @watercolor7; } + .watercolor8 { --wc : @watercolor8; } + .watercolor9 { --wc : @watercolor9; } .watercolor10 { --wc : @watercolor10; } .watercolor11 { --wc : @watercolor11; } .watercolor12 { --wc : @watercolor12; } /* Image Masks */ - [class*="imageMask"] { + [class*='imageMask'] { position : absolute; - height : 200%; - width : 200%; - left : 50%; bottom : 50%; - --rotation : 0; - --revealer : none; - --checkerboard : none; - --scaleX : 1; - --scaleY : 1; + left : 50%; + z-index : -1; + width : 200%; + height : 200%; + background-image : var(--checkerboard); + background-size : 20px; + transform : translateY(50%) translateX(-50%) rotate(calc(1deg * var(--rotation))) scaleX(var(--scaleX)) scaleY(var(--scaleY)); -webkit-mask-image : var(--wc), var(--revealer); -webkit-mask-repeat : repeat-x; -webkit-mask-size : 50%; //Scale only X to fit page width, leave height at aspect ratio, designed to hang off the edge @@ -249,61 +222,63 @@ body { mask-repeat : repeat-x; mask-size : 50%; mask-position : 50% calc(50% - var(--offset)); - background-image : var(--checkerboard); - background-size : 20px; - z-index : -1; - transform : translateY(50%) translateX(-50%) rotate(calc(1deg * var(--rotation))) scaleX(var(--scaleX)) scaleY(var(--scaleY)); + --rotation : 0; + --revealer : none; + --checkerboard : none; + --scaleX : 1; + --scaleY : 1; & > p:has(img) { position : absolute; - width : 50%; - height : 50%; bottom : 50%; left : 50%; + width : 50%; + height : 50%; transform : translateX(-50%) translateY(50%) rotate(calc(-1deg * var(--rotation))) scaleX(calc(1 / var(--scaleX))) scaleY(calc(1 / var(--scaleY))); } & img { position : absolute; - display : block; bottom : 0; + display : block; } &.bottom { --rotation : 0; - & img {bottom: 0;} + & img {bottom : 0;} } &.top { --rotation : 180; - & img {top: 0;} + & img {top : 0;} } &.left { --rotation : 90; - & img {left: 0;} + & img {left : 0;} } &.right { --rotation : -90; - & img {right: 0;} + & img {right : 0;} } &.revealImage { - --revealer : linear-gradient(0deg, rgba(0,0,0,.2) 0%, rgba(0,0,0,0.2)); - --checkerboard : url(/assets/waterColorMasks/missingImage.png); //shows any masked regions not filled by image + --revealer : linear-gradient(0deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.2)); + --checkerboard : url("/assets/waterColorMasks/missingImage.png"); //shows any masked regions not filled by image } } .imageMaskEdge { - &1 { --wc : url(/assets/waterColorMasks/edge/0001.webp); } - &2 { --wc : url(/assets/waterColorMasks/edge/0002.webp); } - &3 { --wc : url(/assets/waterColorMasks/edge/0003.webp); } - &4 { --wc : url(/assets/waterColorMasks/edge/0004.webp); } - &5 { --wc : url(/assets/waterColorMasks/edge/0005.webp); } - &6 { --wc : url(/assets/waterColorMasks/edge/0006.webp); } - &7 { --wc : url(/assets/waterColorMasks/edge/0007.webp); } - &8 { --wc : url(/assets/waterColorMasks/edge/0008.webp); } + &1 { --wc : url("/assets/waterColorMasks/edge/0001.webp"); } + &2 { --wc : url("/assets/waterColorMasks/edge/0002.webp"); } + &3 { --wc : url("/assets/waterColorMasks/edge/0003.webp"); } + &4 { --wc : url("/assets/waterColorMasks/edge/0004.webp"); } + &5 { --wc : url("/assets/waterColorMasks/edge/0005.webp"); } + &6 { --wc : url("/assets/waterColorMasks/edge/0006.webp"); } + &7 { --wc : url("/assets/waterColorMasks/edge/0007.webp"); } + &8 { --wc : url("/assets/waterColorMasks/edge/0008.webp"); } } - [class*="imageMaskCenter"] { + [class*='imageMaskCenter'] { + bottom : calc(var(--offsetY)); + left : calc(var(--offsetX)); width : 100%; height : 100%; - left : calc(var(--offsetX)); - bottom : calc(var(--offsetY)); + transform : rotate(calc(1deg * var(--rotation))) scaleX(var(--scaleX)) scaleY(var(--scaleY)); -webkit-mask-image : var(--wc), var(--revealer); -webkit-mask-repeat : no-repeat; -webkit-mask-size : 100% 100%; //Scale both dimensions to fit page size @@ -312,48 +287,48 @@ body { mask-repeat : no-repeat; mask-size : 100% 100%; //Scale both dimensions to fit page size mask-position : 50% 50%; - transform : rotate(calc(1deg * var(--rotation))) scaleX(var(--scaleX)) scaleY(var(--scaleY)); & > p:has(img) { position : absolute; - width : 100%; - height : 100%; bottom : 0; left : 0; + width : 100%; + height : 100%; transform : unset; transform : scaleX(calc(1 / var(--scaleX))) scaleY(calc(1 / var(--scaleY))) - rotate(calc(-1deg * var(--rotation))) - translateX(calc(-1 * var(--offsetX))) - translateY(calc(1 * var(--offsetY))); + rotate(calc(-1deg * var(--rotation))) + translateX(calc(-1 * var(--offsetX))) + translateY(calc(1 * var(--offsetY))); } } .imageMaskCenter { - &1 { --wc : url(/assets/waterColorMasks/center/0001.webp); } - &2 { --wc : url(/assets/waterColorMasks/center/0002.webp); } - &3 { --wc : url(/assets/waterColorMasks/center/0003.webp); } - &4 { --wc : url(/assets/waterColorMasks/center/0004.webp); } - &5 { --wc : url(/assets/waterColorMasks/center/0005.webp); } - &6 { --wc : url(/assets/waterColorMasks/center/0006.webp); } - &7 { --wc : url(/assets/waterColorMasks/center/0007.webp); } - &8 { --wc : url(/assets/waterColorMasks/center/0008.webp); } - &9 { --wc : url(/assets/waterColorMasks/center/0009.webp); } - &10 { --wc : url(/assets/waterColorMasks/center/0010.webp); } - &11 { --wc : url(/assets/waterColorMasks/center/0011.webp); } - &12 { --wc : url(/assets/waterColorMasks/center/0012.webp); } - &13 { --wc : url(/assets/waterColorMasks/center/0013.webp); } - &14 { --wc : url(/assets/waterColorMasks/center/0014.webp); } - &15 { --wc : url(/assets/waterColorMasks/center/0015.webp); } - &16 { --wc : url(/assets/waterColorMasks/center/0016.webp); } - &special { --wc : url(/assets/waterColorMasks/center/special.webp); } + &1 { --wc : url("/assets/waterColorMasks/center/0001.webp"); } + &2 { --wc : url("/assets/waterColorMasks/center/0002.webp"); } + &3 { --wc : url("/assets/waterColorMasks/center/0003.webp"); } + &4 { --wc : url("/assets/waterColorMasks/center/0004.webp"); } + &5 { --wc : url("/assets/waterColorMasks/center/0005.webp"); } + &6 { --wc : url("/assets/waterColorMasks/center/0006.webp"); } + &7 { --wc : url("/assets/waterColorMasks/center/0007.webp"); } + &8 { --wc : url("/assets/waterColorMasks/center/0008.webp"); } + &9 { --wc : url("/assets/waterColorMasks/center/0009.webp"); } + &10 { --wc : url("/assets/waterColorMasks/center/0010.webp"); } + &11 { --wc : url("/assets/waterColorMasks/center/0011.webp"); } + &12 { --wc : url("/assets/waterColorMasks/center/0012.webp"); } + &13 { --wc : url("/assets/waterColorMasks/center/0013.webp"); } + &14 { --wc : url("/assets/waterColorMasks/center/0014.webp"); } + &15 { --wc : url("/assets/waterColorMasks/center/0015.webp"); } + &16 { --wc : url("/assets/waterColorMasks/center/0016.webp"); } + &special { --wc : url("/assets/waterColorMasks/center/special.webp"); } } - [class*="imageMaskCorner"] { - height : 200%; - width : 200%; - left : calc(-50% + var(--offsetX)); + [class*='imageMaskCorner'] { bottom : calc(-50% + var(--offsetY)); + left : calc(-50% + var(--offsetX)); + width : 200%; + height : 200%; + transform : rotate(calc(1deg * var(--rotation))) scaleX(var(--scaleX)) scaleY(var(--scaleY)); -webkit-mask-image : var(--wc), var(--revealer); -webkit-mask-repeat : no-repeat; -webkit-mask-size : 100% 100%; //Scale both dimensions to fit page size @@ -362,56 +337,55 @@ body { mask-repeat : no-repeat; mask-size : 100% 100%; //Scale both dimensions to fit page size mask-position : 50% 50%; - transform : rotate(calc(1deg * var(--rotation))) scaleX(var(--scaleX)) scaleY(var(--scaleY)); & > p:has(img) { + bottom : 25%; + left : 25%; width : 50%; height : 50%; //Complex transform below to handle mix of % and cm offsets - left : 25%; - bottom : 25%; transform : scaleX(calc(1 / var(--scaleX))) scaleY(calc(1 / var(--scaleY))) - rotate(calc(-1deg * var(--rotation))) - translateX(calc(-1 * var(--offsetX))) - translateY(calc(1 * var(--offsetY))); + rotate(calc(-1deg * var(--rotation))) + translateX(calc(-1 * var(--offsetX))) + translateY(calc(1 * var(--offsetY))); } } .imageMaskCorner { - &1 { --wc : url(/assets/waterColorMasks/corner/0001.webp); } - &2 { --wc : url(/assets/waterColorMasks/corner/0002.webp); } - &3 { --wc : url(/assets/waterColorMasks/corner/0003.webp); } - &4 { --wc : url(/assets/waterColorMasks/corner/0004.webp); } - &5 { --wc : url(/assets/waterColorMasks/corner/0005.webp); } - &6 { --wc : url(/assets/waterColorMasks/corner/0006.webp); } - &7 { --wc : url(/assets/waterColorMasks/corner/0007.webp); } - &8 { --wc : url(/assets/waterColorMasks/corner/0008.webp); } - &9 { --wc : url(/assets/waterColorMasks/corner/0009.webp); } - &10 { --wc : url(/assets/waterColorMasks/corner/0010.webp); } - &11 { --wc : url(/assets/waterColorMasks/corner/0011.webp); } - &12 { --wc : url(/assets/waterColorMasks/corner/0012.webp); } - &13 { --wc : url(/assets/waterColorMasks/corner/0013.webp); } - &14 { --wc : url(/assets/waterColorMasks/corner/0014.webp); } - &15 { --wc : url(/assets/waterColorMasks/corner/0015.webp); } - &16 { --wc : url(/assets/waterColorMasks/corner/0016.webp); } - &17 { --wc : url(/assets/waterColorMasks/corner/0017.webp); } - &18 { --wc : url(/assets/waterColorMasks/corner/0018.webp); } - &19 { --wc : url(/assets/waterColorMasks/corner/0019.webp); } - &20 { --wc : url(/assets/waterColorMasks/corner/0020.webp); } - &21 { --wc : url(/assets/waterColorMasks/corner/0021.webp); } - &22 { --wc : url(/assets/waterColorMasks/corner/0022.webp); } - &23 { --wc : url(/assets/waterColorMasks/corner/0023.webp); } - &24 { --wc : url(/assets/waterColorMasks/corner/0024.webp); } - &25 { --wc : url(/assets/waterColorMasks/corner/0025.webp); } - &26 { --wc : url(/assets/waterColorMasks/corner/0026.webp); } - &27 { --wc : url(/assets/waterColorMasks/corner/0027.webp); } - &28 { --wc : url(/assets/waterColorMasks/corner/0028.webp); } - &29 { --wc : url(/assets/waterColorMasks/corner/0029.webp); } - &30 { --wc : url(/assets/waterColorMasks/corner/0030.webp); } - &31 { --wc : url(/assets/waterColorMasks/corner/0031.webp); } - &32 { --wc : url(/assets/waterColorMasks/corner/0032.webp); } - &33 { --wc : url(/assets/waterColorMasks/corner/0033.webp); } - &34 { --wc : url(/assets/waterColorMasks/corner/0034.webp); } - &35 { --wc : url(/assets/waterColorMasks/corner/0035.webp); } - &36 { --wc : url(/assets/waterColorMasks/corner/0036.webp); } - &37 { --wc : url(/assets/waterColorMasks/corner/0037.webp); } + &1 { --wc : url("/assets/waterColorMasks/corner/0001.webp"); } + &2 { --wc : url("/assets/waterColorMasks/corner/0002.webp"); } + &3 { --wc : url("/assets/waterColorMasks/corner/0003.webp"); } + &4 { --wc : url("/assets/waterColorMasks/corner/0004.webp"); } + &5 { --wc : url("/assets/waterColorMasks/corner/0005.webp"); } + &6 { --wc : url("/assets/waterColorMasks/corner/0006.webp"); } + &7 { --wc : url("/assets/waterColorMasks/corner/0007.webp"); } + &8 { --wc : url("/assets/waterColorMasks/corner/0008.webp"); } + &9 { --wc : url("/assets/waterColorMasks/corner/0009.webp"); } + &10 { --wc : url("/assets/waterColorMasks/corner/0010.webp"); } + &11 { --wc : url("/assets/waterColorMasks/corner/0011.webp"); } + &12 { --wc : url("/assets/waterColorMasks/corner/0012.webp"); } + &13 { --wc : url("/assets/waterColorMasks/corner/0013.webp"); } + &14 { --wc : url("/assets/waterColorMasks/corner/0014.webp"); } + &15 { --wc : url("/assets/waterColorMasks/corner/0015.webp"); } + &16 { --wc : url("/assets/waterColorMasks/corner/0016.webp"); } + &17 { --wc : url("/assets/waterColorMasks/corner/0017.webp"); } + &18 { --wc : url("/assets/waterColorMasks/corner/0018.webp"); } + &19 { --wc : url("/assets/waterColorMasks/corner/0019.webp"); } + &20 { --wc : url("/assets/waterColorMasks/corner/0020.webp"); } + &21 { --wc : url("/assets/waterColorMasks/corner/0021.webp"); } + &22 { --wc : url("/assets/waterColorMasks/corner/0022.webp"); } + &23 { --wc : url("/assets/waterColorMasks/corner/0023.webp"); } + &24 { --wc : url("/assets/waterColorMasks/corner/0024.webp"); } + &25 { --wc : url("/assets/waterColorMasks/corner/0025.webp"); } + &26 { --wc : url("/assets/waterColorMasks/corner/0026.webp"); } + &27 { --wc : url("/assets/waterColorMasks/corner/0027.webp"); } + &28 { --wc : url("/assets/waterColorMasks/corner/0028.webp"); } + &29 { --wc : url("/assets/waterColorMasks/corner/0029.webp"); } + &30 { --wc : url("/assets/waterColorMasks/corner/0030.webp"); } + &31 { --wc : url("/assets/waterColorMasks/corner/0031.webp"); } + &32 { --wc : url("/assets/waterColorMasks/corner/0032.webp"); } + &33 { --wc : url("/assets/waterColorMasks/corner/0033.webp"); } + &34 { --wc : url("/assets/waterColorMasks/corner/0034.webp"); } + &35 { --wc : url("/assets/waterColorMasks/corner/0035.webp"); } + &36 { --wc : url("/assets/waterColorMasks/corner/0036.webp"); } + &37 { --wc : url("/assets/waterColorMasks/corner/0037.webp"); } } } @@ -423,16 +397,16 @@ body { padding-left : 1em; white-space : pre-line; } - dt { - display : inline; - margin-right : 0.5ch; + dt { + display : inline; + margin-right : 0.5ch; margin-left : -1em; - } - dd { + } + dd { display : inline; margin-left : 0; text-indent : 0; - } + } } //***************************** @@ -442,9 +416,7 @@ body { .blank { height : 1em; margin-top : 0; - & + * { - margin-top : 0; - } + & + * { margin-top : 0; } } } @@ -452,13 +424,11 @@ body { // * WIDE // *****************************/ .page { - .wide{ + .wide { column-span : all; display : block; margin-bottom : 1em; - &+* { - margin-top : 0; - } + & + * { margin-top : 0; } } } @@ -467,32 +437,26 @@ body { //*****************************/ .page .homebreweryCredits { p { - font-family: "NodestoCapsWide"; - font-size: .4cm; - line-height: 1em; - text-align: center; - text-indent: 0; - letter-spacing: .08em; + font-family : 'NodestoCapsWide'; + font-size : 0.4cm; + line-height : 1em; + text-align : center; + text-indent : 0; + letter-spacing : 0.08em; } a { - color: inherit; - text-decoration: none; - &:hover { - text-decoration: underline; - } + color : inherit; + text-decoration : none; + &:hover { text-decoration : underline; } } .homebreweryIcon { - margin: 0 auto; - display: block; - height: 1.5cm; - mask: url(/assets/naturalCritLogoWhite.svg) center / contain no-repeat; - -webkit-mask: url(/assets/naturalCritLogoWhite.svg) center / contain no-repeat; - background-color: black; - } - .homebreweryIcon.red { - background-color: red; - } - .homebreweryIcon.gold { - background-image: linear-gradient(to top left, brown 22.5%, gold 40%, white 60%, gold 67.5%, brown 82.5%); + display : block; + height : 1.5cm; + margin : 0 auto; + background-color : black; + -webkit-mask : url("/assets/naturalCritLogoWhite.svg") center / contain no-repeat; + mask : url("/assets/naturalCritLogoWhite.svg") center / contain no-repeat; } + .homebreweryIcon.red { background-color : red; } + .homebreweryIcon.gold { background-image : linear-gradient(to top left, brown 22.5%, gold 40%, white 60%, gold 67.5%, brown 82.5%); } } From 0775f9ee1b193a9623fed5d461a0b8e2fae7578c Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Mon, 11 Dec 2023 15:45:39 -0500 Subject: [PATCH 29/43] Restore padding to code blocks --- themes/V3/5ePHB/style.less | 2 ++ 1 file changed, 2 insertions(+) diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index bb79f75e6..a3d9a7c09 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -448,6 +448,8 @@ border-image : @codeBorderImage 26 stretch; border-image-width : 10px; border-image-outset : 2px; + margin-bottom: 2px; + padding: 0.15cm; .page :where(&) { margin-top : 2px; //Prevent top border getting cut off on colbreak } From f5f6137a4d035ab80c3097d71e459cd3afb4ccd3 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Mon, 11 Dec 2023 15:48:58 -0500 Subject: [PATCH 30/43] Lint --- themes/V3/5ePHB/style.less | 45 +++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index a3d9a7c09..31d37b2fa 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -14,7 +14,7 @@ --HB_Color_Footnotes : #C9AD6A; // Gold } -.useSansSerif(){ +.useSansSerif() { font-family : 'ScalySansRemake'; font-size : 0.318cm; line-height : 1.2em; @@ -39,11 +39,11 @@ -webkit-column-gap : 0.9cm; -moz-column-gap : 0.9cm; } -.page{ +.page { .useColumns(); - background-image : @backgroundImage; - font-family : BookInsanityRemake; + font-family : 'BookInsanityRemake'; font-size : 0.34cm; + background-image : @backgroundImage; } //***************************** // * BASE @@ -58,13 +58,13 @@ & + p { margin-top : 0; } } ul { - margin-bottom : 0.8em; padding-left : 1.4em; + margin-bottom : 0.8em; line-height : 1.25em; } ol { - margin-bottom : 0.8em; padding-left : 1.4em; + margin-bottom : 0.8em; line-height : 1.25em; } //Indents after p or lists @@ -149,8 +149,8 @@ .useSansSerif(); line-height : 16px; & + * { margin-top : 0.325cm; } - thead{ - display: table-row-group; + thead { + display : table-row-group; font-weight : 800; th { //padding : 0.14em 0.4em; @@ -283,9 +283,7 @@ } /* Watermark */ - .watermark { - color : black; - } + .watermark { color : black; } /* Watercolor */ @@ -434,22 +432,22 @@ // * CODE BLOCKS // ************************************/ code { - font-size : 0.325cm; padding : 0px 4px; - color : #58180d; - background-color : #faf7ea; + font-size : 0.325cm; + color : #58180D; + background-color : #FAF7EA; border-radius : 4px; } - pre code{ + pre code { + padding : 0.15cm; + margin-bottom : 2px; border-style : solid; border-width : 1px; border-radius : 12px; border-image : @codeBorderImage 26 stretch; border-image-width : 10px; border-image-outset : 2px; - margin-bottom: 2px; - padding: 0.15cm; .page :where(&) { margin-top : 2px; //Prevent top border getting cut off on colbreak } @@ -875,16 +873,13 @@ .page { dl { line-height : 1.25em; - & + * { margin-top : 0.28cm; } + & + * { margin-top : 0.17cm; } } - dl + * { - margin-top : 0.17cm; - } - p + dl { margin-top: 0.17cm; } - dt { - margin-right : 5px; + p + dl { margin-top : 0.17cm; } + dt { + margin-right : 5px; margin-left : -1em; - } + } } //***************************** From ee4921f02ca38d199fe0dd29e886b1f2897bb729 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Mon, 11 Dec 2023 22:08:03 +0100 Subject: [PATCH 31/43] uncaught styles --- themes/V3/5ePHB/style.less | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index 31d37b2fa..9cc89f6d3 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -51,10 +51,8 @@ .page { p { - display : block; line-height : 1.25em; - overflow-wrap : break-word; //TODO: MAKE ALL MARGINS TOP-ONLY. USE * + * STYLE SELECTORS - & + * { margin-top : 0.325cm; } + & + * { margin-top : 0.325cm; } //TODO: MAKE ALL MARGINS TOP-ONLY. USE * + * STYLE SELECTORS & + p { margin-top : 0; } } ul { From c10be139c9e400878ca8b53955da5d373b6581e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Mon, 11 Dec 2023 22:09:08 +0100 Subject: [PATCH 32/43] redundant font-weight removed --- themes/V3/5ePHB/style.less | 2 -- 1 file changed, 2 deletions(-) diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index 9cc89f6d3..a4157f31e 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -77,7 +77,6 @@ // *****************************/ h1,h2,h3,h4 { font-family : 'MrEavesRemake'; - font-weight : 800; color : var(--HB_Color_HeaderText); } h1 { @@ -136,7 +135,6 @@ //margin-bottom : 0.02cm; font-family : 'ScalySansSmallCapsRemake'; font-size : 0.423cm; - font-weight : 900; line-height : 0.951em; //Font is misaligned. Shift up slightly & + * { margin-top : 0.2cm; } } From 7c9513f3776d5911244475f273fc4aa69bdc0171 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Mon, 11 Dec 2023 16:29:16 -0500 Subject: [PATCH 33/43] Lint --- themes/V3/5ePHB/style.less | 124 ++++++++++++++++++------------------- 1 file changed, 61 insertions(+), 63 deletions(-) diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index a4157f31e..209e54b08 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -20,7 +20,7 @@ line-height : 1.2em; p,dl,ul,ol { line-height : 1.2em; } ul, ol { padding-left : 1em; } - em { font-style : italic; } + em { font-style : italic; } strong { font-weight : 800; letter-spacing : -0.02em; @@ -41,29 +41,29 @@ } .page { .useColumns(); - font-family : 'BookInsanityRemake'; - font-size : 0.34cm; - background-image : @backgroundImage; + font-family : 'BookInsanityRemake'; + font-size : 0.34cm; + background-image : @backgroundImage; } -//***************************** +// ***************************** // * BASE - // *****************************/ +// *****************************/ .page { p { - line-height : 1.25em; + line-height : 1.25em; & + * { margin-top : 0.325cm; } //TODO: MAKE ALL MARGINS TOP-ONLY. USE * + * STYLE SELECTORS & + p { margin-top : 0; } } ul { - padding-left : 1.4em; - margin-bottom : 0.8em; - line-height : 1.25em; + padding-left : 1.4em; + margin-bottom : 0.8em; + line-height : 1.25em; } ol { - padding-left : 1.4em; - margin-bottom : 0.8em; - line-height : 1.25em; + padding-left : 1.4em; + margin-bottom : 0.8em; + line-height : 1.25em; } //Indents after p or lists p + p, ul + p, ol + p { text-indent : 1em; } @@ -72,12 +72,12 @@ font-weight : bold; letter-spacing : -0.02em; } - //***************************** + // ***************************** // * HEADERS // *****************************/ h1,h2,h3,h4 { - font-family : 'MrEavesRemake'; - color : var(--HB_Color_HeaderText); + font-family : 'MrEavesRemake'; + color : var(--HB_Color_HeaderText); } h1 { margin-bottom : 0.18cm; //Margin-bottom only because this is WIDE @@ -106,8 +106,8 @@ h2 { //margin-top : 0px; //Font is misaligned. Shift up slightly //margin-bottom : 0.05cm; - font-size : 0.75cm; - line-height : 0.988em; //Font is misaligned. Shift up slightly + font-size : 0.75cm; + line-height : 0.988em; //Font is misaligned. Shift up slightly } h3 { //margin-top : -0.1cm; //Font is misaligned. Shift up slightly @@ -123,8 +123,8 @@ h4 { //margin-top : -0.02cm; //Font is misaligned. Shift up slightly //margin-bottom : 0.02cm; - font-size : 0.458cm; - line-height : 0.971em; //Font is misaligned. Shift up slightly + font-size : 0.458cm; + line-height : 0.971em; //Font is misaligned. Shift up slightly & + * { margin-top : 0.09cm; } } * + h4 { @@ -133,17 +133,17 @@ h5 { //margin-top : -0.02cm; //Font is misaligned. Shift up slightly //margin-bottom : 0.02cm; - font-family : 'ScalySansSmallCapsRemake'; - font-size : 0.423cm; - line-height : 0.951em; //Font is misaligned. Shift up slightly + font-family : 'ScalySansSmallCapsRemake'; + font-size : 0.423cm; + line-height : 0.951em; //Font is misaligned. Shift up slightly & + * { margin-top : 0.2cm; } } - //***************************** + // ***************************** // * TABLE // *****************************/ table { .useSansSerif(); - line-height : 16px; + line-height : 16px; & + * { margin-top : 0.325cm; } thead { display : table-row-group; @@ -159,15 +159,15 @@ tr { td { //padding : 0.14em 0.4em; - padding : 0px 1.5px; // Both of these are temporary, just to force + padding : 0px 1.5px; // Both of these are temporary, just to force //line-height : 16px; // PDF to render at same height until Chrome 108 } &:nth-child(odd) { background-color : var(--HB_Color_Accent); } } } } - //***************************** - // * QUOTE + // ***************************** + // * QUOTE // *****************************/ .quote { @@ -200,9 +200,7 @@ } - - - //***************************** + // ***************************** // * NOTE // *****************************/ .note { @@ -216,7 +214,7 @@ border-image-outset : 9px 0px; box-shadow : 1px 4px 14px #888888; .page :where(&) { - margin-top : 9px; //Prevent top border getting cut off on colbreak + margin-top : 9px; //Prevent top border getting cut off on colbreak } & + * { margin-top : 0.45cm; } h5 { font-size : 0.375cm; } @@ -226,7 +224,7 @@ } :last-child { margin-bottom : 0; } } - //************************************ + // ************************************ // * DESCRIPTIVE TEXT BOX // ************************************/ .descriptive { @@ -250,7 +248,7 @@ } :last-child { margin-bottom : 0; } } - //***************************** + // ***************************** // * Images Snippets // *****************************/ @@ -279,7 +277,7 @@ } /* Watermark */ - .watermark { color : black; } + .watermark { color : black; } /* Watercolor */ @@ -296,7 +294,7 @@ .watercolor11 { --wc : @watercolor11; } .watercolor12 { --wc : @watercolor12; } - //***************************** + // ***************************** // * MONSTER STAT BLOCK // *****************************/ .monster { @@ -317,24 +315,24 @@ box-shadow : 1px 4px 14px #888888; } - position : relative; - padding : 0px; - margin-bottom : 0.325cm; + position : relative; + padding : 0px; + margin-bottom : 0.325cm; //Headers h2 { - margin : 0; - font-size : 0.62cm; - line-height : 1em; + margin : 0; + font-size : 0.62cm; + line-height : 1em; & + p { margin-bottom : 0; font-size : 0.304cm; //Monster size and type subtext } } h3 { - font-family : 'ScalySansSmallCapsRemake'; - font-size : 0.45cm; - border-bottom : 1.5px solid var(--HB_Color_HeaderText); + font-family : 'ScalySansSmallCapsRemake'; + font-size : 0.45cm; + border-bottom : 1.5px solid var(--HB_Color_HeaderText); } //Triangle dividers @@ -381,10 +379,10 @@ .useColumns(0.96, @fillMode: balance); } - //***************************** + // ***************************** // * FOOTER // *****************************/ - &:after { + &::after { position : absolute; bottom : 0px; left : 0px; @@ -424,7 +422,7 @@ color : var(--HB_Color_Footnotes); text-align : right; } - //************************************ + // ************************************ // * CODE BLOCKS // ************************************/ code { @@ -449,7 +447,7 @@ } & + * { margin-top : 0.325cm; } } - //***************************** + // ***************************** // * EXTRAS // *****************************/ hr { @@ -464,12 +462,12 @@ margin-left : 1.5em; } } -//***************************** +// ***************************** // * SPELL LIST // *****************************/ .page .spellList { .useSansSerif(); - column-count : 2; + column-count : 2; ul + h5 { margin-top : 15px; } p, ul { font-size : 0.352cm; @@ -487,7 +485,7 @@ &.wide { column-count : 4; } } -//***************************** +// ***************************** // * CLASS TABLE // *****************************/ .page .classTable { @@ -534,7 +532,7 @@ } h5 + table { margin-top : 0.2cm; } } -//***************************** +// ***************************** // * FRONT COVER PAGE // *****************************/ .page:has(.frontCover) { @@ -628,7 +626,7 @@ } } } -//***************************** +// ***************************** // * INSIDE COVER PAGE // *****************************/ .page:has(.insideCover) { @@ -673,7 +671,7 @@ } } } -//***************************** +// ***************************** // * BACK COVER // *****************************/ .page:has(.backCover) { @@ -755,10 +753,10 @@ } } -//***************************** +// ***************************** // * PART COVER - // *****************************/ - .page:has(.partCover) { +// *****************************/ +.page:has(.partCover) { padding-top : 0; text-align : center; columns : 1; @@ -794,7 +792,7 @@ } } -//***************************** +// ***************************** // * TABLE OF CONTENTS // *****************************/ .page { @@ -863,7 +861,7 @@ } } -//***************************** +// ***************************** // * DEFINITION LISTS // *****************************/ .page { @@ -878,10 +876,10 @@ } } -//***************************** +// ***************************** // * WIDE // *****************************/ -.page .wide { margin-bottom : 0.325cm; } +.page .wide { margin-bottom : 0.325cm; } .page h1 + * { margin-top : 0; } @@ -920,7 +918,7 @@ } } } -//***************************** +// ***************************** // * INDEX // *****************************/ .page { From a0e2997a401e53a67c27235fae32bb4ad0239973 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Dec 2023 03:35:53 +0000 Subject: [PATCH 34/43] Bump @babel/plugin-transform-runtime from 7.23.4 to 7.23.6 Bumps [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-runtime) from 7.23.4 to 7.23.6. - [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.23.6/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 | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8637160f0..626e24384 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "license": "MIT", "dependencies": { "@babel/core": "^7.23.5", - "@babel/plugin-transform-runtime": "^7.23.4", + "@babel/plugin-transform-runtime": "^7.23.6", "@babel/preset-env": "^7.23.5", "@babel/preset-react": "^7.23.3", "@googleapis/drive": "^8.4.0", @@ -1455,9 +1455,9 @@ } }, "node_modules/@babel/plugin-transform-runtime": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.23.4.tgz", - "integrity": "sha512-ITwqpb6V4btwUG0YJR82o2QvmWrLgDnx/p2A3CTPYGaRgULkDiC0DRA2C4jlRB9uXGUEfaSS/IGHfVW+ohzYDw==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.23.6.tgz", + "integrity": "sha512-kF1Zg62aPseQ11orDhFRw+aPG/eynNQtI+TyY+m33qJa2cJ5EEvza2P2BNTIA9E5MyqFABHEyY6CPHwgdy9aNg==", "dependencies": { "@babel/helper-module-imports": "^7.22.15", "@babel/helper-plugin-utils": "^7.22.5", diff --git a/package.json b/package.json index d40bc9dff..03707928c 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ }, "dependencies": { "@babel/core": "^7.23.5", - "@babel/plugin-transform-runtime": "^7.23.4", + "@babel/plugin-transform-runtime": "^7.23.6", "@babel/preset-env": "^7.23.5", "@babel/preset-react": "^7.23.3", "@googleapis/drive": "^8.4.0", From 35bf26feae91c2b0a083a356b3df0d394b8f9a12 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Dec 2023 20:51:34 +0000 Subject: [PATCH 35/43] Bump @babel/core from 7.23.5 to 7.23.6 Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.23.5 to 7.23.6. - [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.23.6/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 | 106 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 54 insertions(+), 54 deletions(-) diff --git a/package-lock.json b/package-lock.json index 626e24384..2f8547f27 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "hasInstallScript": true, "license": "MIT", "dependencies": { - "@babel/core": "^7.23.5", + "@babel/core": "^7.23.6", "@babel/plugin-transform-runtime": "^7.23.6", "@babel/preset-env": "^7.23.5", "@babel/preset-react": "^7.23.3", @@ -106,20 +106,20 @@ } }, "node_modules/@babel/core": { - "version": "7.23.5", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.5.tgz", - "integrity": "sha512-Cwc2XjUrG4ilcfOw4wBAK+enbdgwAcAJCfGUItPBKR7Mjw4aEfAFYrLxeRp4jWgtNIKn3n2AlBOfwwafl+42/g==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.6.tgz", + "integrity": "sha512-FxpRyGjrMJXh7X3wGLGhNDCRiwpWEF74sKjTLDJSG5Kyvow3QZaG0Adbqzi9ZrVjTWpsX+2cxWXD71NMg93kdw==", "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.23.5", - "@babel/generator": "^7.23.5", - "@babel/helper-compilation-targets": "^7.22.15", + "@babel/generator": "^7.23.6", + "@babel/helper-compilation-targets": "^7.23.6", "@babel/helper-module-transforms": "^7.23.3", - "@babel/helpers": "^7.23.5", - "@babel/parser": "^7.23.5", + "@babel/helpers": "^7.23.6", + "@babel/parser": "^7.23.6", "@babel/template": "^7.22.15", - "@babel/traverse": "^7.23.5", - "@babel/types": "^7.23.5", + "@babel/traverse": "^7.23.6", + "@babel/types": "^7.23.6", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -140,11 +140,11 @@ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==" }, "node_modules/@babel/generator": { - "version": "7.23.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.5.tgz", - "integrity": "sha512-BPssCHrBD+0YrxviOa3QzpqwhNIXKEtOa2jQrm4FlmkC2apYgRnQcmPWiGZDlGxiNtltnUFolMe8497Esry+jA==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.6.tgz", + "integrity": "sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==", "dependencies": { - "@babel/types": "^7.23.5", + "@babel/types": "^7.23.6", "@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" @@ -189,13 +189,13 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.15.tgz", - "integrity": "sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.23.6.tgz", + "integrity": "sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ==", "dependencies": { - "@babel/compat-data": "^7.22.9", - "@babel/helper-validator-option": "^7.22.15", - "browserslist": "^4.21.9", + "@babel/compat-data": "^7.23.5", + "@babel/helper-validator-option": "^7.23.5", + "browserslist": "^4.22.2", "lru-cache": "^5.1.1", "semver": "^6.3.1" }, @@ -449,13 +449,13 @@ } }, "node_modules/@babel/helpers": { - "version": "7.23.5", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.5.tgz", - "integrity": "sha512-oO7us8FzTEsG3U6ag9MfdF1iA/7Z6dz+MtFhifZk8C8o453rGJFFWUP1t+ULM9TUIAzC9uxXEiXjOiVMyd7QPg==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.6.tgz", + "integrity": "sha512-wCfsbN4nBidDRhpDhvcKlzHWCTlgJYUUdSJfzXb2NuBssDSIjc3xcb+znA7l+zYsFljAcGM0aFkN40cR3lXiGA==", "dependencies": { "@babel/template": "^7.22.15", - "@babel/traverse": "^7.23.5", - "@babel/types": "^7.23.5" + "@babel/traverse": "^7.23.6", + "@babel/types": "^7.23.6" }, "engines": { "node": ">=6.9.0" @@ -475,9 +475,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.23.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.5.tgz", - "integrity": "sha512-hOOqoiNXrmGdFbhgCzu6GiURxUgM27Xwd/aPuu8RfHEZPBzL1Z54okAHAQjXfcQNwvrlkAmAp4SlRTZ45vlthQ==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.6.tgz", + "integrity": "sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ==", "bin": { "parser": "bin/babel-parser.js" }, @@ -1758,19 +1758,19 @@ } }, "node_modules/@babel/traverse": { - "version": "7.23.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.5.tgz", - "integrity": "sha512-czx7Xy5a6sapWWRx61m1Ke1Ra4vczu1mCTtJam5zRTBOonfdJ+S/B6HYmGYu3fJtr8GGET3si6IhgWVBhJ/m8w==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.6.tgz", + "integrity": "sha512-czastdK1e8YByZqezMPFiZ8ahwVMh/ESl9vPgvgdB9AmFMGP5jfpFax74AQgl5zj4XHzqeYAg2l8PuUeRS1MgQ==", "dependencies": { "@babel/code-frame": "^7.23.5", - "@babel/generator": "^7.23.5", + "@babel/generator": "^7.23.6", "@babel/helper-environment-visitor": "^7.22.20", "@babel/helper-function-name": "^7.23.0", "@babel/helper-hoist-variables": "^7.22.5", "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.23.5", - "@babel/types": "^7.23.5", - "debug": "^4.1.0", + "@babel/parser": "^7.23.6", + "@babel/types": "^7.23.6", + "debug": "^4.3.1", "globals": "^11.1.0" }, "engines": { @@ -1778,9 +1778,9 @@ } }, "node_modules/@babel/types": { - "version": "7.23.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.5.tgz", - "integrity": "sha512-ON5kSOJwVO6xXVRTvOI0eOnWe7VdUcIpsovGo9U/Br4Ie4UVFQTboO2cYnDhAGU6Fp+UxSiT+pMft0SMHfuq6w==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.6.tgz", + "integrity": "sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg==", "dependencies": { "@babel/helper-string-parser": "^7.23.4", "@babel/helper-validator-identifier": "^7.22.20", @@ -4227,9 +4227,9 @@ } }, "node_modules/browserslist": { - "version": "4.22.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.1.tgz", - "integrity": "sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ==", + "version": "4.22.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.2.tgz", + "integrity": "sha512-0UgcrvQmBDvZHFGdYUehrCNIazki7/lUP3kkoi/r3YB2amZbFM9J43ZRkJTXBUZK4gmx56+Sqk9+Vs9mwZx9+A==", "funding": [ { "type": "opencollective", @@ -4245,9 +4245,9 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001541", - "electron-to-chromium": "^1.4.535", - "node-releases": "^2.0.13", + "caniuse-lite": "^1.0.30001565", + "electron-to-chromium": "^1.4.601", + "node-releases": "^2.0.14", "update-browserslist-db": "^1.0.13" }, "bin": { @@ -4408,9 +4408,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001547", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001547.tgz", - "integrity": "sha512-W7CrtIModMAxobGhz8iXmDfuJiiKg1WADMO/9x7/CLNin5cpSbuBjooyoIUVB5eyCc36QuTVlkVa1iB2S5+/eA==", + "version": "1.0.30001570", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001570.tgz", + "integrity": "sha512-+3e0ASu4sw1SWaoCtvPeyXp+5PsjigkSt8OXZbF9StH5pQWbxEjLAZE3n8Aup5udop1uRiKA7a4utUk/uoSpUw==", "funding": [ { "type": "opencollective", @@ -5381,9 +5381,9 @@ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, "node_modules/electron-to-chromium": { - "version": "1.4.551", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.551.tgz", - "integrity": "sha512-/Ng/W/kFv7wdEHYzxdK7Cv0BHEGSkSB3M0Ssl8Ndr1eMiYeas/+Mv4cNaDqamqWx6nd2uQZfPz6g25z25M/sdw==" + "version": "1.4.612", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.612.tgz", + "integrity": "sha512-dM8BMtXtlH237ecSMnYdYuCkib2QHq0kpWfUnavjdYsyr/6OsAwg5ZGUfnQ9KD1Ga4QgB2sqXlB2NT8zy2GnVg==" }, "node_modules/elliptic": { "version": "6.5.4", @@ -10834,9 +10834,9 @@ "dev": true }, "node_modules/node-releases": { - "version": "2.0.13", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", - "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==" + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", + "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==" }, "node_modules/nodemon": { "version": "2.0.21", diff --git a/package.json b/package.json index 03707928c..98d1a5cb2 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ ] }, "dependencies": { - "@babel/core": "^7.23.5", + "@babel/core": "^7.23.6", "@babel/plugin-transform-runtime": "^7.23.6", "@babel/preset-env": "^7.23.5", "@babel/preset-react": "^7.23.3", From 649e2253594caf6e545b4737da3fa9c8dcc52925 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Dec 2023 20:51:54 +0000 Subject: [PATCH 36/43] Bump @babel/preset-env from 7.23.5 to 7.23.6 Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.23.5 to 7.23.6. - [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.23.6/packages/babel-preset-env) --- updated-dependencies: - dependency-name: "@babel/preset-env" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 63 ++++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 33 insertions(+), 32 deletions(-) diff --git a/package-lock.json b/package-lock.json index 626e24384..dec76cdc2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "dependencies": { "@babel/core": "^7.23.5", "@babel/plugin-transform-runtime": "^7.23.6", - "@babel/preset-env": "^7.23.5", + "@babel/preset-env": "^7.23.6", "@babel/preset-react": "^7.23.3", "@googleapis/drive": "^8.4.0", "body-parser": "^1.20.2", @@ -189,13 +189,13 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.15.tgz", - "integrity": "sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.23.6.tgz", + "integrity": "sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ==", "dependencies": { - "@babel/compat-data": "^7.22.9", - "@babel/helper-validator-option": "^7.22.15", - "browserslist": "^4.21.9", + "@babel/compat-data": "^7.23.5", + "@babel/helper-validator-option": "^7.23.5", + "browserslist": "^4.22.2", "lru-cache": "^5.1.1", "semver": "^6.3.1" }, @@ -1031,11 +1031,12 @@ } }, "node_modules/@babel/plugin-transform-for-of": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.23.3.tgz", - "integrity": "sha512-X8jSm8X1CMwxmK878qsUGJRmbysKNbdpTv/O1/v0LuY/ZkZrng5WYiekYSdg9m09OTmDDUWeEDsTE+17WYbAZw==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.23.6.tgz", + "integrity": "sha512-aYH4ytZ0qSuBbpfhuofbg/e96oQ7U2w1Aw/UQmKT+1l39uEhUPoFS3fHevDc1G0OvewyDudfMKY1OulczHzWIw==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1604,12 +1605,12 @@ } }, "node_modules/@babel/preset-env": { - "version": "7.23.5", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.23.5.tgz", - "integrity": "sha512-0d/uxVD6tFGWXGDSfyMD1p2otoaKmu6+GD+NfAx0tMaH+dxORnp7T9TaVQ6mKyya7iBtCIVxHjWT7MuzzM9z+A==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.23.6.tgz", + "integrity": "sha512-2XPn/BqKkZCpzYhUUNZ1ssXw7DcXfKQEjv/uXZUXgaebCMYmkEsfZ2yY+vv+xtXv50WmL5SGhyB6/xsWxIvvOQ==", "dependencies": { "@babel/compat-data": "^7.23.5", - "@babel/helper-compilation-targets": "^7.22.15", + "@babel/helper-compilation-targets": "^7.23.6", "@babel/helper-plugin-utils": "^7.22.5", "@babel/helper-validator-option": "^7.23.5", "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.23.3", @@ -1649,7 +1650,7 @@ "@babel/plugin-transform-dynamic-import": "^7.23.4", "@babel/plugin-transform-exponentiation-operator": "^7.23.3", "@babel/plugin-transform-export-namespace-from": "^7.23.4", - "@babel/plugin-transform-for-of": "^7.23.3", + "@babel/plugin-transform-for-of": "^7.23.6", "@babel/plugin-transform-function-name": "^7.23.3", "@babel/plugin-transform-json-strings": "^7.23.4", "@babel/plugin-transform-literals": "^7.23.3", @@ -4227,9 +4228,9 @@ } }, "node_modules/browserslist": { - "version": "4.22.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.1.tgz", - "integrity": "sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ==", + "version": "4.22.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.2.tgz", + "integrity": "sha512-0UgcrvQmBDvZHFGdYUehrCNIazki7/lUP3kkoi/r3YB2amZbFM9J43ZRkJTXBUZK4gmx56+Sqk9+Vs9mwZx9+A==", "funding": [ { "type": "opencollective", @@ -4245,9 +4246,9 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001541", - "electron-to-chromium": "^1.4.535", - "node-releases": "^2.0.13", + "caniuse-lite": "^1.0.30001565", + "electron-to-chromium": "^1.4.601", + "node-releases": "^2.0.14", "update-browserslist-db": "^1.0.13" }, "bin": { @@ -4408,9 +4409,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001547", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001547.tgz", - "integrity": "sha512-W7CrtIModMAxobGhz8iXmDfuJiiKg1WADMO/9x7/CLNin5cpSbuBjooyoIUVB5eyCc36QuTVlkVa1iB2S5+/eA==", + "version": "1.0.30001570", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001570.tgz", + "integrity": "sha512-+3e0ASu4sw1SWaoCtvPeyXp+5PsjigkSt8OXZbF9StH5pQWbxEjLAZE3n8Aup5udop1uRiKA7a4utUk/uoSpUw==", "funding": [ { "type": "opencollective", @@ -5381,9 +5382,9 @@ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, "node_modules/electron-to-chromium": { - "version": "1.4.551", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.551.tgz", - "integrity": "sha512-/Ng/W/kFv7wdEHYzxdK7Cv0BHEGSkSB3M0Ssl8Ndr1eMiYeas/+Mv4cNaDqamqWx6nd2uQZfPz6g25z25M/sdw==" + "version": "1.4.612", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.612.tgz", + "integrity": "sha512-dM8BMtXtlH237ecSMnYdYuCkib2QHq0kpWfUnavjdYsyr/6OsAwg5ZGUfnQ9KD1Ga4QgB2sqXlB2NT8zy2GnVg==" }, "node_modules/elliptic": { "version": "6.5.4", @@ -10834,9 +10835,9 @@ "dev": true }, "node_modules/node-releases": { - "version": "2.0.13", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", - "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==" + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", + "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==" }, "node_modules/nodemon": { "version": "2.0.21", diff --git a/package.json b/package.json index 03707928c..f72826a14 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "dependencies": { "@babel/core": "^7.23.5", "@babel/plugin-transform-runtime": "^7.23.6", - "@babel/preset-env": "^7.23.5", + "@babel/preset-env": "^7.23.6", "@babel/preset-react": "^7.23.3", "@googleapis/drive": "^8.4.0", "body-parser": "^1.20.2", From 40542e9bec3c33ba54c93f617300260f281f55ce Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Dec 2023 03:46:17 +0000 Subject: [PATCH 37/43] Bump react-router-dom from 6.20.1 to 6.21.0 Bumps [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom) from 6.20.1 to 6.21.0. - [Release notes](https://github.com/remix-run/react-router/releases) - [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/CHANGELOG.md) - [Commits](https://github.com/remix-run/react-router/commits/react-router-dom@6.21.0/packages/react-router-dom) --- updated-dependencies: - dependency-name: react-router-dom dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 26 +++++++++++++------------- package.json | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index ad1d9f297..209d8609f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,7 +41,7 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "react-frame-component": "^4.1.3", - "react-router-dom": "6.20.1", + "react-router-dom": "6.21.0", "sanitize-filename": "1.6.3", "superagent": "^8.1.2", "vitreum": "git+https://git@github.com/calculuschild/vitreum.git" @@ -2838,9 +2838,9 @@ } }, "node_modules/@remix-run/router": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.13.1.tgz", - "integrity": "sha512-so+DHzZKsoOcoXrILB4rqDkMDy7NLMErRdOxvzvOKb507YINKUP4Di+shbTZDhSE/pBZ+vr7XGIpcOO0VLSA+Q==", + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.14.0.tgz", + "integrity": "sha512-WOHih+ClN7N8oHk9N4JUiMxQJmRVaOxcg8w7F/oHUXzJt920ekASLI/7cYX8XkntDWRhLZtsk6LbGrkgOAvi5A==", "engines": { "node": ">=14.0.0" } @@ -11874,11 +11874,11 @@ "dev": true }, "node_modules/react-router": { - "version": "6.20.1", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.20.1.tgz", - "integrity": "sha512-ccvLrB4QeT5DlaxSFFYi/KR8UMQ4fcD8zBcR71Zp1kaYTC5oJKYAp1cbavzGrogwxca+ubjkd7XjFZKBW8CxPA==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.21.0.tgz", + "integrity": "sha512-hGZ0HXbwz3zw52pLZV3j3+ec+m/PQ9cTpBvqjFQmy2XVUWGn5MD+31oXHb6dVTxYzmAeaiUBYjkoNz66n3RGCg==", "dependencies": { - "@remix-run/router": "1.13.1" + "@remix-run/router": "1.14.0" }, "engines": { "node": ">=14.0.0" @@ -11888,12 +11888,12 @@ } }, "node_modules/react-router-dom": { - "version": "6.20.1", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.20.1.tgz", - "integrity": "sha512-npzfPWcxfQN35psS7rJgi/EW0Gx6EsNjfdJSAk73U/HqMEJZ2k/8puxfwHFgDQhBGmS3+sjnGbMdMSV45axPQw==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.21.0.tgz", + "integrity": "sha512-1dUdVj3cwc1npzJaf23gulB562ESNvxf7E4x8upNJycqyUm5BRRZ6dd3LrlzhtLaMrwOCO8R0zoiYxdaJx4LlQ==", "dependencies": { - "@remix-run/router": "1.13.1", - "react-router": "6.20.1" + "@remix-run/router": "1.14.0", + "react-router": "6.21.0" }, "engines": { "node": ">=14.0.0" diff --git a/package.json b/package.json index b9ae0fc85..81a31672f 100644 --- a/package.json +++ b/package.json @@ -110,7 +110,7 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "react-frame-component": "^4.1.3", - "react-router-dom": "6.20.1", + "react-router-dom": "6.21.0", "sanitize-filename": "1.6.3", "superagent": "^8.1.2", "vitreum": "git+https://git@github.com/calculuschild/vitreum.git" From af20d0b1c2801b90d41ad36def267b2cb73503b1 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Thu, 14 Dec 2023 12:20:50 -0500 Subject: [PATCH 38/43] Make a lot of Markdown tests pass --- shared/naturalcrit/markdown.js | 10 ++-- tests/markdown/mustache-syntax.test.js | 70 +++++++++----------------- 2 files changed, 28 insertions(+), 52 deletions(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 7185cab8e..991dc4c0b 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -45,7 +45,7 @@ const mustacheSpans = { let delim; while (delim = inlineRegex.exec(match[0])) { if(!tags) { - tags = ` ${processStyleTags(delim[0].substring(2))}`; + tags = `${processStyleTags(delim[0].substring(2))}`; endTags = delim[0].length; } if(delim[0].startsWith('{{')) { @@ -95,7 +95,7 @@ const mustacheDivs = { let delim; while (delim = blockRegex.exec(match[0])?.[0].trim()) { if(!tags) { - tags = ` ${processStyleTags(delim.substring(2))}`; + tags = `${processStyleTags(delim.substring(2))}`; endTags = delim.length; } if(delim.startsWith('{{')) { @@ -139,7 +139,7 @@ const mustacheInjectInline = { if(!lastToken || lastToken.type == 'mustacheInjectInline') return false; - const tags = ` ${processStyleTags(match[1])}`; + const tags = `${processStyleTags(match[1])}`; lastToken.originalType = lastToken.type; lastToken.type = 'mustacheInjectInline'; lastToken.tags = tags; @@ -175,7 +175,7 @@ const mustacheInjectBlock = { return false; lastToken.originalType = 'mustacheInjectBlock'; - lastToken.tags = ` ${processStyleTags(match[1])}`; + lastToken.tags = `${processStyleTags(match[1])}`; return { type : 'mustacheInjectBlock', // Should match "name" above raw : match[0], // Text to consume from the source @@ -363,7 +363,7 @@ const processStyleTags = (string)=>{ const id = _.remove(tags, (tag)=>tag.startsWith('#')).map((tag)=>tag.slice(1))[0]; const classes = _.remove(tags, (tag)=>!tag.includes(':')); const styles = tags.map((tag)=>tag.replace(/:"?([^"]*)"?/g, ':$1;')); - return `${classes.join(' ')}" ${id ? `id="${id}"` : ''} ${styles.length ? `style="${styles.join(' ')}"` : ''}`; + return `${classes.length ? ` ${classes.join(' ')}` : ''}"${id ? ` id="${id}"` : ''}${styles.length ? ` style="${styles.join(' ')}"` : ''}`; }; module.exports = { diff --git a/tests/markdown/mustache-syntax.test.js b/tests/markdown/mustache-syntax.test.js index d9e1ce6f9..9141f14ec 100644 --- a/tests/markdown/mustache-syntax.test.js +++ b/tests/markdown/mustache-syntax.test.js @@ -13,109 +13,94 @@ String.prototype.trimReturns = function(){ // Remove the `.failing()` method once you have fixed the issue. describe('Inline: When using the Inline syntax {{ }}', ()=>{ - it.failing('Renders a mustache span with text only', function() { + it('Renders a mustache span with text only', function() { const source = '{{ text}}'; const rendered = Markdown.render(source); - // FIXME: adds extra \s after class names expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('text'); }); - it.failing('Renders a mustache span with text only, but with spaces', function() { + it('Renders a mustache span with text only, but with spaces', function() { const source = '{{ this is a text}}'; const rendered = Markdown.render(source); - // FIXME: adds extra \s after class names expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('this is a text'); }); - it.failing('Renders an empty mustache span', function() { + it('Renders an empty mustache span', function() { const source = '{{}}'; const rendered = Markdown.render(source); - // FIXME: adds extra \s after class names expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(''); }); - it.failing('Renders a mustache span with just a space', function() { + it('Renders a mustache span with just a space', function() { const source = '{{ }}'; const rendered = Markdown.render(source); - // FIXME: adds extra \s after class names expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(''); }); - it.failing('Renders a mustache span with a few spaces only', function() { + it('Renders a mustache span with a few spaces only', function() { const source = '{{ }}'; const rendered = Markdown.render(source); - // FIXME: adds extra \s after class names expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(''); }); - it.failing('Renders a mustache span with text and class', function() { + it('Renders a mustache span with text and class', function() { const source = '{{my-class text}}'; const rendered = Markdown.render(source); - // FIXME: adds two extra \s before closing `>` in opening tag. expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('text'); }); - it.failing('Renders a mustache span with text and two classes', function() { + it('Renders a mustache span with text and two classes', function() { const source = '{{my-class,my-class2 text}}'; const rendered = Markdown.render(source); - // FIXME: adds two extra \s before closing `>` in opening tag. expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('text'); }); - it.failing('Renders a mustache span with text with spaces and class', function() { + it('Renders a mustache span with text with spaces and class', function() { const source = '{{my-class this is a text}}'; const rendered = Markdown.render(source); - // FIXME: adds two extra \s before closing `>` in opening tag expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('this is a text'); }); - it.failing('Renders a mustache span with text and id', function() { + it('Renders a mustache span with text and id', function() { const source = '{{#my-span text}}'; const rendered = Markdown.render(source); - // FIXME: adds extra \s before closing `>` in opening tag, and another after class names expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('text'); }); - it.failing('Renders a mustache span with text and two ids', function() { + it('Renders a mustache span with text and two ids', function() { const source = '{{#my-span,#my-favorite-span text}}'; const rendered = Markdown.render(source); - // FIXME: adds extra \s before closing `>` in opening tag, and another after class names expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('text'); }); - it.failing('Renders a mustache span with text and css property', function() { + it('Renders a mustache span with text and css property', function() { const source = '{{color:red text}}'; const rendered = Markdown.render(source); - // FIXME: adds extra \s after class names expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('text'); }); - it.failing('Renders a mustache span with text and two css properties', function() { + it('Renders a mustache span with text and two css properties', function() { const source = '{{color:red,padding:5px text}}'; const rendered = Markdown.render(source); - // FIXME: adds extra \s after class names expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('text'); }); - it.failing('Renders a mustache span with text and css property which contains quotes', function() { + it('Renders a mustache span with text and css property which contains quotes', function() { const source = '{{font-family:"trebuchet ms" text}}'; const rendered = Markdown.render(source); - // FIXME: adds extra \s after class names expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('text'); }); - it.failing('Renders a mustache span with text and two css properties which contains quotes', function() { + it('Renders a mustache span with text and two css properties which contains quotes', function() { const source = '{{font-family:"trebuchet ms",padding:"5px 10px" text}}'; const rendered = Markdown.render(source); - // FIXME: adds extra \s after class names expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('text'); }); - it.failing('Renders a mustache span with text with quotes and css property which contains quotes', function() { + it('Renders a mustache span with text with quotes and css property which contains quotes', function() { const source = '{{font-family:"trebuchet ms" text "with quotes"}}'; const rendered = Markdown.render(source); - // FIXME: adds extra \s after class names expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('text “with quotes”'); }); @@ -129,21 +114,19 @@ describe('Inline: When using the Inline syntax {{ }}', ()=>{ // BLOCK SYNTAX describe(`Block: When using the Block syntax {{tags\\ntext\\n}}`, ()=>{ - it.failing('Renders a div with text only', function() { + it('Renders a div with text only', function() { const source = dedent`{{ text }}`; const rendered = Markdown.render(source).trimReturns(); - // FIXME: adds extra \s after class names expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

text

`); }); - it.failing('Renders an empty div', function() { + it('Renders an empty div', function() { const source = dedent`{{ }}`; const rendered = Markdown.render(source).trimReturns(); - // FIXME: adds extra \s after class names expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`
`); }); @@ -151,52 +134,46 @@ describe(`Block: When using the Block syntax {{tags\\ntext\\n}}`, ()=>{ const source = dedent`{{ }}`; const rendered = Markdown.render(source).trimReturns(); - // this actually renders in HB as '{{ }}'... expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

{{}}

`); }); - it.failing('Renders a div with a single class', function() { + it('Renders a div with a single class', function() { const source = dedent`{{cat }}`; const rendered = Markdown.render(source).trimReturns(); - // FIXME: adds two extra \s before closing `>` in opening tag expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`
`); }); - it.failing('Renders a div with a single class and text', function() { + it('Renders a div with a single class and text', function() { const source = dedent`{{cat Sample text. }}`; const rendered = Markdown.render(source).trimReturns(); - // FIXME: adds two extra \s before closing `>` in opening tag expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

Sample text.

`); }); - it.failing('Renders a div with two classes and text', function() { + it('Renders a div with two classes and text', function() { const source = dedent`{{cat,dog Sample text. }}`; const rendered = Markdown.render(source).trimReturns(); - // FIXME: adds two extra \s before closing `>` in opening tag expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

Sample text.

`); }); - it.failing('Renders a div with a style and text', function() { + it('Renders a div with a style and text', function() { const source = dedent`{{color:red Sample text. }}`; const rendered = Markdown.render(source).trimReturns(); - // FIXME: adds two extra \s before closing `>` in opening tag expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

Sample text.

`); }); - it.failing('Renders a div with a class, style and text', function() { + it('Renders a div with a class, style and text', function() { const source = dedent`{{cat,color:red Sample text. }}`; const rendered = Markdown.render(source).trimReturns(); - // FIXME: adds extra \s after the class attribute expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

Sample text.

`); }); @@ -208,12 +185,11 @@ describe(`Block: When using the Block syntax {{tags\\ntext\\n}}`, ()=>{ expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

Sample text.

`); }); - it.failing('Renders a div with a single ID', function() { + it('Renders a div with a single ID', function() { const source = dedent`{{#cat,#dog Sample text. }}`; const rendered = Markdown.render(source).trimReturns(); - // FIXME: adds extra \s before closing `>` in opening tag, and another after class names expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

Sample text.

`); }); }); From ef00231c5bc875bccb2ba6d5e72b55db0a68c773 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Thu, 14 Dec 2023 13:46:44 -0500 Subject: [PATCH 39/43] Move tests to the correct section --- tests/markdown/mustache-syntax.test.js | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/tests/markdown/mustache-syntax.test.js b/tests/markdown/mustache-syntax.test.js index e6bb9cee5..bfe6261fc 100644 --- a/tests/markdown/mustache-syntax.test.js +++ b/tests/markdown/mustache-syntax.test.js @@ -110,23 +110,11 @@ describe('Inline: When using the Inline syntax {{ }}', ()=>{ expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('text'); }); - it('Renders an image with added attributes', function() { - const source = dedent`![homebrew mug](https://i.imgur.com/hMna6G0.png) {position:absolute,bottom:20px,left:130px,width:220px,a="b and c",d=e}`; - const rendered = Markdown.render(source).trimReturns(); - expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

homebrew mug

`); - }); - - it('Render a span with added attributes', function() { + it('Renders a span with added attributes', function() { const source = 'Text and {{pen,#author,color:orange,font-family:"trebuchet ms",a="b and c",d=e, text}} and more text!'; const rendered = Markdown.render(source); expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('

Text and text and more text!

\n'); }); - - it('Render a div with added attributes', function() { - const source = '{{pen,#author,color:orange,font-family:"trebuchet ms",a="b and c",d=e\nText and text and more text!\n}}\n'; - const rendered = Markdown.render(source); - expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('

Text and text and more text!

\n
'); - }); }); // BLOCK SYNTAX @@ -219,6 +207,11 @@ describe(`Block: When using the Block syntax {{tags\\ntext\\n}}`, ()=>{ expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

Sample text.

`); }); + it('Renders a div with added attributes', function() { + const source = '{{pen,#author,color:orange,font-family:"trebuchet ms",a="b and c",d=e\nText and text and more text!\n}}\n'; + const rendered = Markdown.render(source); + expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('

Text and text and more text!

\n
'); + }); }); // MUSTACHE INJECTION SYNTAX @@ -279,6 +272,12 @@ describe('Injection: When an injection tag follows an element', ()=>{ const rendered = Markdown.render(source).trimReturns(); expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('

text{background:blue}

'); }); + + it('Renders an image with added attributes', function() { + const source = `![homebrew mug](https://i.imgur.com/hMna6G0.png) {position:absolute,bottom:20px,left:130px,width:220px,a="b and c",d=e}`; + const rendered = Markdown.render(source).trimReturns(); + expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

homebrew mug

`); + }); }); describe('and that element is a block', ()=>{ From 90b4e47861b2773942f64b0fdd794ba095b3dfbe Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Thu, 14 Dec 2023 13:47:36 -0500 Subject: [PATCH 40/43] Fix ' ' removed from processStyleTags regex Removes the case of "empty properties" that needed `.trim()` --- 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 38a6c685b..d88b3aa70 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -354,24 +354,23 @@ const voidTags = new Set([ ]); const processStyleTags = (string)=>{ - //split tags up. quotes can only occur right after colons. + //split tags up. quotes can only occur right after : or =. //TODO: can we simplify to just split on commas? - const tags = string.match(/(?:[^,":=]+|[:=](?:"[^"]*"|))+/g); + const tags = string.match(/(?:[^, ":=]+|[:=](?:"[^"]*"|))+/g); const id = _.remove(tags, (tag)=>tag.startsWith('#')).map((tag)=>tag.slice(1))[0]; const classes = _.remove(tags, (tag)=>(!tag.includes(':')) && (!tag.includes('='))); - console.log(classes); - let attributes = _.remove(tags, (tag)=>(!tag.includes(':')) && (!tag.includes('#'))); + let attributes = _.remove(tags, (tag)=>(!tag.includes(':')) && (!tag.includes('#'))); const styles = tags?.length ? tags.map((tag)=>tag.replace(/:"?([^"]*)"?/g, ':$1;').trim()) : []; if(attributes) { attributes = attributes.map((attr)=>attr.replace(/="?([^"]*)"?/g, '="$1"')); } - return `${classes.join(' ').trim()}" ` + - `${id ? `id="${id}"` : ''} ` + - `${styles?.length ? `style="${styles.join(' ').trim()}"` : ''}` + - `${attributes?.length ? ` ${attributes.join(' ').trim()}` : ''}`; + return `${classes?.length ? ` ${classes.join(' ')}` : ''}"` + + `${id ? ` id="${id}"` : ''}` + + `${styles?.length ? ` style="${styles.join(' ')}"` : ''}` + + `${attributes?.length ? ` ${attributes.join(' ')}` : ''}`; }; module.exports = { From 9b59f47536c3041e9810dd2889a045579e344699 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Thu, 14 Dec 2023 13:58:38 -0500 Subject: [PATCH 41/43] Simplify Attributes parsing logic --- shared/naturalcrit/markdown.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index d88b3aa70..48059e33d 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -360,13 +360,9 @@ const processStyleTags = (string)=>{ const id = _.remove(tags, (tag)=>tag.startsWith('#')).map((tag)=>tag.slice(1))[0]; const classes = _.remove(tags, (tag)=>(!tag.includes(':')) && (!tag.includes('='))); - let attributes = _.remove(tags, (tag)=>(!tag.includes(':')) && (!tag.includes('#'))); + const attributes = _.remove(tags, (tag)=>(tag.includes('='))).map((tag)=>tag.replace(/="?([^"]*)"?/g, '="$1"')); const styles = tags?.length ? tags.map((tag)=>tag.replace(/:"?([^"]*)"?/g, ':$1;').trim()) : []; - if(attributes) { - attributes = attributes.map((attr)=>attr.replace(/="?([^"]*)"?/g, '="$1"')); - } - return `${classes?.length ? ` ${classes.join(' ')}` : ''}"` + `${id ? ` id="${id}"` : ''}` + `${styles?.length ? ` style="${styles.join(' ')}"` : ''}` + From 688377ce0bee1669809d0955d9f67e822b40967e Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Thu, 14 Dec 2023 16:24:23 -0500 Subject: [PATCH 42/43] Fix failing Markdown tests --- tests/markdown/mustache-syntax.test.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tests/markdown/mustache-syntax.test.js b/tests/markdown/mustache-syntax.test.js index 8bbf88763..a8a87fea9 100644 --- a/tests/markdown/mustache-syntax.test.js +++ b/tests/markdown/mustache-syntax.test.js @@ -105,10 +105,9 @@ describe('Inline: When using the Inline syntax {{ }}', ()=>{ }); - it.failing('Renders a mustache span with text with quotes and css property which contains double and simple quotes', function() { + it('Renders a mustache span with text with quotes and css property which contains double and simple quotes', function() { const source = `{{--stringVariable:"'string'" text "with quotes"}}`; const rendered = Markdown.render(source); - // FIXME: adds extra \s after class names expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`text “with quotes”`); }); @@ -118,8 +117,6 @@ describe('Inline: When using the Inline syntax {{ }}', ()=>{ const rendered = Markdown.render(source); expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('text'); }); - - }); // BLOCK SYNTAX @@ -180,12 +177,11 @@ describe(`Block: When using the Block syntax {{tags\\ntext\\n}}`, ()=>{ expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

Sample text.

`); }); - it.failing('Renders a div with a style that has a string variable, and text', function() { + it('Renders a div with a style that has a string variable, and text', function() { const source = dedent`{{--stringVariable:"'string'" Sample text. }}`; const rendered = Markdown.render(source).trimReturns(); - // FIXME: adds two extra \s before closing `>` in opening tag expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

Sample text.

`); }); @@ -194,7 +190,6 @@ describe(`Block: When using the Block syntax {{tags\\ntext\\n}}`, ()=>{ Sample text. }}`; const rendered = Markdown.render(source).trimReturns(); - // FIXME: adds two extra \s before closing `>` in opening tag expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

Sample text.

`); }); From 212b3f7e0530b17cae095e6b48891e505f24a5e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Sat, 16 Dec 2023 16:49:13 +0100 Subject: [PATCH 43/43] full fix --- shared/naturalcrit/codeEditor/codeEditor.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/naturalcrit/codeEditor/codeEditor.jsx b/shared/naturalcrit/codeEditor/codeEditor.jsx index fcfee1dbf..0a99570db 100644 --- a/shared/naturalcrit/codeEditor/codeEditor.jsx +++ b/shared/naturalcrit/codeEditor/codeEditor.jsx @@ -7,7 +7,7 @@ const cx = require('classnames'); const closeTag = require('./close-tag'); let CodeMirror; -if(typeof navigator !== 'undefined'){ +if(typeof window !== 'undefined'){ CodeMirror = require('codemirror'); //Language Modes