0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-06 01:22:44 +00:00

Merge branch 'issue_2994_css_style' of github.com:dbolacksn/homebrewery-broken into issue_2994_css_style

This commit is contained in:
dbolack
2024-03-23 18:54:05 -05:00
4 changed files with 414 additions and 356 deletions

756
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -83,8 +83,8 @@
"dependencies": { "dependencies": {
"@babel/core": "^7.24.0", "@babel/core": "^7.24.0",
"@babel/plugin-transform-runtime": "^7.24.0", "@babel/plugin-transform-runtime": "^7.24.0",
"@babel/preset-env": "^7.24.0", "@babel/preset-env": "^7.24.1",
"@babel/preset-react": "^7.23.3", "@babel/preset-react": "^7.24.1",
"@googleapis/drive": "^8.7.0", "@googleapis/drive": "^8.7.0",
"body-parser": "^1.20.2", "body-parser": "^1.20.2",
"classnames": "^2.3.2", "classnames": "^2.3.2",
@@ -107,7 +107,7 @@
"marked-smartypants-lite": "^1.0.2", "marked-smartypants-lite": "^1.0.2",
"markedLegacy": "npm:marked@^0.3.19", "markedLegacy": "npm:marked@^0.3.19",
"moment": "^2.30.1", "moment": "^2.30.1",
"mongoose": "^8.2.2", "mongoose": "^8.2.3",
"nanoid": "3.3.4", "nanoid": "3.3.4",
"nconf": "^0.12.1", "nconf": "^0.12.1",
"react": "^18.2.0", "react": "^18.2.0",

View File

@@ -337,7 +337,7 @@ const definitionListsMultiline = {
const definitions = []; const definitions = [];
while (match = regex.exec(src)) { while (match = regex.exec(src)) {
if(match[1]) { if(match[1]) {
if(this.lexer.blockTokens(match[1].trim())[0].type !== 'paragraph') // DT must not be another block-level token besides <p> if(this.lexer.blockTokens(match[1].trim())[0]?.type !== 'paragraph') // DT must not be another block-level token besides <p>
break; break;
definitions.push({ definitions.push({
dt : this.lexer.inlineTokens(match[1].trim()), dt : this.lexer.inlineTokens(match[1].trim()),

View File

@@ -82,4 +82,10 @@ describe('Multiline Definition Lists', ()=>{
const rendered = Markdown.render(source).trim(); const rendered = Markdown.render(source).trim();
expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('<h2 id="header">Header</h2>\n<dl><dt></dt><dd>Definition 1 of a single-line DL</dd>\n<dt></dt><dd>Definition 1 of another single-line DL</dd>\n</dl>'); expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('<h2 id="header">Header</h2>\n<dl><dt></dt><dd>Definition 1 of a single-line DL</dd>\n<dt></dt><dd>Definition 1 of another single-line DL</dd>\n</dl>');
}); });
test('Inline DL has priority over Multiline', function() {
const source = 'Term 1 :: Inline definition 1\n:: Inline definition 2 (no DT)';
const rendered = Markdown.render(source).trim();
expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('<dl><dt>Term 1</dt><dd>Inline definition 1</dd>\n<dt></dt><dd>Inline definition 2 (no DT)</dd>\n</dl>');
});
}); });