ing
        m[1] + replacement + m[2]
      else # :leading
        m[1] + replacement
      end
    end
  end

  # Internal: Inserts text into a formatted text enclosure; used by xreftext
  alias sub_placeholder sprintf unless RUBY_ENGINE == 'opal'

  # Internal: Parse the attributes that are defined on quoted (aka formatted) text
  #
  # str - A non-nil String of unprocessed attributes;
  #       space-separated roles (e.g., role1 role2) or the id/role shorthand syntax (e.g., #idname.role)
  #
  # Returns