0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-25 18:23:01 +00:00

Compare commits

..

2 Commits

Author SHA1 Message Date
Trevor Buckner
aa62b32936 handle header padding 2025-03-25 19:36:25 -04:00
Trevor Buckner
4aa5a00a6d test 2025-03-25 18:02:12 -04:00
2 changed files with 5 additions and 14 deletions

View File

@@ -383,14 +383,15 @@ const forcedParagraphBreaks = {
const match = regex.exec(src);
if(match?.length) {
let extraBreak = 0;
const lastToken = tokens[tokens.length - 1];
if(lastToken?.type == 'text')
lastToken.type = 'paragraph';
extraBreak = 1;
return {
type : 'hardBreaks', // Should match "name" above
raw : match[0], // Text to consume from the source
length : match[1].length,
length : match[1].length + extraBreak,
text : ''
};
}
@@ -400,14 +401,6 @@ const forcedParagraphBreaks = {
}
};
const patchHardBreaks = {
walkTokens(token) {
if(token.type == 'list' || token.type == 'list_item') {
token.loose = true;
}
}
}
const nonbreakingSpaces = {
name : 'nonbreakingSpaces',
level : 'inline',
@@ -787,7 +780,6 @@ Marked.use(MarkedVariables());
Marked.use({ extensions : [justifiedParagraphs, definitionListsMultiLine, definitionListsSingleLine, forcedParagraphBreaks,
nonbreakingSpaces, mustacheSpans, mustacheDivs, mustacheInjectInline] });
Marked.use(mustacheInjectBlock);
Marked.use(patchHardBreaks);
Marked.use(MarkedSubSuperText());
Marked.use({ renderer: renderer, tokenizer: tokenizer, mangle: false });
Marked.use(MarkedExtendedTables({interruptPatterns : tableTerminators}), MarkedGFMHeadingId({ globalSlugs: true }),

View File

@@ -57,13 +57,12 @@
ul {
padding-left : 1.4em;
margin-bottom : 0.8em;
line-height : 1.25em;
}
ol {
padding-left : 1.4em;
margin-bottom : 0.8em;
}
.page li p {
line-height : 1.25em;
line-height : 1.25em;
}
//Indents after p or lists
p + p, ul + p, ol + p { text-indent : 1em; }