You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
449 B
JavaScript
18 lines
449 B
JavaScript
'use strict';
|
|
|
|
module.exports = function findAlignment(item) {
|
|
if (item.tags == null) {
|
|
return null;
|
|
} else {
|
|
let alignmentTags = item.tags.filter(tag => tag.type === "alignment");
|
|
|
|
if (alignmentTags.length > 0) {
|
|
/* We always want the last-specified alignment tag. */
|
|
// FIXME: Throw an error upon encountering nested alignment tags...
|
|
return alignmentTags[alignmentTags.length - 1].alignment;
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|
|
};
|