Sha256: 6016751f99ef2dde2ced492fa3d6fa81a3d8b4465f86269eee04426a93b9486b
Contents?: true
Size: 291 Bytes
Versions: 4
Compression:
Stored size: 291 Bytes
Contents
AutoHtml.add_filter(:gist).with({}) do |text, options| # E.g. https://gist.github.com/1710276 regex = %r{https?://gist\.github\.com/(\w+/)?(\d+)} text.gsub(regex) do gist_id = $2 %{<script type="text/javascript" src="https://gist.github.com/#{gist_id}.js"></script>} end end
Version data entries
4 entries across 4 versions & 2 rubygems