Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Development/talagan_ReaImGui Markdown.lua
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
--[[
@description ReaImGui Markdown : A Markdown rendering library for ReaImGui
@version 0.1.12
@version 0.1.13
@author Ben 'Talagan' Babut
@license MIT
@donation https://www.paypal.com/donate/?business=3YEZMY9D6U8NC&no_recurring=1&currency_code=EUR
@links
Forum Thread https://forum.cockos.com/showthread.php?t=301055
@changelog
- [Bug Fix] Potential while(true) if using a space before a quote block
- [Bug Fix] Fix potential style parameter gardening for dynamic styles (wrong deepCopy implementation)
@metapackage
@provides
[nomain] talagan_ReaImGui Markdown/reaimgui_markdown/**/*.lua
Expand Down
15 changes: 13 additions & 2 deletions Development/talagan_ReaImGui Markdown/reaimgui_markdown.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,19 @@ local function deepMerge(t1, t2)
return t1
end

local function deepCopy(t2)
return deepMerge({}, t2)
local function deepCopy(orig)
local orig_type = type(orig)
local copy
if orig_type == 'table' then
copy = {}
for orig_key, orig_value in next, orig, nil do
copy[deepCopy(orig_key)] = deepCopy(orig_value)
end
setmetatable(copy, deepCopy(getmetatable(orig)))
else -- number, string, boolean, etc
copy = orig
end
return copy
end

local ReaImGuiMd = {}
Expand Down