Attach UUIDs to Discussion Text (#37)

Three backticks will break the discussion tree, this MR specifically adds custom UUIDs to each text node to avoid this issue.
This commit is contained in:
Harrison (Harry) Cramer
2023-08-15 23:33:52 -04:00
committed by GitHub
parent 4f1a0f9c57
commit 6bb7575c6d
2 changed files with 22 additions and 2 deletions

View File

@@ -137,8 +137,14 @@ end
M.build_note_body = function(note)
local text_nodes = {}
for bodyLine in note.body:gmatch("[^\n]+") do
table.insert(text_nodes, NuiTree.Node({ text = bodyLine, is_body = true }, {}))
local line = u.attach_uuid(bodyLine)
table.insert(text_nodes, NuiTree.Node({
text = line.text,
id = line.id,
is_body = true
}, {}))
end
local noteHeader = "@" ..
note.author.username .. " " .. u.format_date(note.created_at)