I think it would be cool to add a gist BBC here.
[gist https://gist.github.com/joshuaadickerson/fea8b2dd1a5ca756f6a0[/gist] would become <script src="https://gist.github.com/joshuaadickerson/fea8b2dd1a5ca756f6a0.js"></script> and would embed a gist in the page.
Add a hook on integrate_bbc_codes. Add a new file https://gist.github.com/joshuaadickerson/376d510c9d752e9b290a (a gist)
FYI: I wrote that function in the GH editor and didn't test it.
Cool idea :D
There you go
[gist]https://gist.github.com/joshuaadickerson/376d510c9d752e9b290a[/gist]
I would validate the url starts with "https://gist.github.com", otherwise it would be a risk. ;)
Fair point ... removed it for now to be safe !
'content' => '<script src="https://gist.github.com/$1.js"></script>',
and
$data = parse_url($data, PHP_URL_PATH);
would probably do :/
What exactly is this ?
Redone with that update ...
Now that its back on, just look up in the thread for the example http://www.elkarte.net/community/index.php?topic=2820.msg19268#msg19268
Good catch
@emanuele. Thanks
@Spuds.
Now I think I'm much more likely to use Gist over code tags. Just a nicer way of presenting code and keeping track of the changes.
When I do
[gist]https://gist.github.com/joshuaadickerson/c528aae77d1cf0de029d[/gist]
I get
<script src="https://gist.github.com//joshuaadickerson/c528aae77d1cf0de029d.js"></script>
PS: how do you specify the language for code tags? Or is that not doable anymore?
Thats a big old gist ... looks like an extra / getting added. I'll take a look tommorrow and see whats going on.
I can't remember on the code language, but pretty print is built in for the highlighting these days so it may have been depreciated.
Test:
[gist]https://gist.github.com/joshuaadickerson/c528aae77d1cf0de029d[/gist]
That's probably the longest message I have ever seen... #_#
Yeah, I wonder if gist has a limit
I think it would worth adding it, at least for template sake ;D
Hopefully nobody does something as stupid as I tried to do ;)
You can never tell with coders (and geeks). Breaking things is our pastime :D
I put in a max height so each gist will be a bit better controlled, so at least the page layout is not crazy long.