# frozen_string_literal: true module Cosensee class TailwindRenderer # extended renderer for inline SVG text InlineSvgText = Data.define(:content, :project) do include HtmlEncodable def render output = <<~SVG_TEXT_HEADER SVG_TEXT_HEADER content.content.lines.each do |line| tspan_text = if line.strip.empty? ' ' else escape_html(line.chomp) end output << %(#{tspan_text}\n) end output << <<~SVG_TEXT_FOOTER SVG_TEXT_FOOTER output end end end end