From ce96dd264fd2385303f48259e5e8d1431d22b91d Mon Sep 17 00:00:00 2001 From: Asko Nõmm Date: Fri, 15 Apr 2022 19:56:01 +0200 Subject: Implement Markdown correction mechanism This fixes the issue for ATX headings and code blocks where if there were no empty lines below and above of them it couldn't correctly identify those blocks as what they were. There's now a Markdown correction function where we can add more of these corrections in the future, making the whole thing a lot easier. --- resources/test/core.md | 9 ++++++++- resources/test/core_result.html | 10 +++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'resources/test') diff --git a/resources/test/core.md b/resources/test/core.md index afc972a..f65b20e 100644 --- a/resources/test/core.md +++ b/resources/test/core.md @@ -83,4 +83,11 @@ This is a H1 heading with settext ================================= And this is a H2 heading with settext -------------------------------------- \ No newline at end of file +------------------------------------- + +Testing paragraph right before a code block +``` +code goes here +``` +# Heading goes here +Paragraph right after heading \ No newline at end of file diff --git a/resources/test/core_result.html b/resources/test/core_result.html index aaad44a..39e8562 100644 --- a/resources/test/core_result.html +++ b/resources/test/core_result.html @@ -58,4 +58,12 @@ function markdownToHTML(markdown) {

This is a H1 heading with settext

-

And this is a H2 heading with settext

\ No newline at end of file +

And this is a H2 heading with settext

+ +

Testing paragraph right before a code block

+ +
code goes here
+ +

Heading goes here

+ +

Paragraph right after heading

\ No newline at end of file -- cgit v1.2.3