mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
api cleanup for before / after rules
This commit is contained in:
@ -95,14 +95,14 @@ function invalidPoll(state, tag) {
|
||||
const rule = {
|
||||
tag: 'poll',
|
||||
|
||||
before: function(state, attrs, md, raw){
|
||||
before: function(state, tagInfo, raw){
|
||||
let token = state.push('text', '', 0);
|
||||
token.content = raw;
|
||||
token.bbcode_attrs = attrs;
|
||||
token.bbcode_attrs = tagInfo.attrs;
|
||||
token.bbcode_type = 'poll_open';
|
||||
},
|
||||
|
||||
after: function(state, openToken, md, raw) {
|
||||
after: function(state, openToken, raw) {
|
||||
|
||||
let items = getListItems(state.tokens, openToken);
|
||||
if (!items) {
|
||||
@ -153,7 +153,7 @@ const rule = {
|
||||
if (attrs["type"] === "number") {
|
||||
// default values
|
||||
if (isNaN(min)) { min = 1; }
|
||||
if (isNaN(max)) { max = md.options.discourse.pollMaximumOptions; }
|
||||
if (isNaN(max)) { max = state.md.options.discourse.pollMaximumOptions; }
|
||||
if (isNaN(step)) { step = 1; }
|
||||
|
||||
if (items.length > 0) {
|
||||
|
Reference in New Issue
Block a user