Skip to content

Commit

Permalink
keep newline and replace spaces to prevent setext
Browse files Browse the repository at this point in the history
  • Loading branch information
UziTech committed Apr 13, 2024
1 parent 8ee5c34 commit caeb6ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Tokenizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ export class _Tokenizer {
blockquote(src: string): Tokens.Blockquote | undefined {
const cap = this.rules.block.blockquote.exec(src);
if (cap) {
// replace newline with space before setext continuation
let text = cap[0].replace(/\n *((?:=+|-+) *(?:\n|$))/, ' $1');
// preceded setext continuation with 4 spaces so it isn't a setext
let text = cap[0].replace(/\n {0,3}((?:=+|-+) *(?:\n|$))/, '\n $1');
text = rtrim(text.replace(/^ *>[ \t]?/gm, ''), '\n');
const top = this.lexer.state.top;
this.lexer.state.top = true;
Expand Down

0 comments on commit caeb6ed

Please sign in to comment.