update: heading id repeat
This commit is contained in:
parent
a0a57ff573
commit
b1660c49f0
|
@ -151,8 +151,7 @@ export default class<T extends HeadingOptions> extends BlockPlugin<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
let id = node.attributes('id');
|
let id = node.attributes('id');
|
||||||
const dataId = node.attributes(DATA_ID);
|
if (!id || $(`[id="${id}"]`).length > 1) {
|
||||||
if (!id || dataId !== id) {
|
|
||||||
id = node.attributes(DATA_ID) || getHashId(node);
|
id = node.attributes(DATA_ID) || getHashId(node);
|
||||||
node.attributes('id', id);
|
node.attributes('id', id);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue