From f5aa37bd5e3ee0905cc6c6ed8f19d8598f22ac51 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Mon, 17 Feb 2025 15:08:47 -0500 Subject: [PATCH 1/5] Change Marked extension to emit
instead of
--- shared/naturalcrit/markdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 99766b536..61ba0669b 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -415,7 +415,7 @@ const forcedParagraphBreaks = { } }, renderer(token) { - return `
`.repeat(token.length).concat('\n'); + return `
`.repeat(token.length).concat('\n'); } }; From 01d93b98d57f1cbf4b973c3c5bb0f858d337ae9e Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Mon, 17 Feb 2025 15:09:04 -0500 Subject: [PATCH 2/5] Remove LESS styling for .blank --- .../notificationPopup/notificationPopup.less | 5 ----- client/homebrew/pages/basePages/uiPage/uiPage.less | 5 ----- themes/V3/5ePHB/style.less | 2 +- themes/V3/Blank/style.less | 11 ----------- 4 files changed, 1 insertion(+), 22 deletions(-) diff --git a/client/homebrew/brewRenderer/notificationPopup/notificationPopup.less b/client/homebrew/brewRenderer/notificationPopup/notificationPopup.less index be642f0fe..6180decc6 100644 --- a/client/homebrew/brewRenderer/notificationPopup/notificationPopup.less +++ b/client/homebrew/brewRenderer/notificationPopup/notificationPopup.less @@ -85,9 +85,4 @@ display : inline-block; width : 100%; } - .blank { - height : 1em; - margin-top : 0; - & + * { margin-top : 0; } - } } \ No newline at end of file diff --git a/client/homebrew/pages/basePages/uiPage/uiPage.less b/client/homebrew/pages/basePages/uiPage/uiPage.less index 913c74a2e..49cb8311d 100644 --- a/client/homebrew/pages/basePages/uiPage/uiPage.less +++ b/client/homebrew/pages/basePages/uiPage/uiPage.less @@ -59,11 +59,6 @@ padding-left : 1.25em; list-style : square; } - .blank { - height : 1em; - margin-top : 0; - & + * { margin-top : 0; } - } } } } \ No newline at end of file diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index ba975e58a..7cdb01a54 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -679,6 +679,7 @@ padding : 2.25cm 1.3cm 2cm 1.3cm; color : #FFFFFF; columns : 1; + line-height : 1.4em; &::after { display : none; } .columnWrapper { width : 7.6cm; } .backCover { @@ -690,7 +691,6 @@ background-repeat : no-repeat; background-size : contain; } - .blank { height : 1.4em; } h1 { margin-bottom : 0.3cm; font-family : 'NodestoCapsCondensed'; diff --git a/themes/V3/Blank/style.less b/themes/V3/Blank/style.less index 65eeee683..1a22db6a7 100644 --- a/themes/V3/Blank/style.less +++ b/themes/V3/Blank/style.less @@ -427,17 +427,6 @@ body { counter-reset : page-numbers 0; } } } -//***************************** -// * BLANK LINE -// *****************************/ -.page { - .blank { - height : 1em; - margin-top : 0; - & + * { margin-top : 0; } - } -} - //***************************** // * WIDE // *****************************/ From fc065d250bfcf707db9b57028adb97e4a7d3ba95 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Mon, 17 Feb 2025 16:27:22 -0500 Subject: [PATCH 3/5] Fix `useSansSerif()` case (monster stat blocks, descriptiven note, etc.) Removed line-height value that affects only
height. Doesn't impact anywhere else because they all have their own explicit line-heights already. --- themes/V3/5ePHB/style.less | 1 - 1 file changed, 1 deletion(-) diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index 7cdb01a54..33ba33ff6 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -17,7 +17,6 @@ .useSansSerif() { font-family : 'ScalySansRemake'; font-size : 0.318cm; - line-height : 1.2em; p,dl,ul,ol { line-height : 1.2em; } ul, ol { padding-left : 1em; } em { font-style : italic; } From 578a8d7eba74b93aa8775dc60d072b105cf915f8 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Wed, 19 Feb 2025 16:00:37 -0500 Subject: [PATCH 4/5] Add `\n` after each `
` --- 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 61ba0669b..3b9f0e9f0 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -415,7 +415,7 @@ const forcedParagraphBreaks = { } }, renderer(token) { - return `
`.repeat(token.length).concat('\n'); + return `
\n`.repeat(token.length); } }; From 0ba943ceb08b8c396ce673621bb7d6f1914d76a1 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Wed, 19 Feb 2025 16:15:31 -0500 Subject: [PATCH 5/5] Update Test Cases --- tests/markdown/definition-lists.test.js | 4 ++-- tests/markdown/hard-breaks.test.js | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/markdown/definition-lists.test.js b/tests/markdown/definition-lists.test.js index 039754ca1..4c754db48 100644 --- a/tests/markdown/definition-lists.test.js +++ b/tests/markdown/definition-lists.test.js @@ -92,12 +92,12 @@ describe('Multiline Definition Lists', ()=>{ test('Multiline Definition Term must have at least one non-empty Definition', function() { const source = 'Term 1\n::'; const rendered = Markdown.render(source).trim(); - expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

Term 1

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

Term 1

\n
\n
`); }); test('Multiline Definition List must have at least one non-newline character after ::', function() { const source = 'Term 1\n::\nDefinition 1\n\n'; const rendered = Markdown.render(source).trim(); - expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

Term 1

\n
\n

Definition 1

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

Term 1

\n
\n
\n

Definition 1

`); }); }); diff --git a/tests/markdown/hard-breaks.test.js b/tests/markdown/hard-breaks.test.js index 8af102716..fe646eac9 100644 --- a/tests/markdown/hard-breaks.test.js +++ b/tests/markdown/hard-breaks.test.js @@ -6,37 +6,37 @@ describe('Hard Breaks', ()=>{ test('Single Break', function() { const source = ':\n\n'; const rendered = Markdown.render(source).trim(); - expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`
`); + expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`
`); }); test('Double Break', function() { const source = '::\n\n'; const rendered = Markdown.render(source).trim(); - expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`
`); + expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`
\n
`); }); test('Triple Break', function() { const source = ':::\n\n'; const rendered = Markdown.render(source).trim(); - expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`
`); + expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`
\n
\n
`); }); test('Many Break', function() { const source = '::::::::::\n\n'; const rendered = Markdown.render(source).trim(); - expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`
`); + expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`
\n
\n
\n
\n
\n
\n
\n
\n
\n
`); }); test('Multiple sets of Breaks', function() { const source = ':::\n:::\n:::'; const rendered = Markdown.render(source).trim(); - expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`
\n
\n
`); + expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`
\n
\n
\n
\n
\n
\n
\n
\n
`); }); test('Break directly between two paragraphs', function() { const source = 'Line 1\n::\nLine 2'; const rendered = Markdown.render(source).trim(); - expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

Line 1

\n
\n

Line 2

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

Line 1

\n
\n
\n

Line 2

`); }); test('Ignored inside a code block', function() {