From bba9a1d44bd4b00667b4bacc4cce5a594b4e205c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Na=C3=AFm=20Favier?= Date: Wed, 15 Feb 2023 15:25:29 +0100 Subject: [PATCH] Fix fix-xrefs.lua's empty link detection (#618) * Fix `fix-xrefs.lua`'s empty link detection Since we now go directly from Markdown to HTML, Pandoc sees actually empty links instead of `???`. * Bump VERSION --- VERSION | 2 +- flake-info/assets/data/fix-xrefs.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index 7facc89..81b5c5d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -36 +37 diff --git a/flake-info/assets/data/fix-xrefs.lua b/flake-info/assets/data/fix-xrefs.lua index 1761e0c..8119a71 100644 --- a/flake-info/assets/data/fix-xrefs.lua +++ b/flake-info/assets/data/fix-xrefs.lua @@ -12,8 +12,8 @@ function Link(elem) elem.target = 'https://search.nixos.org/options?channel=unstable&show=' .. option_name .. '&query=' .. option_name - if #elem.content == 1 and elem.content[1].tag == 'Str' and elem.content[1].text == '???' then - elem.content[1].text = option_name + if #elem.content == 0 or (#elem.content == 1 and elem.content[1].tag == 'Str' and elem.content[1].text == '???') then + elem.content = option_name end return elem