discourse/plugins
Régis Hanol 53b3d2f0dc FIX: BBCode tag parser
Wasn't quite handling the cases where a closing bracket `]` was used in the value of one of the attributes.

```markdown
[chat quote=user channel="[broken]"]
```

Would not be correctly parsed because we would _greedily_ use the first `]` as the end of the tag even though it might be a valid character when inside proper quotes.

c39a4de139/app/assets/javascripts/discourse-markdown-it/src/features/bbcode-block.js (L62)

Re-wrote the `parseBBCodeTag` to properly handle the following cases

- A closing tag (aka `[/name]`) which are easy since they don't have any attributes
- An old `[quote=...]` format we used that doesn't uses quotes but still has various attributes of the form `key:value`
- All three valid BBCode opening tag formats we support
  - `[name]` without any attributes
  - `[name=foo]` with a default value
  - `[name foo=bar]` with some attributes

Ended up having to fix/rewrite the few bbcode rules that were using the `parseBBCodeTag` function, namely `d-wrap` and `discourse-local-dates`.

While working on this, I think I also found a way to get rid the of shims we had in place so that plugins could use the `parseBBCodeTag` function.

Reference - https://meta.discourse.org/t/having-a-right-bracket-in-a-channel-name-breaks-all-quotes-from-that-channel/308439
2024-06-18 10:47:18 +02:00
..
automation Update translations (#27417) 2024-06-11 17:20:39 +02:00
chat UX: remove padding to fix mobile thread date pinning (#27470) 2024-06-14 13:50:27 -04:00
checklist FEATURE: Add Uyghur language (#27183) 2024-05-27 09:58:18 +02:00
discourse-details FEATURE: Add Uyghur language (#27183) 2024-05-27 09:58:18 +02:00
discourse-lazy-videos Update translations (#27274) 2024-05-31 12:27:26 +02:00
discourse-local-dates FIX: BBCode tag parser 2024-06-18 10:47:18 +02:00
discourse-narrative-bot Update translations (#27274) 2024-05-31 12:27:26 +02:00
discourse-presence FEATURE: Add Uyghur language (#27183) 2024-05-27 09:58:18 +02:00
footnote UX: restrict mobile tooltip width to prevent horizontal overflow (#27420) 2024-06-11 10:37:42 -04:00
poll Update translations (#27274) 2024-05-31 12:27:26 +02:00
spoiler-alert FIX: quoting a spoiler 2024-05-28 19:24:52 +02:00
styleguide FEATURE: Add Uyghur language (#27183) 2024-05-27 09:58:18 +02:00