From 76971f093f3e2990dda2daadfe78f98994758c06 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 31 Dec 2024 19:38:26 +0200 Subject: chore(single): Move sub_match function definition to the top --- single.awk | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'single.awk') diff --git a/single.awk b/single.awk index 69c9f32..ab207a1 100644 --- a/single.awk +++ b/single.awk @@ -56,6 +56,10 @@ function _next() { next } +function sub_match(replacement) { + $0 = substr($0, 1, RSTART - 1) replacement substr($0, RSTART + RLENGTH) +} + function char(string, ind) { if (1 > ind || ind > length(string)) { return ""; @@ -205,9 +209,6 @@ inside_codeblock && ! /^[ \t]*$/ { } # Emphasis -function sub_match(replacement) { - $0 = substr($0, 1, RSTART - 1) replacement substr($0, RSTART + RLENGTH) -} function surround(brace, left, right, blen) { if (blen == "") { blen = length(brace) } if (match($0, brace (brace == "``" ? "." : "[^" brace "]") "+" brace)) { -- cgit v1.3.1-23-gd82d