Sha256: d5fb6326a2222d6ebabe7d684cb6d355870383cdd393a45a0c387cea61b3d5b3

Contents?: true

Size: 725 Bytes

Versions: 21

Compression:

Stored size: 725 Bytes

Contents

module Nexmo
  module OAS
    module Renderer
      module Filters
        class Tooltip < Banzai::Filter
          def call(input)
            input.gsub(/\^\[([a-zA-Z0-9\s:\-]+)\]\((.+?)\)/) do
              tooltip = <<~HEREDOC
                <span class="Vlt-tooltip Vlt-tooltip--top" title="#{$2}" tabindex="0">
                  #{$1}&nbsp;
                  <svg class="Vlt-icon Vlt-icon--smaller Vlt-icon--text-bottom Vlt-blue" aria-hidden="true"><use xlink:href="/assets/symbol/volta-icons.svg#Vlt-icon-help-negative"/></svg>
                </span>
              HEREDOC

              "FREEZESTART#{Base64.urlsafe_encode64(tooltip)}FREEZEEND"
            end
          end
        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
nexmo-oas-renderer-0.7.1 lib/nexmo/oas/renderer/filters/tooltip.rb
nexmo-oas-renderer-0.7.0 lib/nexmo/oas/renderer/filters/tooltip.rb
nexmo-oas-renderer-0.6.6 lib/nexmo/oas/renderer/filters/tooltip.rb
nexmo-oas-renderer-0.6.5 lib/nexmo/oas/renderer/filters/tooltip.rb
nexmo-oas-renderer-0.6.4 lib/nexmo/oas/renderer/filters/tooltip.rb
nexmo-oas-renderer-0.6.3 lib/nexmo/oas/renderer/filters/tooltip.rb
nexmo-oas-renderer-0.6.2 lib/nexmo/oas/renderer/filters/tooltip.rb
nexmo-oas-renderer-0.6.1 lib/nexmo/oas/renderer/filters/tooltip.rb
nexmo-oas-renderer-0.5.6 lib/nexmo/oas/renderer/filters/tooltip.rb
nexmo-oas-renderer-0.5.5 lib/nexmo/oas/renderer/filters/tooltip.rb
nexmo-oas-renderer-0.5.4 lib/nexmo/oas/renderer/filters/tooltip.rb
nexmo-oas-renderer-0.5.2 lib/nexmo/oas/renderer/filters/tooltip.rb
nexmo-oas-renderer-0.5.1 lib/nexmo/oas/renderer/filters/tooltip.rb
nexmo-oas-renderer-0.5.0 lib/nexmo/oas/renderer/filters/tooltip.rb
nexmo-oas-renderer-0.4.1 lib/nexmo/oas/renderer/filters/tooltip.rb
nexmo-oas-renderer-0.4.0 lib/nexmo/oas/renderer/filters/tooltip.rb
nexmo-oas-renderer-0.2.1 lib/nexmo/oas/renderer/filters/tooltip.rb
nexmo-oas-renderer-0.2.0 lib/nexmo/oas/renderer/filters/tooltip.rb
nexmo-oas-renderer-0.1.2 lib/nexmo/oas/renderer/filters/tooltip.rb
nexmo-oas-renderer-0.1.1 lib/nexmo/oas/renderer/filters/tooltip.rb