XF 2.0 BBCode parser ruleset context?

Sim

Well-known member
I'm having difficulty understanding how the $context and $subContext parameters are used in the BBCode parser ruleset?

I see contexts being supplied like:
  • editor
  • base
  • import
  • post:rss
  • user:signature
  • post
  • conversation_message
... but I can't work out how those contexts affect the parsing or output, given that they don't seem to be used by the ruleset itself, nor does anything else seem to call getContext() on the ruleset object?
 
The last time this came up was to support 3rd party extensions which resulted in these changes before XF2.0.0 release.

My particular use case is I want to render stuff differently depending on the user/post, not the viewer. Essentially; Staff-only bbcode.
 
Thanks @Xon - that thread did explain the context of $context quite well.

For future reference, @Mike's comments here specifically answer my questions:
"Note that BB code rules will not depend on any of the context supplied to the renderer. The rule set defines the known tags and what defines whether a tag is syntactically valid. Contextual validity is generally a render-time decision."​
 
  • Like
Reactions: Xon
Back
Top Bottom