How to modify a raw block without triggering 'maximum show rule depth exceeded'?

The only solution I can think of is to use an additional show rule that hides the forward slashes and to reduce the regex show rule to only match <1>. This is of course far from an elegant solution…

#show raw.where(block: true, lang: "java"): it => {
  show "//": ""
  show regex(" <(\d+)>"): it => {
    // do your string replacement here
  }
  it
}
1 Like