Skip to content

Commit aee8322

Browse files
fix(import): ana attribute removed from material element when it has no values
1 parent 8de5632 commit aee8322

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

packages/etl/src/petrography-import.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ export function updateMaterialElement(xml, entry) {
3232
attrs = attrs.replace(/\s+resp="[^"]*"/g, "");
3333

3434
// Build the new leading attributes (ana first, matching EpiDoc conventions)
35-
let leading = ` ana="${entry.ana}"`;
35+
let leading = ''
36+
if (entry.ana.trim().length) {
37+
leading += ` ana="${entry.ana}"`;
38+
}
3639
leading += ` type="${entry.type}"`;
3740
leading += ` subtype="${entry.subtype}"`;
3841
if (entry.addCoccatoResp) leading += ` resp="#Coccato"`;

0 commit comments

Comments
 (0)