From d8a045c91469b1d121b8fd14dffaa367b194831d Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sun, 6 Sep 2026 21:46:52 -1000 Subject: Clean up the whole tree --- custom/extensions/link-commits.lua | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'custom/extensions/link-commits.lua') diff --git a/custom/extensions/link-commits.lua b/custom/extensions/link-commits.lua index 42252f3..8dc0bc3 100644 --- a/custom/extensions/link-commits.lua +++ b/custom/extensions/link-commits.lua @@ -81,8 +81,7 @@ local function collect(text) pcall(function() local init = 1 while init <= #text do - local start, stop, capture = - string.find(text, rule.pattern, init) + local start, stop, capture = string.find(text, rule.pattern, init) if not start then break end if capture == nil then capture = string.sub(text, start, stop) @@ -91,8 +90,7 @@ local function collect(text) start = start, stop = stop, priority = priority, - link = make_link(rule.url, capture, - string.sub(text, start, stop)), + link = make_link(rule.url, capture, string.sub(text, start, stop)), } -- An empty match still has to advance the -- scan, or it never reaches the end. @@ -104,11 +102,9 @@ local function collect(text) local priority = #rules + 1 local init = 1 while init <= #text do - local start, stop, run = - string.find(text, "%f[%w](%x+)%f[%W]", init) + local start, stop, run = string.find(text, "%f[%w](%x+)%f[%W]", init) if not start then break end - if #run >= objects.min_length - and #run <= objects.max_length then + if #run >= objects.min_length and #run <= objects.max_length then candidates[#candidates + 1] = { start = start, stop = stop, @@ -145,8 +141,7 @@ function filter_close() -- A candidate reaching back into one already emitted is -- dropped, so no run of text is ever wrapped twice. if candidate.start >= pos then - out[#out + 1] = - string.sub(text, pos, candidate.start - 1) + out[#out + 1] = string.sub(text, pos, candidate.start - 1) out[#out + 1] = candidate.link pos = candidate.stop + 1 end -- cgit v2.8.0