lib/tocer/transformers/text.rb in tocer-15.0.0 vs lib/tocer/transformers/text.rb in tocer-15.1.0
- old
+ new
@@ -1,7 +1,8 @@
# frozen_string_literal: true
+require "core"
require "refinements/arrays"
module Tocer
module Transformers
# Transforms a Markdown header (plain text) into a table of contents link.
@@ -20,10 +21,10 @@
private
attr_reader :parser
- def computed_url(suffix = "") = [url, suffix.to_s].compress.join("-")
+ def computed_url(suffix = Core::EMPTY_STRING) = [url, suffix.to_s].compress.join("-")
def indented_bullet = prefix_to_spaces.gsub(/\s{2}$/, "- ")
def prefix_to_spaces = Array.new(parser.prefix.length, " ").join
end