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
5 changes: 2 additions & 3 deletions Development/talagan_ReaImGui Markdown.lua
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
--[[
@description ReaImGui Markdown : A Markdown rendering library for ReaImGui
@version 0.1.9
@version 0.1.10
@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
- [Cosmetics] Realigned checkboxes vertically
- [Hotfix] ImGui context switching not handled properly
- [Optimization] Reduce split function cost (thanks @Arkadata!)
@metapackage
@provides
[nomain] talagan_ReaImGui Markdown/reaimgui_markdown/**/*.lua
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ local function split_into_words_and_spaces(str)
table.insert(result, char)
i = i + 1
else
local word = ""
local word_chars = {} -- Table au lieu de string pour éviter O(n²)

-- Aggregate characters (letters or anything)
while i <= len and not is_white_space(char) do
word = word .. char
table.insert(word_chars, char)
i = i + 1
char = str:sub(i, i)
end
Expand All @@ -118,11 +118,12 @@ local function split_into_words_and_spaces(str)
local next_char = str:sub(next_i, next_i)

if next_i <= len and punctuations[next_char] then
word = word .. " " .. next_char
table.insert(word_chars, " ")
table.insert(word_chars, next_char)
i = next_i + 1
end
end
table.insert(result, word)
table.insert(result, table.concat(word_chars))
end
end

Expand Down