Skip to content

Commit

Permalink
Merge pull request #98 from atusy/horizontal-rule
Browse files Browse the repository at this point in the history
fix(ast): avoid error on HorizontalRule with a fallback and a warning
  • Loading branch information
atusy authored Feb 26, 2024
2 parents 0df4aaf + ae160d7 commit 862c502
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions R/pandoc.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ lua_filters <- function(.sep = "\n\n") {
c(
lua("smart.lua"),
lua("inline-code.lua"),
lua("horizontal-rule.lua"),
if (rmarkdown::pandoc_available("2.7.3")) {
c(
lua("math.lua"),
Expand Down
7 changes: 7 additions & 0 deletions inst/lua/horizontal-rule.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function HorizontalRule(el)
warn(
"HorizontalRule is unsupported and fallbacks to three hyphens (---) "
.. "regardless of the input string (e.g., `-------`, `***`, and `_ _ _`)"
)
return pandoc.Para({ pandoc.Str("---") })
end

0 comments on commit 862c502

Please sign in to comment.