mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-25 18:23:01 +00:00
Compare commits
2 Commits
Test-BR-li
...
br-fix-two
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aa62b32936 | ||
|
|
4aa5a00a6d |
@@ -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 }),
|
||||
|
||||
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user