Skip to content

Commit

Permalink
markdown: Fix multiline handling with bold formatting
Browse files Browse the repository at this point in the history
DCO-1.1-Signed-off-by: Ellie <el@horse64.org>
  • Loading branch information
ell1e committed Oct 14, 2023
1 parent de65612 commit 49d960e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
14 changes: 10 additions & 4 deletions implementation/spew3dweb_markdown.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,12 +281,18 @@ static int _spew3d_markdown_process_inline_content(
lineinfo[endline + 1].indentedcontentlen > 0 &&
(LINEC(endline + 1, 0) != '-' || (
lineinfo[endline + 1].indentedcontentlen > 1 &&
LINEC(endline + 1, 1) != '-' &&
LINEC(endline + 1, 2) != ' ')) &&
LINEC(endline + 1, 1) != '-' &&
LINEC(endline + 1, 1) != ' ' &&
LINEC(endline + 1, 1) != '\t')) &&
(LINEC(endline + 1, 0) != '*' || (
lineinfo[endline + 1].indentedcontentlen > 1 &&
LINEC(endline + 1, 1) != '*' &&
LINEC(endline + 1, 2) != ' ')) &&
LINEC(endline + 1, 1) != ' ' &&
LINEC(endline + 1, 1) != '\t' &&
(LINEC(endline + 1, 1) != '*' ||
lineinfo[endline + 1].indentedcontentlen > 2 &&
LINEC(endline + 1, 2) != '*' &&
LINEC(endline + 1, 2) != ' ' &&
LINEC(endline + 1, 2) != '\t'))) &&
(LINEC(endline + 1, 0) != '>' || (
lineinfo[endline + 1].indentedcontentlen > 1 &&
LINEC(endline + 1, 1) != ' ')) &&
Expand Down
11 changes: 11 additions & 0 deletions implementation/test_markdown_nosdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,17 @@ START_TEST(test_markdown_tohtml)
));
free(result);
}
{
result = spew3dweb_markdown_ToHTML(
"- ![](p.png)\n **test**"
);
printf("test_markdown_tohtml result #22: <<%s>>\n", result);
assert(_s3dw_check_html_same(result,
"<ul><li><p><img src='p.png'/> "
"<strong>test</strong></p></li></ul>"
));
free(result);
}
}
END_TEST

Expand Down

0 comments on commit 49d960e

Please sign in to comment.