caption-spoilerblock-basic

A ^ line immediately after a SpoilerBlock closing ^^^ sets caption on the SpoilerBlock node

§6.2 · source

Input

^^^
Plot twist: the butler did it.
^^^
^ Spoiler for __The Mystery at Thornfield__

Output AST

- type: SpoilerBlock
  caption:
    - type: Text
      value: "Spoiler for "
    - type: Emphasis
      children:
        - type: Text
          value: The Mystery at Thornfield
  children:
    - type: Paragraph
      children:
        - type: Text
          value: "Plot twist: the butler did it."