Skip to content

rescript-highlightjs %% broken formatting #710

@mightystrong

Description

@mightystrong

I was using the rescript-highlightjs.js plugin in a personal project for highlight.js and noticed that %raw( / %%raw(... are being formatted improperly. You can see an example of this on the ReScript website.

https://rescript-lang.org/docs/manual/latest/embed-raw-javascript

Screenshot 2023-08-27 at 2 09 15 PM

I don't have a permanent suggestion, but I was able to make a quick change in my personal project and it worked for my use case by adding the tick marks between the parentheses as below.

      {
        begin: "%%?(`" + RE_ATTRIBUTE + '`)\\(',
        end: '\\s*\\)',
      },
      {
        begin: "%%?(`" + RE_ATTRIBUTE + '`)',
      },

Before:
Screenshot 2023-08-27 at 2 18 16 PM

After:
Screenshot 2023-08-27 at 2 17 44 PM

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