orgajs
orgajs copied to clipboard
Document data does not escape single quotes for JSX.
When rendering a document in to JSX you cannot use a '
in the title. The resulting JavaScript code results in a syntax error. For example, the following document.
#+TITLE: This don't work
The document ...
Will create the JavaScript.
const title = 'This don't work';
The error can be replicated on the playground, where the JSX and preview tags don't show anything. After a bit of digging, I think it's coming from here. I will try and put together a PR wapping the value in a JSON.stringify
. If you have any other suggestions, let me know.
- https://orga.js.org/playground/?text=%23%2BTITLE%3A%20This%20don't%20work%0A%0AThe%20document%20...%20
- https://github.com/orgapp/orgajs/blob/fe4fe17530247aea60e60aea3097722abd4be389/packages/orgx/src/plugin/rehype-estree.ts