class Ollama::Utils::Tags::Tag

def initialize(tag, source: nil)

def initialize(tag, source: nil)
  super(tag.to_s.gsub(/\A#+/, ''))
  self.source = source
end

def to_s(link: true)

def to_s(link: true)
  tag_string = start_with?(?#) ? super() : ?# + super()
  my_source  = source
  if link && my_source
    unless my_source =~ %r(\A(https?|file)://)
      my_source = 'file://%s' % File.expand_path(my_source)
    end
    hyperlink(my_source) { tag_string }
  else
    tag_string
  end
end