Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion c-api/include/comrak_ffi.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void comrak_set_extension_option_footnotes(comrak_options_t *options, bool value
void comrak_set_extension_option_description_lists(comrak_options_t *options, bool value);
void comrak_set_extension_option_front_matter_delimiter(comrak_options_t *options, const char *front_matter_delimiter, size_t front_matter_delimiter_len);

void comrak_set_parse_option_superscript(comrak_options_t *options, bool value);
void comrak_set_parse_option_smart(comrak_options_t *options, bool value);
void comrak_set_parse_option_default_info_string(comrak_options_t *options, const char *default_info_string, size_t default_info_string_len);

void comrak_set_render_option_hardbreaks(comrak_options_t *options, bool value);
Expand Down
10 changes: 5 additions & 5 deletions c-api/tests/src/test_comrak_parse_options.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
#include "test_util.h"

void test_commonmark_render_works_with_smart() {
const char* commonmark = "Hello ~~world~~ 世界!";
const char* commonmark = "'Hello,' \"world\" ...";
comrak_options_t * comrak_options = comrak_options_new();

comrak_set_extension_option_strikethrough(comrak_options, false);
comrak_set_parse_option_smart(comrak_options, false);
comrak_str_t html = comrak_commonmark_to_html(commonmark, comrak_options);
const char* expected = "<p>Hello ~~world~~ 世界!</p>\n";
const char* expected = "<p>'Hello,' &quot;world&quot; ...</p>\n";

str_eq(html, expected);

comrak_set_extension_option_strikethrough(comrak_options, true);
comrak_set_parse_option_smart(comrak_options, true);
comrak_str_t html_w_extension = comrak_commonmark_to_html(commonmark, comrak_options);
const char* expected_w_extension = "<p>Hello <del>world</del> 世界!</p>\n";
const char* expected_w_extension = "<p>Hello,’ “world” …</p>\n";

str_eq(html_w_extension, expected_w_extension);

Expand Down