diff --git a/TODO.org b/TODO.org index 5883c6a..80cdecd 100644 --- a/TODO.org +++ b/TODO.org @@ -2,7 +2,6 @@ Writan: - Image support. - Additional error handling in the formatter. - Remove extraneous

tags in output. - - Swap fputc for emit_sanitized_char everywhere. Pages: - Add a category theory page (more general, math). diff --git a/format.c b/format.c index 80da7f7..92eafc4 100644 --- a/format.c +++ b/format.c @@ -69,7 +69,7 @@ emit_heading(FILE *input, FILE *output) char c; while ((c = fgetc(input)) != '\n') - fputc(c, output); + emit_sanitized_char(c, output); fprintf(output, "", level); @@ -226,7 +226,7 @@ emit_code_block(FILE *input, FILE *output) while ((c = fgetc(input)) != ']') { if (c == EOF) die("Unexpected EOF while converting code block."); - fputc(c, output); + emit_sanitized_char(c, output); } fprintf(output, ""); @@ -264,7 +264,7 @@ format(FILE *input, FILE *output) while ((c = fgetc(input)) != EOF) { if (c == '\\') { /* escaped character */ - fputc(fgetc(input), output); + emit_sanitized_char(fgetc(input), output); } else if (c == '*' && lastc == '\n') { /* heading */ emit_heading(input, output); diff --git a/resources/writan-example.txt b/resources/writan-example.txt index 0227f27..7b2bba4 100644 --- a/resources/writan-example.txt +++ b/resources/writan-example.txt @@ -22,3 +22,6 @@ Underneath is a code block. (define (frob x) (frobnicate x)) ] + +> Some profound text someone said once. This is a blockquote. It can occupy +> multiple lines.