lib/tocer/transformers/link.rb in tocer-15.0.0 vs lib/tocer/transformers/link.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 (embedded link) 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 embedded_link = "[#{embedded_link_label}](#{embedded_link_url})"
def embedded_link_label = parser.content[/\[(.*)\]/, 1]