# Add custom markdown quote bbcode tags

**URL:** <https://meta.discourse.org/t/add-custom-markdown-quote-bbcode-tags/345910>\
**Category:** Development\
**Tags:** plugin-api\
**Created:** [January 7, 2025, 1:28am UTC](https://meta.discourse.org/t/add-custom-markdown-quote-bbcode-tags/345910 "2025-01-07T01:28:13Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)\
**Post date:** [January 7, 2025, 12:46pm UTC](https://meta.discourse.org/t/add-custom-markdown-quote-bbcode-tags/345910/2 "2025-01-07T12:46:31Z")

</div>

> [@ego-lay\_atman-bay](#):
>
> I have tried looking through the source code for the spoiler plugin, but I can’t figure out what it’s doing to allow quoting spoilers.

I think it’s the DecorateCallBack functions:

> <https://github.com/discourse/discourse/blob/affe26f0dd8ecb9f9adc4024c7d68524a7e6665c/plugins/spoiler-alert/assets/javascripts/initializers/spoiler-alert.js#L30>

Related test:

> <https://github.com/discourse/discourse/blob/affe26f0dd8ecb9f9adc4024c7d68524a7e6665c/plugins/spoiler-alert/test/javascripts/unit/lib/to-markdown-test.js>

To help debug by returning the content of the text on selection, you can `console.log(_selectedText);` after this line in a core file:

> <https://github.com/discourse/discourse/blob/affe26f0dd8ecb9f9adc4024c7d68524a7e6665c/app/assets/javascripts/discourse/app/components/post-text-selection.gjs#L175>

![A screenshot of a browser console interface with various textual elements and a navigation bar. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/0/3/5/0359c41e8161dec60d3b4c4f2ce8044ac1f4f528.gif)

---

_[View the full topic](https://meta.discourse.org/t/add-custom-markdown-quote-bbcode-tags/345910)._
