Skip to content

Commit

Permalink
fix: improve markdown render with CRLF (#1953)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexVarchuk authored Apr 27, 2022
1 parent 88e250e commit aba2d1a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/services/MarkdownRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ export class MarkdownRenderer {

attachHeadingsDescriptions(rawText: string) {
const buildRegexp = (heading: MarkdownHeading) => {
return new RegExp(`##?\\s+${heading.name.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&')}\s*\n`);
return new RegExp(
`##?\\s+${heading.name.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&')}\s*(\n|\r\n)`,
);
};

const flatHeadings = this.flattenHeadings(this.headings);
Expand Down

0 comments on commit aba2d1a

Please sign in to comment.