Skip to content

Commit

Permalink
Improving download button filter.
Browse files Browse the repository at this point in the history
  • Loading branch information
Clément authored and Clément committed Jan 21, 2025
1 parent e67cbb2 commit 6145036
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions source/templates/filters/add-links-to-projects.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ return {
{
CodeBlock = function(el)
if el.attributes.download ~= nil then
link = el.attributes.download
el.attributes.download=nil
link = el.attributes.download -- We save the link before removing this attribute from the element.
el.attributes.download=nil -- removing the download attribute from the element altogether.
return {
el,
pandoc.Link(
pandoc.Emph("(Download this code)"),
link,
"Download a project containing this snippet.",
{class = "download-button"}
"Download a project containing this snippet."
-- , {class = "download-button"} -- unfortunately, Quartz (Github Flavored Markdown // Obsidian Flavored Markdown)
-- does not seem to support classes.
)
}
end
Expand Down

0 comments on commit 6145036

Please sign in to comment.