uwdata / living-papers

Authoring tools for scholarly communication. Create interactive web pages or formal research papers from markdown source.
BSD 3-Clause "New" or "Revised" License
128 stars 10 forks source link

LaTeX doesn't like image URLs with spaces #37

Closed joshuahhh closed 1 year ago

joshuahhh commented 2 years ago

on account of the percent symbols, I reckon!

joshuahhh commented 2 years ago

I was able to hack a solution to this on top of my #34 hack:

async function rewriteImagePaths(ast) {
  visitNodes(ast, node => {
    if (node.name === 'image') {
      setValueProperty(node, 'src', '../../' + getPropertyValue(node, 'src').replace(/%20/g, ' '));
    }
  });
  return ast;
}