Skip to content

Commit

Permalink
markdown: Fix another wrong paragraph length detection issue
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 16, 2023
1 parent 49d960e commit a9a9835
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
11 changes: 6 additions & 5 deletions implementation/spew3dweb_markdown.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,9 @@ static int _spew3d_markdown_process_inline_content(
size_t past_image_idx = 0;

#define LINEC(l, c) \
lineinfo[l].linestart[\
(lineinfo[l].linestart[\
lineinfo[l].indentlen + c\
]
])

while (endline + 1 < endbeforeline &&
!as_code &&
Expand All @@ -299,11 +299,12 @@ static int _spew3d_markdown_process_inline_content(
(LINEC(endline + 1, 0) != '#' || (
lineinfo[endline + 1].indentedcontentlen > 1 &&
LINEC(endline + 1, 1) != '#' &&
LINEC(endline + 1, 1) != ' ')) &&
LINEC(endline + 1, 1) != ' ' &&
LINEC(endline + 1, 1) != '\t')) &&
(LINEC(endline + 1, 0) != '`' || (
lineinfo[endline + 1].indentedcontentlen < 3 && (
lineinfo[endline + 1].indentedcontentlen < 3 ||
LINEC(endline + 1, 1) != '`' ||
LINEC(endline + 1, 2) != '`'))) &&
LINEC(endline + 1, 2) != '`')) &&
(_m2htmlline_line_get_next_line_heading_strength(
lineinfo, lineinfofill, endline + 1) >= 0) &&
(_m2htmlline_start_list_number_len(
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 @@ -676,6 +676,17 @@ START_TEST(test_markdown_tohtml)
));
free(result);
}
{
result = spew3dweb_markdown_ToHTML(
"- abc def\n `hello()` test"
);
printf("test_markdown_tohtml result #23: <<%s>>\n", result);
assert(_s3dw_check_html_same(result,
"<ul><li><p>abc def "
"<code>hello()</code> test</p></li></ul>"
));
free(result);
}
}
END_TEST

Expand Down

0 comments on commit a9a9835

Please sign in to comment.