code: function(markup) {
  
          if (!markup) return undefined;
  
          var fragment = markup.fragment;
          if (!(markup.fragment instanceof DocumentFragment) || !markup.fragment.hasChildNodes()) throw new Error('dia.LinkView: invalid label markup.');
  
          var vNode;
          var childNodes = fragment.childNodes;
  
          if ((childNodes.length > 1) || childNodes[0].nodeName.toUpperCase() !== 'G') {
              // default markup fragment is not wrapped in <g />
              // add a <g /> container
              vNode = V('g').append(fragment);
          } else {
              vNode = V(childNodes[0]);
          }
  
          vNode.addClass('label');
  
          return { node: vNode.node, selectors: markup.selectors };
      }
docs: Label markup fragment may come wrapped in <g class="label" />, or not. If it doesn't, add the <g /> container here.