Sha256: d826bc2023969805d507a841dcadf6c883bfe3d74957848b6f321bc8382717ad
Contents?: true
Size: 586 Bytes
Versions: 30
Compression:
Stored size: 586 Bytes
Contents
module Nexmo module OAS module Renderer module Filters class TutorialLink < Banzai::Filter def call(input) @input = input document.css('a').each_with_index do |link, _index| if link['href']&.start_with?('/tutorials/') link['data-turbolinks'] = 'false' end end @document.to_html end private def document @document ||= Nokogiri::HTML::DocumentFragment.parse(@input) end end end end end end
Version data entries
30 entries across 30 versions & 1 rubygems