Closed GaryJones closed 1 year ago
I've thought about this a bit in the past and I'm not sure it'll work with the data we have currently. Everything we're working with has already been processed for display and kinda relies on the style sheet to look decent. The one way it could possibly work is if we removed the line numbers when rendering in a feed, but I haven't tried this yet.
Otherwise, we'd need to fetch the raw code using the API, which would require oAuth for private Gists, then take care of all the custom file and line processing we're doing on the existing data.
I've not looked into it, but I was envisaging removing the line numbers, and then stripping all but line-breaking-related tags. I'm certainly not expecting syntax highlighting, which is what most of the markup would be for. Ideally to leave something like still readable:
<pre>
<code>
Some <em>escaped</em> code here<br />
...
</code>
</pre>
=>
Some <em>escaped</em> code here
...
Hmm, I didn't think about stripping the HTML. That seems like a much more viable approach if the white space can be preserved.
Since we've usually cached the gist content, we should look how we can output this in a way that makes sense in feeds. This should be for feeds used pulled in and shown with RSS clients, but also in RSS-to-email services too.