mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 09:42:46 +08:00
FEATURE: consistent bbcode inline and block rulers
This commit is contained in:
@ -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]) {
|
||||
|
Reference in New Issue
Block a user