diff --git a/attributing-content.md b/attributing-content.md index 78040133..5ed180b8 100644 --- a/attributing-content.md +++ b/attributing-content.md @@ -67,27 +67,27 @@ const output = [ "attributes": { "italic": true }, - "attribution": { + "attribution": { // no "insert" attribution: the insertion "Hell" is not attributed to anyone "attributes": { - "italic": [ + "italic": [ // the attribute "italic" was added by Bob "Bob" ] } } }, { - "insert": "o " + "insert": "o " // the insertion "o " has no attributions }, { "insert": "World", - "attribution": { + "attribution": { // the insertion "World" was deleted by Bob "delete": [ "Bob" ] } }, { - "insert": "attributions", + "insert": "attributions", // the insertion "attributions" was inserted by Bob "attribution": { "insert": [ "Bob" @@ -95,7 +95,7 @@ const output = [ } }, { - "insert": "!" + "insert": "!" // the insertion "!" has no attributions } ] ``` diff --git a/src/types/AbstractType.js b/src/types/AbstractType.js index 7f4161d7..a577770f 100644 --- a/src/types/AbstractType.js +++ b/src/types/AbstractType.js @@ -1021,7 +1021,7 @@ export const typeMapGetContent = (parent, am) => { const tmpcs = [] am.readContent(tmpcs, prevItem) cs = tmpcs.concat(cs) - if (cs[0].attrs == null) { + if (cs.length === 0 || cs[0].attrs == null) { cs.splice(0, cs.findIndex(c => c.attrs != null)) break }