mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 08:26:16 -04:00
ImportEtherpad: Use AttributePool to check attributes
This commit is contained in:
parent
19909eae53
commit
5b3575acf0
1 changed files with 5 additions and 3 deletions
|
@ -16,6 +16,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
const AttributePool = require('../../static/js/AttributePool');
|
||||
const {Pad} = require('../db/Pad');
|
||||
const authorManager = require('../db/AuthorManager');
|
||||
const db = require('../db/DB');
|
||||
|
@ -72,11 +73,12 @@ exports.setPadRaw = async (padId, r) => {
|
|||
value.padIDs = {[padId]: 1};
|
||||
} else if (padKeyPrefixes.includes(prefix)) {
|
||||
checkOriginalPadId(id);
|
||||
if (prefix === 'pad' && keyParts.length === 2 && value.pool) {
|
||||
if (prefix === 'pad' && keyParts.length === 2) {
|
||||
const pool = new AttributePool().fromJsonable(value.pool);
|
||||
const unsupportedElements = new Set();
|
||||
for (const [k] of Object.values(value.pool.numToAttrib)) {
|
||||
pool.eachAttrib((k, v) => {
|
||||
if (!supportedElems.has(k)) unsupportedElements.add(k);
|
||||
}
|
||||
});
|
||||
if (unsupportedElements.size) {
|
||||
logger.warn(`(pad ${padId}) unsupported attributes (try installing a plugin): ` +
|
||||
`${[...unsupportedElements].join(', ')}`);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue