gatsby icon indicating copy to clipboard operation
gatsby copied to clipboard

feat(gatsby-remark-prismjs): Expose Full Line-Length Diff Highlighting

Open jon-sully opened this issue 4 years ago • 5 comments
trafficstars

Description

@stephencweiss puts the issue fairly succinctly in this comment and the next

This PR aims to fix the issue of not only supporting diff languages but also supporting the last step of adding the diff-highlight class to the code blocks which, along with Prisms stylesheet, will take the best-supported diff-viewing-experience currently available:

image

To a cleaner, full line-length highlighted alternative:

image

Documentation

Updated the README for the newly exposed configuration open. I defaulted it to false although I don't think there's any backwards compatibility immediately broken if set to true (without adding the stylesheet to gatsby-browser, the resulting visual is the same as current)

Related Issues

Fixes #20630

jon-sully avatar Apr 19 '21 17:04 jon-sully

I don't think I'm qualified to actually review whether this works or not (and unfortunately, it looks like there's a failing test), but I'm so excited for this to land! @jon-sully - 1. thank you! 2. please let me know how I can help with the tests.

stephencweiss avatar Apr 20 '21 12:04 stephencweiss

Thanks for the kind words! Happy to help :) It's running great on my blog so I'll be excited to see it go live (hopefully!).

I don't think there are actually any failing tests and I did run the test suite locally with no failures; the CircleCI build is unfortunately failing for what seems like completely tangential reasons? Not sure why that would be happening, but may request maintainer support on that.

image

jon-sully avatar Apr 20 '21 13:04 jon-sully

Hi, any news??

iicdii avatar Mar 02 '22 04:03 iicdii

Hey @iicdii, thanks for the bump! I'd actually forgotten about this one. I'll jump back on it soon 🙂

jon-sully avatar Mar 02 '22 04:03 jon-sully

FYI, this PR is still working fine on the latest versions of Gatsby. I wrote a blog post about the patch I'm using to apply it to the latest release of gatsby-remark-prismjs.

mmazzarolo avatar Aug 29 '22 09:08 mmazzarolo