4
5
6
7
8
9
10
11
12
13
14
15
|
# File 'lib/nexmo_markdown_renderer/filters/tooltip_filter.rb', line 4
def call(input)
input.gsub(/\^\[([\p{Han}a-zA-Z0-9\s:\-]+)\]\((.+?)\)/) do
tooltip = <<~HEREDOC
<span class="Vlt-tooltip Vlt-tooltip--top" title="#{$2}" tabindex="0">
#{$1}
<svg class="Vlt-icon Vlt-icon--smaller Vlt-icon--text-bottom Vlt-blue" aria-hidden="true"><use xlink:href="/symbol/volta-icons.svg#Vlt-icon-help-negative"/></svg>
</span>
HEREDOC
"FREEZESTART#{Base64.urlsafe_encode64(tooltip)}FREEZEEND"
end
end
|