Skip to content

Commit

Permalink
Support \fig with just filename (#765)
Browse files Browse the repository at this point in the history
SAB support `\fig filename.png\fig*` but the standard requires
`\fig |src="filename.png"\fig*` (and Proskomma breaks without a
caption).
  • Loading branch information
chrisvire authored Jan 9, 2025
1 parent 0335441 commit c517cf7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions convert/convertBooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,13 @@ function removeMissingFigures(text: string, _bcId: string, _bookId: string): str
// Image is missing, return an empty string to strip the \fig marker
return '';
} else {
// Image is present, return the original \fig marker
return match;
if (parts.length < 2) {
// Image is present, but needs formatting that works with Proskomma
return `\\fig NO_CAPTION|src="${imageSource}"\\fig*`;
} else {
// Image is present, return the original \fig marker
return match;
}
}
});
}
Expand Down

0 comments on commit c517cf7

Please sign in to comment.