Sha256: 97013d83a43608eaa27071f40ee253b2a2a292bf91d6223d332d971e667d7dae
Contents?: true
Size: 328 Bytes
Versions: 15
Compression:
Stored size: 328 Bytes
Contents
module InlineSvgHelper def inline_svg_tag(filename, title: nil) svg = ViteInlineSvgFileLoader.named(filename) svg = svg.sub(/\A<svg/, '<svg role="img"') svg = svg.sub(/\A<svg.*?>/, safe_join(['\0', "\n", tag.title(title)])) if title.present? svg.strip.html_safe # rubocop:disable Rails/OutputSafety end end
Version data entries
15 entries across 15 versions & 1 rubygems