module Rtml::Links # str_or_sym is the string or symbol to find # id_ref is a boolean: if true, then # is prepended where necessary def id_for(str_or_sym) tml_id = Rtml::Dom::Element.find_or_create_tml_id(str_or_sym) if local?(tml_id) "##{tml_id}" else tml_id end end def local?(str_or_sym) !(str_or_sym.kind_of?(String) && (str_or_sym =~ /\// || str_or_sym =~ /#/ || str_or_sym =~ /:/) || str_or_sym.blank?) end end