Module:Template test case: Difference between revisions

    (guard against possible divide-by-zero errors)
    (use a more MediaWiki-like magic word for the template name)
    Line 5: Line 5:
    local checkType = libraryUtil.checkType
    local checkType = libraryUtil.checkType


    local TEMPLATE_NAME_MAGIC_WORD = '<TEMPLATE_NAME>'
    local TEMPLATE_NAME_MAGIC_WORD = '__TEMPLATENAME__'
    local TEMPLATE_NAME_MAGIC_WORD_ESCAPED = TEMPLATE_NAME_MAGIC_WORD:gsub('%p', '%%%0')
    local TEMPLATE_NAME_MAGIC_WORD_ESCAPED = TEMPLATE_NAME_MAGIC_WORD:gsub('%p', '%%%0')