Skip to content

Commit

Permalink
Default attribute usage now correctly omits @Usage. Fixes #120
Browse files Browse the repository at this point in the history
  • Loading branch information
raffazizzi committed Mar 16, 2021
1 parent aac2cc4 commit e5f1b98
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/reducers/odd/processAttributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ function createAttribute(attList, att, odd) {
const attDef = odd.createElementNS('http://www.tei-c.org/ns/1.0', 'attDef')
attDef.setAttribute('ident', att.ident)
if (att.usage) {
attDef.setAttribute('usage', att.usage)
if (att.usage === 'def' && attDef.getAttribute('usage')) {
attDef.removeAttribute('usage')
} else if (att.usage !== 'def') {
attDef.setAttribute('usage', att.usage)
}
}
if (att.ns) {
attDef.setAttribute('ns', att.ns)
Expand Down

0 comments on commit e5f1b98

Please sign in to comment.