Html comments are not supported · Issue #5 · dodoas/stringjsx · GitHub
Skip to content

Html comments are not supported #5

Open

Description

@odinhb

If you put this in your code:

<!-- this is a html comment -->

Most some tools will choke on it. Here is esbuild:

✘ [ERROR] Expected identifier but found "!"

Also mentioned here: developit#15

Activity

  1. odinhb commented on Mar 12, 2024

    @odinhb
    Author

    I'm thinking this could be supported as part of the transformation if the package was redone as a compiler plugin.

  2. odinhb commented on Mar 12, 2024

    @odinhb
    Author

    wongchichong's fork seems to support html comments in some form, but I don't think this will work with most tools? I'm not confident enough to pull it in anyway.

    developit#39

  3. odinhb commented on Mar 12, 2024

    @odinhb
    Author

    Note: comments are supported in jsx, but they don't appear in the output and look like this:

    {/*this is a javascript comment*/}
  4. jcubic commented on Apr 29, 2024

    @jcubic

    Note that <!-- comments --> are invalid JSX, so none of the JSX libraries support such syntax.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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