Skip to content

Commit

Permalink
feat(export.markdown) add footnote support (#1383)
Browse files Browse the repository at this point in the history
  • Loading branch information
esquires authored May 23, 2024
1 parent 0aa3eaf commit b81e05a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lua/neorg/modules/core/export/markdown/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,23 @@ module.public = {
tag_close = nil,
ranged_tag_indentation_level = 0,
is_url = false,
footnote_count = 0,
}
end,

functions = {

["single_footnote"] = function(_, node, state)
state['footnote_count'] = state['footnote_count'] + 1
for nd in node:iter_children() do
if nd:type() == 'paragraph' then
local n = state['footnote_count']
return "[^" .. n .. "]\n\n\n[^" .. n .. "]: " .. module.required["core.integrations.treesitter"].get_node_text(nd)
end
end
return ""
end,

["_word"] = true,
["_space"] = true,

Expand Down

0 comments on commit b81e05a

Please sign in to comment.