Skip to content

Commit

Permalink
Merge pull request #139 from Omikhleia/fix-propagate-attr-blockquote
Browse files Browse the repository at this point in the history
fix: Propagate Djot attributes to the blockquote implementation
  • Loading branch information
Omikhleia authored Dec 30, 2024
2 parents ef83934 + 75fd989 commit a9a6839
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion inputters/djot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ function Renderer:blockquote (node)
createCommand("caption", {}, caption)
}, pos)
else
out = createCommand("markdown:internal:blockquote", {}, content, pos)
out = createCommand("markdown:internal:blockquote", node.attr or {}, content, pos)
end
if node.attr then
-- Add a div when containing attributes
Expand Down
15 changes: 8 additions & 7 deletions packages/markdown/commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -618,18 +618,19 @@ Please consider using a resilient-compatible class!]])
end
end, "Raw native block in Markdown (internal)")

self:registerCommand("markdown:internal:blockquote", function (_, content)
-- Would be nice NOT having to do this, but SILE's plain class only has a "quote"
-- environment that doesn't really nest, and hard-codes all its values, skips, etc.
self:registerCommand("markdown:internal:blockquote", function (options, content)
-- NOTE: The comment below applies to SILE 0.14.x.
-- SILE's plain class only has a "quote" environment that doesn't really nest, and
-- hard-codes all its values, skips, etc.
-- So we might have a better version provided by a user-class or package.
-- Otherwise, use our own fallback (with hard-coded choices too, but a least
-- it does some proper nesting)
-- NOTE: The above applies to SILE 0.14.x.
-- SILE 0.15 is expected to provide a blockquote environment.
-- SILE 0.15.0 provides a blockquote environment, so eventually this fallback
-- will be removed when we officially drop support for SILE 0.14.x.
if not self.hasCommandSupport.blockquote then
SILE.call("markdown:fallback:blockquote", {}, content)
SILE.call("markdown:fallback:blockquote", options, content)
else
SILE.call("blockquote", {}, content)
SILE.call("blockquote", options, content)
end
end, "Block quote in Markdown (internal)")

Expand Down

0 comments on commit a9a6839

Please sign in to comment.