There’s no “spoiler text” syntax in Obsidian. Are you using a plugin, HTML, un-styled callout like
> [!spoiler]- Title
> Contents
or similar?
For custom callouts, you can write your own CSS snippet or use a plugin like GitHub - eth-p/obsidian-callout-manager: An Obsidian.md plugin that makes creating and configuring callouts easy.
e.g.