Module:HtmlBuilder/options

From Minetest
< Module:HtmlBuilder
Revision as of 09:37, 7 June 2022 by >FnControlOption (FnControlOption changed the content model of the page Module:HtmlBuilder/options from "plain text" to "Scribunto")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:HtmlBuilder/options/doc

local options = {
    uniqPrefix = '\x7fUNIQ-',
    uniqSuffix = '-QINU\x7f',
    htmlencodeMap = {
        ['>'] = '&gt;',
        ['<'] = '&lt;',
        ['&'] = '&amp;',
        ['"'] = '&quot;',
    }
}
options.encodedUniqPrefixPat = string.gsub( options.uniqPrefix, '[<>&"]', options.htmlencodeMap );
options.encodedUniqPrefixPat = string.gsub( options.encodedUniqPrefixPat, '%p', '%%%0' );
options.uniqPrefixRepl = string.gsub( options.uniqPrefix, '%%', '%%%0' );
options.encodedUniqSuffixPat = string.gsub( options.uniqSuffix, '[<>&"]', options.htmlencodeMap );
options.encodedUniqSuffixPat = string.gsub( options.encodedUniqSuffixPat, '%p', '%%%0' );
options.uniqSuffixRepl = string.gsub( options.uniqSuffix, '%%', '%%%0' );
return options