nihdoc

WIP markup parser (txt -> html)
git clone git://git.alexkarle.com.com/blag
Log | Files | Refs | README | LICENSE

commit b9ec20c72974c8c5e66f152699fe2719bfd25795 (patch)
parent 95420f463d5d944e0c82621b32e71a6d2eb16a27
Author: Alex Karle <alex@alexkarle.com>
Date:   Sat, 18 Dec 2021 15:59:19 -0500

Fix error handling on newline mid-link

I forgot we have a sub-enum state for in_link rather than 'in'!

Diffstat:
Mblag.c | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/blag.c b/blag.c @@ -74,7 +74,10 @@ void handle_lf(state *s) { if (s->in == HEADER) { s->in = NONE; printf("</h%d>", s->hlvl); - } else if (s->in == LINK_URL_PARSE || s->in == LINK_DESC_PARSE) { + } + + /* Guard against newlines when in parsing types */ + if (s->in_link == LINK_URL_PARSE || s->in_link == LINK_DESC_PARSE) { errx(1, "newline detected while processing link"); }