mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-23 00:46:16 -04:00
import: Use a Set for supported elements
This commit is contained in:
parent
e31da37d00
commit
09c349e2a1
2 changed files with 6 additions and 6 deletions
|
@ -25,7 +25,7 @@ exports.setPadRaw = (padId, r) => {
|
|||
|
||||
// get supported block Elements from plugins, we will use this later.
|
||||
hooks.callAll('ccRegisterBlockElements').forEach((element) => {
|
||||
supportedElems.push(element);
|
||||
supportedElems.add(element);
|
||||
});
|
||||
|
||||
Object.keys(records).forEach(async (key) => {
|
||||
|
@ -64,7 +64,7 @@ exports.setPadRaw = (padId, r) => {
|
|||
if (value.pool) {
|
||||
for (const attrib of Object.keys(value.pool.numToAttrib)) {
|
||||
const attribName = value.pool.numToAttrib[attrib][0];
|
||||
if (supportedElems.indexOf(attribName) === -1) {
|
||||
if (!supportedElems.has(attribName)) {
|
||||
console.warn('Plugin missing: ' +
|
||||
`You might want to install a plugin to support this node name: ${attribName}`);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue