Skip to content

[gatsby-remark-prismjs] diff with language / highlight #20630

@stephencweiss

Description

@stephencweiss

Hi there!

Trying to understand a few things related to gatsby-remark-prismjs and how it may (or may not) differ from regular prismjs.

The prism site has an example of diff-highlighting and I'm trying to recreate that in my site (here's my post).

Github's preview is a good example of what I'm striving for:
Github Preview

On my site, however, I can't seem to figure out how to get highlights - whether language specific or not:
Screen Shot 2020-01-15 at 2 26 31 PM

I've tried

```diff-javascript
```diff javascript

And several other variants, but to no avail.

Interestingly, diff-javascript results in some weird encoding (note the undefined values that get appended to the ends of lines):

Screen Shot 2020-01-15 at 2 29 23 PM

My questions:

  1. Does gatsby-remark-prismjs support multi-language (diff + javascript for example)?
  2. Does gatsby-remark-prismjs support line-highlighting (with the green/red, not the standard highlighting)?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    stale?Issue that may be closed soon due to the original author not responding any more.type: question or discussionIssue discussing or asking a question about Gatsby

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions