discourse/app
Martin Brennan f3467ee673
FEATURE: Add requestCustomMarkdownCookFunction API (#15753)
This commit adds a requestCustomMarkdownCookFunction function
to the `helper` that is provided to custom markdown rules
via their `setup` function.

The way this works is that once the default markdown engine that
we use for cooking posts has been set up, we loop through all
of the callbacks registered by `requestCustomMarkdownCookFunction`
and call `_buildCustomMarkdownCookFunction`. This creates
a new markdown engine using many of the same settings as the
default one, but will allow for the following options to be
changed by the markdown rule requesting the custom function:

* featuresOverride - The markdown-it features to allow for the engine
* markdownItRules - The markdown-it rules to allow for the engine

After this engine is set up a render function which renders + sanitizes
the output is returned for use by the markdown rule.

The use case for this API is mainly for block BBCode markdown rules
which want to render their content with a limited subset of the
markdown features/rules. Our initial use case for this is chat message
quoting.

This commit also does some minor refactoring of discourse-markdown-it
to accommodate this new engine building.
2022-02-04 09:00:40 +10:00
..
assets FEATURE: Add requestCustomMarkdownCookFunction API (#15753) 2022-02-04 09:00:40 +10:00
controllers DEV: Don't allow users to immediately reinvite (#15722) 2022-02-03 13:07:40 -06:00
helpers DEV: Support for running theme test with Ember CLI (third attempt) 2022-01-13 16:02:07 -05:00
jobs DEV: Fix methods removed in Ruby 3.2 (#15459) 2022-01-05 18:45:08 +01:00
mailers DEV: Hash tokens stored from email_tokens (#14493) 2021-11-25 09:34:39 +02:00
models FIX: Liking whispers should not contribute to Topic#like_count. (#15703) 2022-02-03 16:24:33 +11:00
serializers DEV: Add markdown_additional_options to Site (#15738) 2022-01-28 13:02:02 +10:00
services FIX: Prevent "integer out of range" when merging post timings (#15723) 2022-01-26 23:34:28 +01:00
views DEV: Support for running theme test with Ember CLI (third attempt) 2022-01-13 16:02:07 -05:00