From 262f0252386c62ef7fe27f0cf52f39b5b198adde Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Thu, 23 Dec 2021 21:23:17 -0500 Subject: [PATCH] refactor: Move CODE/link check into fmt_disabled This just reads better. --- blag.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blag.c b/blag.c index 4784a5b..081b2fc 100644 --- a/blag.c +++ b/blag.c @@ -117,7 +117,7 @@ void handle_lf(state *s) { bool fmt_disabled(state *s) { /* `` blocks disable all but the next `, likewise CODE makes all disabled */ - if (s->in == CODE) { + if (s->in == CODE || s->in_link == URL_PARSE) { return true; } else { return s->fmts['`'] && s->c != '`'; @@ -125,7 +125,7 @@ bool fmt_disabled(state *s) { } void toggle_format(state *s) { - if (!fmt_disabled(s) && s->in_link != URL_PARSE && s->in != CODE) { + if (!fmt_disabled(s)) { maybe_startp(s); printf("<%s%s>", s->fmts[s->c] ? "/" : "", FMT_STRS[s->c]); s->fmts[s->c] ^= true; -- libgit2 1.1.1