From 38bd3b0fc52586de7d0aba7bbbfc3e5dc100f979 Mon Sep 17 00:00:00 2001 From: David Bolack Date: Tue, 11 Feb 2025 14:34:01 -0600 Subject: [PATCH 01/11] Migrate the justified paragraphs extension to an NPM --- package-lock.json | 10 +++++ package.json | 1 + shared/naturalcrit/markdown.js | 40 ++----------------- .../markdown/paragraph-justification.test.js | 27 ------------- 4 files changed, 14 insertions(+), 64 deletions(-) delete mode 100644 tests/markdown/paragraph-justification.test.js diff --git a/package-lock.json b/package-lock.json index bd3f71491..a57084dc6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,6 +38,7 @@ "marked-emoji": "^1.4.3", "marked-extended-tables": "^1.1.0", "marked-gfm-heading-id": "^4.0.1", + "marked-justified-paragraphs": "^1.0.0", "marked-smartypants-lite": "^1.0.3", "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.30.1", @@ -9874,6 +9875,15 @@ "marked": ">=13 <16" } }, + "node_modules/marked-justified-paragraphs": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/marked-justified-paragraphs/-/marked-justified-paragraphs-1.0.0.tgz", + "integrity": "sha512-TgTKij4HbYy85zWAZ0Va7JCOU/yh8d12Jq2J/jaBHNMa6gJDAsbLT42MFLU9gwLYxsg8hCJHJ0n0zYY6zo8jiA==", + "license": "MIT", + "peerDependencies": { + "marked": ">=3 <16" + } + }, "node_modules/marked-smartypants-lite": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/marked-smartypants-lite/-/marked-smartypants-lite-1.0.3.tgz", diff --git a/package.json b/package.json index 342af4d6e..8c343833d 100644 --- a/package.json +++ b/package.json @@ -113,6 +113,7 @@ "marked-emoji": "^1.4.3", "marked-extended-tables": "^1.1.0", "marked-gfm-heading-id": "^4.0.1", + "marked-justified-paragraphs": "^1.0.0", "marked-smartypants-lite": "^1.0.3", "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.30.1", diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 99766b536..e9ea49d46 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -7,6 +7,7 @@ import MarkedExtendedTables from 'marked-extended-tables'; import { markedSmartypantsLite as MarkedSmartypantsLite } from 'marked-smartypants-lite'; import { gfmHeadingId as MarkedGFMHeadingId, resetHeadings as MarkedGFMResetHeadingIDs } from 'marked-gfm-heading-id'; import { markedEmoji as MarkedEmojis } from 'marked-emoji'; +import MarkedJustifiedParagraphs from 'marked-justified-paragraphs'; //Icon fonts included so they can appear in emoji autosuggest dropdown import diceFont from '../../themes/fonts/iconFonts/diceFont.js'; @@ -362,42 +363,6 @@ const superSubScripts = { }; -const justifiedParagraphClasses = []; -justifiedParagraphClasses[2] = 'Left'; -justifiedParagraphClasses[4] = 'Right'; -justifiedParagraphClasses[6] = 'Center'; - -const justifiedParagraphs = { - name : 'justifiedParagraphs', - level : 'block', - start(src) { - return src.match(/\n(?:-:|:-|-:) {1}/m)?.index; - }, // Hint to Marked.js to stop and check for a match - tokenizer(src, tokens) { - const regex = /^(((:-))|((-:))|((:-:))) .+(\n(([^\n].*\n)*(\n|$))|$)/ygm; - const match = regex.exec(src); - if(match?.length) { - let whichJustify; - if(match[2]?.length) whichJustify = 2; - if(match[4]?.length) whichJustify = 4; - if(match[6]?.length) whichJustify = 6; - return { - type : 'justifiedParagraphs', // Should match "name" above - raw : match[0], // Text to consume from the source - length : match[whichJustify].length, - text : match[0].slice(match[whichJustify].length), - class : justifiedParagraphClasses[whichJustify], - tokens : this.lexer.inlineTokens(match[0].slice(match[whichJustify].length + 1)) - }; - } - }, - renderer(token) { - return `

${this.parser.parseInline(token.tokens)}

`; - } - -}; - - const forcedParagraphBreaks = { name : 'hardBreaks', level : 'block', @@ -795,8 +760,9 @@ const tableTerminators = [ ]; Marked.use(MarkedVariables()); -Marked.use({ extensions : [justifiedParagraphs, definitionListsMultiLine, definitionListsSingleLine, forcedParagraphBreaks, +Marked.use({ extensions : [definitionListsMultiLine, definitionListsSingleLine, forcedParagraphBreaks, nonbreakingSpaces, superSubScripts, mustacheSpans, mustacheDivs, mustacheInjectInline] }); +Marked.use(MarkedJustifiedParagraphs()); Marked.use(mustacheInjectBlock); Marked.use({ renderer: renderer, tokenizer: tokenizer, mangle: false }); Marked.use(MarkedExtendedTables(tableTerminators), MarkedGFMHeadingId({ globalSlugs: true }), diff --git a/tests/markdown/paragraph-justification.test.js b/tests/markdown/paragraph-justification.test.js deleted file mode 100644 index 48b311e85..000000000 --- a/tests/markdown/paragraph-justification.test.js +++ /dev/null @@ -1,27 +0,0 @@ -/* eslint-disable max-lines */ - -import Markdown from 'naturalcrit/markdown.js'; - -describe('Justification', ()=>{ - test('Left Justify', function() { - const source = ':- Hello'; - const rendered = Markdown.render(source); - expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

Hello

`); - }); - test('Right Justify', function() { - const source = '-: Hello'; - const rendered = Markdown.render(source); - expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

Hello

`); - }); - test('Center Justify', function() { - const source = ':-: Hello'; - const rendered = Markdown.render(source); - expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

Hello

`); - }); - - test('Ignored inside a code block', function() { - const source = '```\n\n:- Hello\n\n```\n'; - const rendered = Markdown.render(source); - expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`
\n:- Hello\n
\n`); - }); -}); From 80564dd8dbde43f34282f0795334e41beec0e751 Mon Sep 17 00:00:00 2001 From: David Bolack Date: Tue, 11 Feb 2025 15:01:20 -0600 Subject: [PATCH 02/11] Remove relocated tests from executiomn --- .circleci/config.yml | 3 --- package.json | 1 - 2 files changed, 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c195df81c..2025e8fe7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -73,9 +73,6 @@ jobs: - run: name: Test - Non-Breaking Spaces command: npm run test:non-breaking-spaces - - run: - name: Test - Paragraph Justification - command: npm run test:paragraph-justification - run: name: Test - Variables command: npm run test:variables diff --git a/package.json b/package.json index 8c343833d..b93fe21f2 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,6 @@ "test:definition-lists": "jest tests/markdown/definition-lists.test.js --verbose --noStackTrace", "test:hard-breaks": "jest tests/markdown/hard-breaks.test.js --verbose --noStackTrace", "test:non-breaking-spaces": "jest tests/markdown/non-breaking-spaces.test.js --verbose --noStackTrace", - "test:paragraph-justification": "jest tests/markdown/paragraph-justification.test.js --verbose --noStackTrace", "test:emojis": "jest tests/markdown/emojis.test.js --verbose --noStackTrace", "test:route": "jest tests/routes/static-pages.test.js --verbose", "test:safehtml": "jest tests/html/safeHTML.test.js --verbose", From 09ac8b8a3258a5bd8663cc1ee111f9507b56e2d0 Mon Sep 17 00:00:00 2001 From: David Bolack Date: Wed, 12 Feb 2025 22:57:53 -0600 Subject: [PATCH 03/11] Move definition list tokens to an extension --- .circleci/config.yml | 3 -- package-lock.json | 41 +++++++++++++++ package.json | 2 +- shared/naturalcrit/markdown.js | 91 ++-------------------------------- 4 files changed, 45 insertions(+), 92 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2025e8fe7..85e2ccb9b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -64,9 +64,6 @@ jobs: - run: name: Test - Mustache Spans command: npm run test:mustache-syntax - - run: - name: Test - Definition Lists - command: npm run test:definition-lists - run: name: Test - Hard Breaks command: npm run test:hard-breaks diff --git a/package-lock.json b/package-lock.json index add91f28e..a6acfde55 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,6 +35,7 @@ "less": "^3.13.1", "lodash": "^4.17.21", "marked": "13.0.3", + "marked-definition-lists": "^1.0.0", "marked-emoji": "^1.4.3", "marked-extended-tables": "^1.1.0", "marked-gfm-heading-id": "^4.0.1", @@ -73,6 +74,37 @@ "npm": "^10.2.x" } }, + "../marked-definition-lists": { + "version": "1.0.0", + "extraneous": true, + "license": "MIT", + "devDependencies": { + "@babel/core": "^7.26.0", + "@babel/preset-env": "^7.26.0", + "@markedjs/testutils": "^15.0.0-0", + "@rollup/plugin-commonjs": "^28.0.2", + "@rollup/plugin-node-resolve": "^16.0.0", + "@semantic-release/changelog": "^6.0.3", + "@semantic-release/commit-analyzer": "^13.0.0", + "@semantic-release/git": "^10.0.1", + "@semantic-release/github": "^11.0.1", + "@semantic-release/npm": "^12.0.1", + "@semantic-release/release-notes-generator": "^14.0.2", + "babel-jest": "^29.5.0", + "eslint": "^8.57.1", + "eslint-config-standard": "^17.1.0", + "eslint-plugin-import": "^2.31.0", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^6.6.0", + "jest-cli": "^29.7.0", + "marked": "^15.0.4", + "rollup": "^4.29.2", + "semantic-release": "^24.2.0" + }, + "peerDependencies": { + "marked": ">=3 <16" + } + }, "node_modules/@ampproject/remapping": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", @@ -9846,6 +9878,15 @@ "node": ">= 18" } }, + "node_modules/marked-definition-lists": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/marked-definition-lists/-/marked-definition-lists-1.0.0.tgz", + "integrity": "sha512-ymeRwE/LiPCFMdZpihl9HP/jPqoWW4rp+g312Fh5RGfg5XWgbFgwXAhgf72Wc7FK56blY274B2seNq/UF0eY8w==", + "license": "MIT", + "peerDependencies": { + "marked": ">=3 <16" + } + }, "node_modules/marked-emoji": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/marked-emoji/-/marked-emoji-1.4.3.tgz", diff --git a/package.json b/package.json index 0097e5313..b8973ac1e 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,6 @@ "test:mustache-syntax:inline": "jest \".*(mustache-syntax).*\" -t '^Inline:.*' --verbose --noStackTrace", "test:mustache-syntax:block": "jest \".*(mustache-syntax).*\" -t '^Block:.*' --verbose --noStackTrace", "test:mustache-syntax:injection": "jest \".*(mustache-syntax).*\" -t '^Injection:.*' --verbose --noStackTrace", - "test:definition-lists": "jest tests/markdown/definition-lists.test.js --verbose --noStackTrace", "test:hard-breaks": "jest tests/markdown/hard-breaks.test.js --verbose --noStackTrace", "test:non-breaking-spaces": "jest tests/markdown/non-breaking-spaces.test.js --verbose --noStackTrace", "test:emojis": "jest tests/markdown/emojis.test.js --verbose --noStackTrace", @@ -109,6 +108,7 @@ "less": "^3.13.1", "lodash": "^4.17.21", "marked": "13.0.3", + "marked-definition-lists": "^1.0.0", "marked-emoji": "^1.4.3", "marked-extended-tables": "^1.1.0", "marked-gfm-heading-id": "^4.0.1", diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 99766b536..417efb512 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -7,6 +7,7 @@ import MarkedExtendedTables from 'marked-extended-tables'; import { markedSmartypantsLite as MarkedSmartypantsLite } from 'marked-smartypants-lite'; import { gfmHeadingId as MarkedGFMHeadingId, resetHeadings as MarkedGFMResetHeadingIDs } from 'marked-gfm-heading-id'; import { markedEmoji as MarkedEmojis } from 'marked-emoji'; +import MarkedDefinitionLists from 'marked-definition-lists'; //Icon fonts included so they can appear in emoji autosuggest dropdown import diceFont from '../../themes/fonts/iconFonts/diceFont.js'; @@ -440,93 +441,6 @@ const nonbreakingSpaces = { } }; -const definitionListsSingleLine = { - name : 'definitionListsSingleLine', - level : 'block', - start(src) { return src.match(/\n[^\n]*?::[^\n]*/m)?.index; }, // Hint to Marked.js to stop and check for a match - tokenizer(src, tokens) { - const regex = /^([^\n]*?)::([^\n]*)(?:\n|$)/ym; - let match; - let endIndex = 0; - const definitions = []; - while (match = regex.exec(src)) { - const originalLine = match[0]; // This line and below to handle conflict with emojis - let firstLine = originalLine; // Remove in V4 when definitionListsInline updated to - this.lexer.inlineTokens(firstLine.trim()) // require spaces around `::` - .filter((t)=>t.type == 'emoji') - .map((emoji)=>firstLine = firstLine.replace(emoji.raw, 'x'.repeat(emoji.raw.length))); - - const newMatch = /^([^\n]*?)::([^\n]*)(?:\n|$)/ym.exec(firstLine); - if(newMatch) { - definitions.push({ - dt : this.lexer.inlineTokens(originalLine.slice(0, newMatch[1].length).trim()), - dd : this.lexer.inlineTokens(originalLine.slice(newMatch[1].length + 2).trim()) - }); - } // End of emoji hack. - endIndex = regex.lastIndex; - } - if(definitions.length) { - return { - type : 'definitionListsSingleLine', - raw : src.slice(0, endIndex), - definitions - }; - } - }, - renderer(token) { - return `
${token.definitions.reduce((html, def)=>{ - return `${html}
${this.parser.parseInline(def.dt)}
` - + `
${this.parser.parseInline(def.dd)}
\n`; - }, '')}
`; - } -}; - -const definitionListsMultiLine = { - name : 'definitionListsMultiLine', - level : 'block', - start(src) { return src.match(/\n[^\n]*\n::[^:\n]/m)?.index; }, // Hint to Marked.js to stop and check for a match - tokenizer(src, tokens) { - const regex = /(\n?\n?(?!::)[^\n]+?(?=\n::[^:\n]))|\n::([^:\n](?:.|\n)*?(?=(?:\n::)|(?:\n\n)|$))/y; - let match; - let endIndex = 0; - const definitions = []; - while (match = regex.exec(src)) { - if(match[1]) { - if(this.lexer.blockTokens(match[1].trim())[0]?.type !== 'paragraph') // DT must not be another block-level token besides

- break; - definitions.push({ - dt : this.lexer.inlineTokens(match[1].trim()), - dds : [] - }); - } - if(match[2] && definitions.length) { - definitions[definitions.length - 1].dds.push( - this.lexer.inlineTokens(match[2].trim().replace(/\s/g, ' ')) - ); - } - endIndex = regex.lastIndex; - } - if(definitions.length) { - return { - type : 'definitionListsMultiLine', - raw : src.slice(0, endIndex), - definitions - }; - } - }, - renderer(token) { - let returnVal = `

`; - token.definitions.forEach((def)=>{ - const dds = def.dds.map((s)=>{ - return `\n
${this.parser.parseInline(s).trim()}
`; - }).join(''); - returnVal += `
${this.parser.parseInline(def.dt)}
${dds}\n`; - }); - returnVal = returnVal.trim(); - return `${returnVal}
`; - } -}; - //v=====--------------------< Variable Handling >-------------------=====v// 242 lines const replaceVar = function(input, hoist=false, allowUnresolved=false) { const regex = /([!$]?)\[((?!\s*\])(?:\\.|[^\[\]\\])+)\]/g; @@ -795,7 +709,8 @@ const tableTerminators = [ ]; Marked.use(MarkedVariables()); -Marked.use({ extensions : [justifiedParagraphs, definitionListsMultiLine, definitionListsSingleLine, forcedParagraphBreaks, +Marked.use(MarkedDefinitionLists()); +Marked.use({ extensions : [justifiedParagraphs, forcedParagraphBreaks, nonbreakingSpaces, superSubScripts, mustacheSpans, mustacheDivs, mustacheInjectInline] }); Marked.use(mustacheInjectBlock); Marked.use({ renderer: renderer, tokenizer: tokenizer, mangle: false }); From f3315d654e394635a6a0dc073c3ed3a52452faa6 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Fri, 21 Feb 2025 14:37:33 -0500 Subject: [PATCH 04/11] tabs to spaces --- 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 e9ea49d46..1d0730d4d 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -7,7 +7,7 @@ import MarkedExtendedTables from 'marked-extended-tables'; import { markedSmartypantsLite as MarkedSmartypantsLite } from 'marked-smartypants-lite'; import { gfmHeadingId as MarkedGFMHeadingId, resetHeadings as MarkedGFMResetHeadingIDs } from 'marked-gfm-heading-id'; import { markedEmoji as MarkedEmojis } from 'marked-emoji'; -import MarkedJustifiedParagraphs from 'marked-justified-paragraphs'; +import MarkedJustifiedParagraphs from 'marked-justified-paragraphs'; //Icon fonts included so they can appear in emoji autosuggest dropdown import diceFont from '../../themes/fonts/iconFonts/diceFont.js'; From de18a53efe1a481d5a9347fde1500ce2468e4245 Mon Sep 17 00:00:00 2001 From: David Bolack Date: Fri, 28 Feb 2025 17:03:51 -0600 Subject: [PATCH 05/11] Update markd-definition-lists --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9e0a8da0c..a38fb0c90 100644 --- a/package.json +++ b/package.json @@ -108,7 +108,7 @@ "less": "^3.13.1", "lodash": "^4.17.21", "marked": "13.0.3", - "marked-definition-lists": "^1.0.0", + "marked-definition-lists": "^1.0.1", "marked-emoji": "^1.4.3", "marked-extended-tables": "^1.1.0", "marked-gfm-heading-id": "^4.0.1", From 519da0a5c033480dda34f96b5a5bd56e8d91faef Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Mon, 14 Apr 2025 16:44:25 -0400 Subject: [PATCH 06/11] Remove incorrect extension calls --- shared/naturalcrit/markdown.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index e00bca205..a9740652b 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -765,8 +765,8 @@ const tableTerminators = [ ]; Marked.use(MarkedVariables()); -Marked.use({ extensions : [justifiedParagraphs, definitionListsMultiLine, definitionListsSingleLine, forcedParagraphBreaks, - nonbreakingSpaces, mustacheSpans, mustacheDivs, mustacheInjectInline] }); +Marked.use({ extensions : [definitionListsMultiLine, definitionListsSingleLine, forcedParagraphBreaks, + mustacheSpans, mustacheDivs, mustacheInjectInline] }); Marked.use(mustacheInjectBlock); Marked.use(MarkedAlignedParagraphs()); Marked.use(MarkedSubSuperText()); From 2589e6d919b4ab10bf390caccfea217302306cfd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Apr 2025 21:36:06 +0000 Subject: [PATCH 07/11] Bump nconf from 0.12.1 to 0.13.0 Bumps [nconf](https://github.com/flatiron/nconf) from 0.12.1 to 0.13.0. - [Release notes](https://github.com/flatiron/nconf/releases) - [Changelog](https://github.com/indexzero/nconf/blob/v0.13.0/CHANGELOG.md) - [Commits](https://github.com/flatiron/nconf/compare/v0.12.1...v0.13.0) --- updated-dependencies: - dependency-name: nconf dependency-version: 0.13.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 49 +++++++++++++++++++++++++++++++---------------- package.json | 2 +- 2 files changed, 34 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4633936df..82c599f7b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,7 +45,7 @@ "moment": "^2.30.1", "mongoose": "^8.13.2", "nanoid": "5.1.5", - "nconf": "^0.12.1", + "nconf": "^0.13.0", "react": "^18.3.1", "react-dom": "^18.3.1", "react-frame-component": "^4.1.3", @@ -393,12 +393,12 @@ } }, "node_modules/@babel/parser": { - "version": "7.26.10", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.10.tgz", - "integrity": "sha512-6aQR2zGE/QFi8JpDLjUZEPYOs7+mhKXm86VaKFiLP35JQwQb6bwUE+XbvkH0EptsYhbNBSUGaUBLKqxH1xSgsA==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.0.tgz", + "integrity": "sha512-iaepho73/2Pz7w2eMS0Q5f83+0RKI7i4xmiYeBmDzfRVbQtTOG7Ts0S4HzJVsTMGI9keU8rNfuZr8DKfSt7Yyg==", "license": "MIT", "dependencies": { - "@babel/types": "^7.26.10" + "@babel/types": "^7.27.0" }, "bin": { "parser": "bin/babel-parser.js" @@ -1690,14 +1690,14 @@ } }, "node_modules/@babel/template": { - "version": "7.26.9", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.26.9.tgz", - "integrity": "sha512-qyRplbeIpNZhmzOysF/wFMuP9sctmh2cFzRAZOn1YapxBsE1i9bJIY586R/WBLfLcmcBlM8ROBiQURnnNy+zfA==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.0.tgz", + "integrity": "sha512-2ncevenBqXI6qRMukPlXwHKHchC7RyMuu4xv5JBXRfOGVcTy1mXCD12qrp7Jsoxll1EV3+9sE4GugBVRjT2jFA==", "license": "MIT", "dependencies": { "@babel/code-frame": "^7.26.2", - "@babel/parser": "^7.26.9", - "@babel/types": "^7.26.9" + "@babel/parser": "^7.27.0", + "@babel/types": "^7.27.0" }, "engines": { "node": ">=6.9.0" @@ -1731,9 +1731,9 @@ } }, "node_modules/@babel/types": { - "version": "7.26.10", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.10.tgz", - "integrity": "sha512-emqcG3vHrpxUKTrxcblR36dcrcoRDvKmnL/dCL6ZsHaShW80qxCAcNhzQZrpeM765VzEos+xOi4s+r4IXzTwdQ==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.0.tgz", + "integrity": "sha512-H45s8fVLYjbhFH62dIJ3WtmJ6RSPt/3DRO0ZcT2SUiYiQyz3BLVb9ADEnLl91m74aQPS3AzzeajZHYOalWe3bg==", "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.25.9", @@ -3904,6 +3904,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "file-uri-to-path": "1.0.0" + } + }, "node_modules/bn.js": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", @@ -6451,6 +6461,13 @@ "node": ">=16.0.0" } }, + "node_modules/file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "license": "MIT", + "optional": true + }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", @@ -10686,9 +10703,9 @@ "license": "MIT" }, "node_modules/nconf": { - "version": "0.12.1", - "resolved": "https://registry.npmjs.org/nconf/-/nconf-0.12.1.tgz", - "integrity": "sha512-p2cfF+B3XXacQdswUYWZ0w6Vld0832A/tuqjLBu3H1sfUcby4N2oVbGhyuCkZv+t3iY3aiFEj7gZGqax9Q2c1w==", + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/nconf/-/nconf-0.13.0.tgz", + "integrity": "sha512-hJ/u2xCpA663h6xyOiztx3y+lg9eU0rdkwJ+c4FtiHo2g/gB0sjXtW31yTdMLWLOIj1gL2FcJMwfOqouuUK/Wg==", "license": "MIT", "dependencies": { "async": "^3.0.0", diff --git a/package.json b/package.json index 4eb617d7c..43b239e0c 100644 --- a/package.json +++ b/package.json @@ -119,7 +119,7 @@ "moment": "^2.30.1", "mongoose": "^8.13.2", "nanoid": "5.1.5", - "nconf": "^0.12.1", + "nconf": "^0.13.0", "react": "^18.3.1", "react-dom": "^18.3.1", "react-frame-component": "^4.1.3", From 8f4c74d0cef68e84d8948358b9235e59465bd884 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Tue, 15 Apr 2025 19:36:35 +1200 Subject: [PATCH 08/11] Add print-specific styling for facing and flow page layouts --- client/homebrew/brewRenderer/brewRenderer.less | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/client/homebrew/brewRenderer/brewRenderer.less b/client/homebrew/brewRenderer/brewRenderer.less index 128c419be..b0a3e9779 100644 --- a/client/homebrew/brewRenderer/brewRenderer.less +++ b/client/homebrew/brewRenderer/brewRenderer.less @@ -68,12 +68,16 @@ @media print { .toolBar { display : none; } .brewRenderer { - height : 100%; - padding-top : unset; - overflow-y : unset; + height : 100%; + padding : unset; + overflow-y : unset; + &:has(.facing, .flow) { + padding : unset; + } .pages { - margin : 0px; - zoom : 100% !important; + margin : 0px; + zoom : 100% !important; + display : block; & > .page { box-shadow : unset; } } } From b72357096a58ff4729c3badb03d43c6c6fa1c20c Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Tue, 15 Apr 2025 14:58:16 +0000 Subject: [PATCH 09/11] Rebuild package-lock --- package-lock.json | 41 +++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4633936df..3a3f7eafa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -393,12 +393,12 @@ } }, "node_modules/@babel/parser": { - "version": "7.26.10", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.10.tgz", - "integrity": "sha512-6aQR2zGE/QFi8JpDLjUZEPYOs7+mhKXm86VaKFiLP35JQwQb6bwUE+XbvkH0EptsYhbNBSUGaUBLKqxH1xSgsA==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.0.tgz", + "integrity": "sha512-iaepho73/2Pz7w2eMS0Q5f83+0RKI7i4xmiYeBmDzfRVbQtTOG7Ts0S4HzJVsTMGI9keU8rNfuZr8DKfSt7Yyg==", "license": "MIT", "dependencies": { - "@babel/types": "^7.26.10" + "@babel/types": "^7.27.0" }, "bin": { "parser": "bin/babel-parser.js" @@ -1690,14 +1690,14 @@ } }, "node_modules/@babel/template": { - "version": "7.26.9", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.26.9.tgz", - "integrity": "sha512-qyRplbeIpNZhmzOysF/wFMuP9sctmh2cFzRAZOn1YapxBsE1i9bJIY586R/WBLfLcmcBlM8ROBiQURnnNy+zfA==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.0.tgz", + "integrity": "sha512-2ncevenBqXI6qRMukPlXwHKHchC7RyMuu4xv5JBXRfOGVcTy1mXCD12qrp7Jsoxll1EV3+9sE4GugBVRjT2jFA==", "license": "MIT", "dependencies": { "@babel/code-frame": "^7.26.2", - "@babel/parser": "^7.26.9", - "@babel/types": "^7.26.9" + "@babel/parser": "^7.27.0", + "@babel/types": "^7.27.0" }, "engines": { "node": ">=6.9.0" @@ -1731,9 +1731,9 @@ } }, "node_modules/@babel/types": { - "version": "7.26.10", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.10.tgz", - "integrity": "sha512-emqcG3vHrpxUKTrxcblR36dcrcoRDvKmnL/dCL6ZsHaShW80qxCAcNhzQZrpeM765VzEos+xOi4s+r4IXzTwdQ==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.0.tgz", + "integrity": "sha512-H45s8fVLYjbhFH62dIJ3WtmJ6RSPt/3DRO0ZcT2SUiYiQyz3BLVb9ADEnLl91m74aQPS3AzzeajZHYOalWe3bg==", "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.25.9", @@ -3904,6 +3904,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "file-uri-to-path": "1.0.0" + } + }, "node_modules/bn.js": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", @@ -6451,6 +6461,13 @@ "node": ">=16.0.0" } }, + "node_modules/file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "license": "MIT", + "optional": true + }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", From 8e3ccec855f83e62cd23f9293b3eebb50c3360f8 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Tue, 15 Apr 2025 15:29:53 -0400 Subject: [PATCH 10/11] Remove old references to extensions --- shared/naturalcrit/markdown.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index f9a089100..bd5e2076e 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -680,8 +680,7 @@ const tableTerminators = [ Marked.use(MarkedVariables()); Marked.use(MarkedDefinitionLists()); -Marked.use({ extensions : [justifiedParagraphs, forcedParagraphBreaks, - nonbreakingSpaces, mustacheSpans, mustacheDivs, mustacheInjectInline] }); +Marked.use({ extensions : [forcedParagraphBreaks, mustacheSpans, mustacheDivs, mustacheInjectInline] }); Marked.use(mustacheInjectBlock); Marked.use(MarkedAlignedParagraphs()); Marked.use(MarkedSubSuperText()); From fe2f5a405cf15fe434207472769508462ed7a912 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Thu, 17 Apr 2025 15:31:25 -0400 Subject: [PATCH 11/11] Update package-lock.json --- package-lock.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/package-lock.json b/package-lock.json index 82c599f7b..ddf8d7138 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,6 +35,7 @@ "lodash": "^4.17.21", "marked": "15.0.8", "marked-alignment-paragraphs": "^1.0.0", + "marked-definition-lists": "^1.0.1", "marked-emoji": "^2.0.0", "marked-extended-tables": "^2.0.1", "marked-gfm-heading-id": "^4.0.1", @@ -10006,6 +10007,15 @@ "marked": ">=3 <16" } }, + "node_modules/marked-definition-lists": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/marked-definition-lists/-/marked-definition-lists-1.0.1.tgz", + "integrity": "sha512-+fBAbGbVnGNNkCLMTnieReZ+gq14iCF0rBc1BBMGDDqnKeImxdvoV9kB8xRTVW4ZH5BPp6XLVykUZW0icsvZTw==", + "license": "MIT", + "peerDependencies": { + "marked": ">=3 <16" + } + }, "node_modules/marked-emoji": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/marked-emoji/-/marked-emoji-2.0.0.tgz",