anchor.diff:              tag = spaceless(1: index(spaceless, ' ') - 1)
               if (index(tag, '.') > 0 .and. index(tag, '.') < index(tag, '(')) then
                 tag = tag(1: index(tag, '.') - 1)
  -              className = spaceless(index(spaceless, '.') : index(spaceless, ' '))
  +              className = spaceless(index(spaceless, '.') : index(spaceless, '(') - 1)
               endif
               if (index(tag, '#') > 0 .and. index(tag, '#') < index(tag, '(')) then
                 tag = tag(1: index(tag, '#') - 1)
  -              elemID = elemID(index(spaceless, '#') : index(spaceless, ' '))
  +              elemID = spaceless(index(spaceless, '#') : index(spaceless, '(') - 1)
  +            endif
  +            if (index(tag, '(') == 0) then
  +              if (index(tag, '#') > 0) then
  +                elemID = tag(index(tag, '#') : index(tag, ' '))
  +                tag = tag(1: index(tag, '#') - 1)
  +              endif
  +              if (index(tag, '.') > 0) then
  +                className = tag(index(tag, '.') : index(tag, ' '))
  +                tag = tag(1: index(tag, '.') - 1)
  +              endif
               endif
             endif
           endif
         endif
   
         ! handle multiple classes
  +      call string_replace(className, '.', ' ')
         call string_replace(className, '.', ' ')
         ! just make sure I don't leave a # in the ID
         call string_replace(elemID, '#', '')
  
positive.code:         tag = 'div'
          className = spaceless(2: index(spaceless, ' ') - 1)
          if (index(className, '(') > 0) then
            className = className(1 : index(className, '#') - 1)
          endif
          if (index(className, '#') > 0) then
  
negative.code:           tag = 'div'
            elemID = spaceless(2: index(spaceless, ' ') - 1)
            if (index(elemID, '(') > 0) then
              tag = trim(tag) // elemID( index(elemID, '(') : index(elemID, ')'))
              elemID = elemID(1 : index(elemID, '#') - 1)
            endif
            if (index(elemID, '.') > 0) then
  