Skip to content

Commit

Permalink
Remove normalize as an option per commonmark#190 (commonmark#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuki Izumi authored and jgm committed May 5, 2017
1 parent 12501f1 commit 6313fff
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ $(ALLTESTS): $(SPEC)

leakcheck: $(ALLTESTS)
for format in html man xml latex commonmark; do \
for opts in "" "--smart" "--normalize"; do \
for opts in "" "--smart"; do \
echo "cmark -t $$format $$opts" ; \
valgrind -q --leak-check=full --dsymutil=yes --error-exitcode=1 $(PROG) -t $$format $$opts $(ALLTESTS) >/dev/null || exit 1;\
done; \
Expand Down
14 changes: 1 addition & 13 deletions man/man3/cmark.3
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH cmark 3 "November 18, 2016" "LOCAL" "Library Functions Manual"
.TH cmark 3 "May 05, 2017" "LOCAL" "Library Functions Manual"
.SH
NAME
.PP
Expand Down Expand Up @@ -743,18 +743,6 @@ Render \f[C]softbreak\f[] elements as spaces.
.SS
Options affecting parsing

.PP
.nf
\fC
.RS 0n
#define CMARK_OPT_NORMALIZE (1 << 8)
.RE
\f[]
.fi

.PP
Normalize tree by consolidating adjacent text nodes.

.PP
.nf
\fC
Expand Down
4 changes: 1 addition & 3 deletions src/blocks.c
Original file line number Diff line number Diff line change
Expand Up @@ -1192,9 +1192,7 @@ cmark_node *cmark_parser_finish(cmark_parser *parser) {

finalize_document(parser);

if (parser->options & CMARK_OPT_NORMALIZE) {
cmark_consolidate_text_nodes(parser->root);
}
cmark_consolidate_text_nodes(parser->root);

cmark_strbuf_free(&parser->curline);

Expand Down
4 changes: 0 additions & 4 deletions src/cmark.h
Original file line number Diff line number Diff line change
Expand Up @@ -563,10 +563,6 @@ char *cmark_render_latex(cmark_node *root, int options, int width);
* ### Options affecting parsing
*/

/** Normalize tree by consolidating adjacent text nodes.
*/
#define CMARK_OPT_NORMALIZE (1 << 8)

/** Validate UTF-8 in the input before parsing, replacing illegal
* sequences with the replacement character U+FFFD.
*/
Expand Down
3 changes: 0 additions & 3 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ void print_usage() {
printf(" --nobreaks Render soft line breaks as spaces\n");
printf(" --safe Suppress raw HTML and dangerous URLs\n");
printf(" --smart Use smart punctuation\n");
printf(" --normalize Consolidate adjacent text nodes\n");
printf(" --help, -h Print usage information\n");
printf(" --version Print version\n");
}
Expand Down Expand Up @@ -99,8 +98,6 @@ int main(int argc, char *argv[]) {
options |= CMARK_OPT_SMART;
} else if (strcmp(argv[i], "--safe") == 0) {
options |= CMARK_OPT_SAFE;
} else if (strcmp(argv[i], "--normalize") == 0) {
options |= CMARK_OPT_NORMALIZE;
} else if (strcmp(argv[i], "--validate-utf8") == 0) {
options |= CMARK_OPT_VALIDATE_UTF8;
} else if ((strcmp(argv[i], "--help") == 0) ||
Expand Down

0 comments on commit 6313fff

Please sign in to comment.