# Zola block shortcodes parsing using Custom Syntax

**URL:** https://community.silverbullet.md/t/zola-block-shortcodes-parsing-using-custom-syntax/4196
**Category:** Lua
**Created:** [June 5, 2026, 12:16pm UTC](https://community.silverbullet.md/t/zola-block-shortcodes-parsing-using-custom-syntax/4196 "2026-06-05T12:16:59Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![v3rmine](https://community.silverbullet.md/user_avatar/community.silverbullet.md/v3rmine/32/3624_2.png) [@v3rmine](https://community.silverbullet.md/u/v3rmine)
#### Post date: [June 5, 2026, 12:16pm UTC](https://community.silverbullet.md/t/zola-block-shortcodes-parsing-using-custom-syntax/4196/1 "2026-06-05T12:16:59Z")

</div>

Hi I'm starting to use SilverBullet to edit my Zola website. I successfully added support for inline shortcodes, but when I tried to implement block ones, I couldn't because the regex seems to be applied line by line.

Do you know if it's possible in any way without touching the source code?

Here's the syntax definition, the endMarker regex should support nested shortcodes 3 level deep (if applied after the startMarker is consumed):

```lua
syntax.define {
  name = "ZolaShortcodeBlock",
  startMarker = "{%\\s*(?!end\\s*%)[^%]+%}",
  endMarker = "(?:(?!{%)[\\s\\S])*(?:{%\\s*(?!end\\s*%)[^%]+%}(?:(?!{%)[\\s\\S])*(?:{%\\s*(?!end\\s*%)[^%]+%}(?:(?!{%)[\\s\\S])*(?:{%\\s*(?!end\\s*%)[^%]+%}(?:(?!{%)[\\s\\S])*{%\\s*end\\s*%}(?:(?!{%)[\\s\\S])*)*{%\\s*end\\s*%}(?:(?!{%)[\\s\\S])*)*{%\\s*end\\s*%}(?:(?!{%)[\\s\\S])*)*({%\\s*end\\s*%})",
  mode = "block",
  startMarkerClass = "sb-zola-shortcode-marker",
  --bodyClass = "",
  endMarkerClass = "sb-zola-shortcode-marker",
  --renderClass = "",
  renderWidget = function(body, pageName)
    return widget.html(dom.i { body })
  end,
  renderHtml = function(body, pageName)
    return dom.i { body }
  end
}

```
