     unless string of @versions
       version = @nversions++
       @versions[string] =
-        Symbol.parse "#{@key}$v#{version}", result, @dirname
-      @versions[string].setId "#{escapeId @key}$v#{version}"
+        Symbol.parse "#{@key}:v#{version}", result, @dirname
+      @versions[string].setId "#{escapeId @key}:v#{version}"
     @versions[string]
   usesContext: true
 
 ## Symbol to fall back to when encountering an unrecognized symbol.
 ## Path from https://commons.wikimedia.org/wiki/File:Replacement_character.svg
 ## by Amit6, released into the public domain.
-unrecognizedSymbol = new StaticSymbol '$UNRECOGNIZED$', svg: '''
+unrecognizedSymbol = new StaticSymbol ':unrecognized', svg: '''
   <symbol viewBox="0 0 200 200" preserveAspectRatio="none" width="auto" height="auto">
     <rect width="200" height="200" fill="yellow"/>
     <path xmlns="http://www.w3.org/2000/svg" stroke="none" fill="red" d="M 200,100 100,200 0,100 100,0 200,100 z M 135.64709,74.70585 q 0,-13.52935 -10.00006,-22.52943 -9.99999,-8.99999 -24.35289,-8.99999 -17.29415,0 -30.117661,5.29409 L 69.05879,69.52938 q 9.764731,-6.23528 21.52944,-6.23528 8.82356,0 14.58824,4.82351 5.76469,4.82351 5.76469,12.70589 0,8.5883 -9.94117,21.70588 -9.94117,13.11766 -9.94117,26.76473 l 17.88236,0 q 0,-6.3529 6.9412,-14.9412 11.76471,-14.58816 12.82351,-16.35289 6.9412,-11.05887 6.9412,-23.29417 z m -22.00003,92.11771 0,-24.70585 -27.29412,0 0,24.70585 27.29412,0 z"/>
   </symbol>
 '''
-unrecognizedSymbol.setId '$UNRECOGNIZED$' # cannot be output of escapeId()
+unrecognizedSymbol.setId ':unrecognized' # cannot be output of escapeId()
 
 class Input
   @encoding: 'utf8'


escapeId = (key) ->
  ###
  id/href follows the IRI spec [https://tools.ietf.org/html/rfc3987]:
    ifragment      = *( ipchar / "/" / "?" )
    ipchar         = iunreserved / pct-encoded / sub-delims / ":" / "@"
    iunreserved    = ALPHA / DIGIT / "-" / "." / "_" / "~" / ucschar
    pct-encoded    = "%" HEXDIG HEXDIG
    sub-delims     = "!" / "$" / "&" / "'" / "(" / ")"
                   / "*" / "+" / "," / ";" / "="
    ucschar        = %xA0-D7FF / %xF900-FDCF / #%xFDF0-FFEF
                   / %x10000-1FFFD / %x20000-2FFFD / %x30000-3FFFD
                   / %x40000-4FFFD / %x50000-5FFFD / %x60000-6FFFD
                   / %x70000-7FFFD / %x80000-8FFFD / %x90000-9FFFD
                   / %xA0000-AFFFD / %xB0000-BFFFD / %xC0000-CFFFD
                   / %xD0000-DFFFD / %xE1000-EFFFD
  We also want to escape colon (:) which seems to cause trouble.
  We use encodeURIComponent which escapes everything except
    A-Z a-z 0-9 - _ . ! ~ * ' ( )
  [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent]
  Unfortunately, Inkscape seems to ignore any %-encoded symbols; see
  https://bugs.launchpad.net/inkscape/+bug/1737778
  So we replace '%' with '$', an allowed character that's already escaped.
  In the special case of a blank key, we use the special $BLANK$ which cannot
  be generated by the escaping process.
  ###
  (encodeURIComponent key
   .replace /%/g, '$'
  ) or '$BLANK$'

zeroSizeReplacement = 1


        symbol.setAttribute 'viewBox', "0 0 #{width} #{height}"
        symbol.appendChild node
      use.setAttribute 'xlink:href', '#' + inlineImages[attributes]
      false
    ## Lay out the symbols in the drawing via SVG <use>.
    viewBox = [0, 0, 0, 0]  ## initially x-min, y-min, x-max, y-max
