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

Version Path
auto_html-whistlerbrk-2.0.0.pre lib/auto_html/filters/gist.rb
auto_html-1.6.4 lib/auto_html/filters/gist.rb
auto_html-1.6.3 lib/auto_html/filters/gist.rb
auto_html-1.6.2 lib/auto_html/filters/gist.rb