Sha256: a48a829c5ba032d3ed8a6106316aec959af36551e99fbb9315bca623ed520ca6
Contents?: true
Size: 268 Bytes
Versions: 1
Compression:
Stored size: 268 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 src="https://gist.github.com/#{gist_id}.js"></script>} end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
auto_html-1.6.1 | lib/auto_html/filters/gist.rb |