From 35bd603ba31f002dc974de2b77890cffcb7e9c0e Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Fri, 25 Sep 2026 16:41:34 -0600 Subject: [PATCH] doc/transforms: avoid lua lexer error in luaxform example Pygments 2.21 lexes "x < 0 or x > y" in Lua as a Lua 5.4 variable attribute (e.g. ""), producing an error token on the "0". Sphinx reports this as a highlighting failure warning, and as the PDF build treats warnings as errors, "make dist" fails while building the PDF. Reorder the comparisons so the Lua example is lexed correctly. The logic of the example is unchanged. --- doc/userguide/rules/transforms.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/userguide/rules/transforms.rst b/doc/userguide/rules/transforms.rst index d199bbd999..ae16aafed2 100644 --- a/doc/userguide/rules/transforms.rst +++ b/doc/userguide/rules/transforms.rst @@ -418,12 +418,12 @@ the buffer. end end local str_len = #input - if offset < 0 or offset > str_len then + if offset < 0 or str_len < offset then print("offset is out of bounds: " .. offset) return nil end str_len = str_len - offset - if bytes < 0 or bytes > str_len then + if bytes < 0 or str_len < bytes then print("invalid bytes " .. bytes .. " or bytes > length " .. bytes .. " length " .. str_len) return nil end