Skip to content

Commit

Permalink
Allow an append anchor to embed a modify container in candidate amend…
Browse files Browse the repository at this point in the history
…ments script
  • Loading branch information
dontcallmedom committed Sep 27, 2022
1 parent 1cd81f1 commit b773bcf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions webrtc.js
Expand Up @@ -74,9 +74,11 @@ async function listAmendments() {
for (let id of Object.keys(amendments)) {
// validate that an amendment is not embedded in another
const container = containerFromId(id);
const embedded = Object.keys(amendments).filter(iid => iid !== id).find(iid => container.querySelector("#" + iid));
if (embedded) {
throw new Error(`The container with id ${id} marked as amended cannot embed the other container of amendment ${embedded}`);
if (amendments[id][0].difftype !== 'append') {
const embedded = Object.keys(amendments).filter(iid => iid !== id).find(iid => container.querySelector("#" + iid));
if (embedded) {
throw new Error(`The container with id ${id} marked as amended cannot embed the other container of amendment ${embedded}`);
}
}
// validate that a section has only one difftype, one amendment type, one amendemnt status
if (amendments[id].some(a => a.difftype && a.difftype !== amendments[id][0].difftype)) {
Expand Down

0 comments on commit b773bcf

Please sign in to comment.