I have created a slashcommand to insert a fenced block but would like to add a trailing newline after.
Based on the Library/Std slashcommands I have come up with:
```space-lua
slashcommand.define {
name = "penny-jar",
exceptContexts = {"FencedCode:space-lua", "LuaDirective"},
run = function()
editor.insertAtCursor([==[```#penny-jar
amount: |^|
reason:
```]==], false, true)
end
}
But adding a \n
after the backticks renders the newline character. I saw in the source that newlines appear to work if part of a string but they don’t appear to within the templating [==[...]==]
syntax.
Additionally, I noticed the fenced block breaks if I have the three backticks on a newline so I can’t simply add a newline myself within the template. Is there anything that SB could do to escape these without rendering the backslashes, as it does if I try this myself?
Loving v2 so far though!