mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-30 17:32:38 +00:00
test
This commit is contained in:
@@ -381,11 +381,17 @@ const forcedParagraphBreaks = {
|
|||||||
tokenizer(src, tokens) {
|
tokenizer(src, tokens) {
|
||||||
const regex = /^(:+)(?:\n|$)/ym;
|
const regex = /^(:+)(?:\n|$)/ym;
|
||||||
const match = regex.exec(src);
|
const match = regex.exec(src);
|
||||||
|
|
||||||
if(match?.length) {
|
if(match?.length) {
|
||||||
|
let extraBreak = 0;
|
||||||
|
const lastToken = tokens[tokens.length - 1];
|
||||||
|
if(lastToken?.type == 'text')
|
||||||
|
extraBreak = 1;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
type : 'hardBreaks', // Should match "name" above
|
type : 'hardBreaks', // Should match "name" above
|
||||||
raw : match[0], // Text to consume from the source
|
raw : match[0], // Text to consume from the source
|
||||||
length : match[1].length,
|
length : match[1].length + extraBreak,
|
||||||
text : ''
|
text : ''
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user