mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FEATURE: consistent bbcode inline and block rulers
This commit is contained in:
parent
234694b50f
commit
05e5a740a6
3 changed files with 76 additions and 20 deletions
|
@ -26,11 +26,11 @@ function createHelper(featureName, opts, optionCallbacks, pluginCallbacks, getOp
|
|||
// hack to allow moving of getOptions
|
||||
helper.getOptions = () => getOptions.f();
|
||||
|
||||
helper.registerOptions = function(callback){
|
||||
helper.registerOptions = (callback) => {
|
||||
optionCallbacks.push([featureName, callback]);
|
||||
};
|
||||
|
||||
helper.registerPlugin = function(callback){
|
||||
helper.registerPlugin = (callback) => {
|
||||
pluginCallbacks.push([featureName, callback]);
|
||||
};
|
||||
|
||||
|
@ -57,6 +57,10 @@ function setupBlockBBCode(md) {
|
|||
md.block.bbcode_ruler = new Ruler();
|
||||
}
|
||||
|
||||
function setupInlineBBCode(md) {
|
||||
md.inline.bbcode_ruler = new Ruler();
|
||||
}
|
||||
|
||||
export function setup(opts, siteSettings, state) {
|
||||
if (opts.setup) {
|
||||
return;
|
||||
|
@ -117,6 +121,7 @@ export function setup(opts, siteSettings, state) {
|
|||
});
|
||||
|
||||
setupBlockBBCode(opts.engine);
|
||||
setupInlineBBCode(opts.engine);
|
||||
|
||||
pluginCallbacks.forEach(([feature, callback])=>{
|
||||
if (opts.discourse.features[feature]) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue