# HG changeset patch # User jbe # Date 1643900063 -3600 # Node ID 27d2a7609cc162b630098647f1853d441a392ecd # Parent e6983d79d74f11ef509e8f79b0aafcb0ed87e2e3 Allow
 tag in util.html_is_safe(...)

diff -r e6983d79d74f -r 27d2a7609cc1 env/util/html_is_safe.lua
--- a/env/util/html_is_safe.lua	Thu Feb 03 15:21:45 2022 +0100
+++ b/env/util/html_is_safe.lua	Thu Feb 03 15:54:23 2022 +0100
@@ -17,6 +17,7 @@
   local heading = false  --  tag open
   local list    = false  -- 
    or
      (but no corresponding
    • ) tag open local listelm = false --
    • tag (but no further
        or
          tag) open + local pre = false --
           tag open
           
             -- Function looped with tail-calls:
             local function loop(str)
          @@ -25,8 +26,8 @@
               --       even if HTML5 allows it.
           
               -- Find any "<" or ">" character and determine context, i.e.
          -    -- pre = text before character, tag = text until closing ">", and rest:
          -    local pre, tag, rest = string.match(str, "^(.-)([<>][^<>]*>?)(.*)")
          +    -- prefix = text before character, tag = text until closing ">", and rest:
          +    local prefix, tag, rest = string.match(str, "^(.-)([<>][^<>]*>?)(.*)")
           
               -- If no more "<" or ">" characters are found,
               -- then return true if all tags have been closed:
          @@ -40,7 +41,7 @@
           
               -- Disallow text content (except inter-element white-space) in 
            or