Skip to content

Document data does not escape single quotes for JSX. #179

@AdeAttwood

Description

@AdeAttwood

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.


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions