Skip to content

Commit

Permalink
feat: add alt text to generated latex images
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz committed Jan 23, 2024
1 parent c4290ef commit fd401bf
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/compiler/src/output/latex/tex-format.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,9 @@ export class TexFormat {

image(ast) {
const src = sanitizeFile(getPropertyValue(ast, 'src'));
// TODO: find best way to incorporate alt text
// const alt = getPropertyValue(ast, 'alt');
const alt = getPropertyValue(ast, 'alt');
const arg = getImageParams(ast);
return `\\includegraphics[${arg}]{${src}}`;
return `\\includegraphics[${arg}${alt ? `,alt={${alt}}` : ''}]{${src}}`;
}

quoted(ast) {
Expand Down

0 comments on commit fd401bf

Please sign in to comment.