~sircmpwn/scdoc

76953aa1a56b336a3566fa5c06766b7112de9900 — Cormac Stephenson 23 days ago b9391f0 master
Escape ' at the beginning of lines
1 files changed, 10 insertions(+), 0 deletions(-)

M src/main.c
M src/main.c => src/main.c +10 -0
@@ 248,6 248,13 @@ static void parse_text(struct parser *p) {
				break;
			}
			/* fallthrough */
		case '\'':
			if (!i) {
				// Escape ' if it's the first character
				fprintf(p->output, "\\&'\\&");
				break;
			}
			/* fallthrough */
		case '!':
		case '?':
			last = ch;


@@ 425,6 432,9 @@ static void parse_literal(struct parser *p, int *indent) {
			case '.':
				fprintf(p->output, "\\&.");
				break;
			case '\'':
				fprintf(p->output, "\\&'");
				break;
			case '\\':
				ch = parser_getch(p);
				if (ch == UTF8_INVALID) {