Skip to content

Commit

Permalink
Make block-tag comparison more flexible
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Schridde committed Feb 1, 2017
1 parent c2e7573 commit c9489f8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lustache/renderer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ local html_escape_characters = {
["/"] = "/"
}

local block_tags = {
["#"] = true,
["^"] = true,
}

local function is_array(array)
if type(array) ~= "table" then return false end
local max, n = 0, 0
Expand Down Expand Up @@ -89,7 +94,7 @@ local function nest_tokens(tokens)
local token, section

for i,token in ipairs(tokens) do
if token.type == "#" or token.type == "^" then
if block_tags[token.type] then
token.tokens = {}
sections[#sections+1] = token
collector[#collector+1] = token
Expand Down

0 comments on commit c9489f8

Please sign in to comment.