Forem Creators and Builders 🌱

Tushar Sadhwani
Tushar Sadhwani

Posted on

Add a way to embed github gists with highlighted lines

Github lets you highlight parts of your gist by the following syntax:, to highlight line 7 for example.

Real example:


Trying to embed a file with lines highlighted doesn't seem to work with forem, both with and without the file=filename syntax.

It would be nice if a lines=... attribute could be added to the gist liquid tag, for example:

{% gist file=untrusted-lvl5-solution-js lines=L14-L16 %}

Top comments (2)

michaeltharrington profile image
Michael Tharrington

I could totally see this being very helpful!

ridomin profile image

I also miss the ability to embed a single filename from a gist, seems the file anchor is not supported.

The docs are not very clear neither