@Override
 public void writeURIAttribute(String name, Object value, String property) throws IOException {
   if (insideLink) {
     detector.putURIAttribute(name, value, property);
   } else {
     super.writeURIAttribute(name, value, property);
   }
 }
  @Override
  public void endElement(String name) throws IOException {
    writeAttributesFinally(wrapped);

    super.endElement(name);

    if ("link".equals(name)) {
      insideLink = false;
    }
  }
  @Override
  public void startElement(String name, UIComponent component) throws IOException {
    super.startElement(name, component);

    if ("link".equals(name)) {
      insideLink = true;
      detector = new LessStylesheetDetector();
    } else {
      insideLink = false;
    }
  }
 @Override
 public void writeText(Object text, UIComponent component, String property) throws IOException {
   writeAttributesFinally(wrapped);
   super.writeText(text, component, property);
 }
 @Override
 public void writeText(char[] text, int off, int len) throws IOException {
   writeAttributesFinally(wrapped);
   super.writeText(text, off, len);
 }
 @Override
 public void writeComment(Object comment) throws IOException {
   writeAttributesFinally(wrapped);
   super.writeComment(comment);
 }