code: private void parseAnnotatableText(String text, Element parent) {
  	  AnnotationNode annotation = null;
  	  Matcher matcher = AnnotationParser.WIDGET_ANNOTATION_REGEX.matcher(text);
  
  	  int previousEnd = 0;
  	  while (matcher.find()){
  		  int start = matcher.start();
  
  		  // build a new text node for what is between last index and current annotation
  		  if (start > previousEnd)	{
  			  String segment = text.substring(previousEnd, start);
  			  // ignore empty white space
  			  if (segment.trim().length() > 0){
  				  addTextNodeToParent (segment, parent, annotation);
  				  annotation = null;
  			  }
  		  }
  
  		  // parse the annotation
  		  String annotationText = matcher.group().trim();
  		  if (null != annotationText) {
  		      annotation = new AnnotationNode(annotationText);
  		      lines(annotation, annotationText);
  		  }
  		  previousEnd = matcher.end();
  	  }
  	  
  	  // handle leftover text if we parsed some segment
  	  if (previousEnd > 0 && previousEnd < text.length()){
  		  String segment = text.substring(previousEnd);
  		  if (segment.trim().length() > 0){
  			  addTextNodeToParent (segment, parent, annotation);
  			  annotation = null;
  		  }
  	  }
  	  
  	  // store the remaining annotation for use by whatever is parsed next
  	  if (annotation != null)
  		  add(annotation);
  	  
  	  // handle no annotations being found
  	  if (previousEnd == 0){
  		  Node dataNode;
  		  if (parent.tagName().equals(titleTag) || parent.tagName().equals(textareaTag))
  	        dataNode = TextNode.createFromEncoded(text, baseUri);
  	      else // data not encoded but raw (for " in script)
  	        dataNode = new DataNode(text, baseUri);
  	      lines(dataNode, text);
  	      
  	      if (pendingAnnotation != null)
  	          pendingAnnotation.apply(dataNode);
  	      
  		  // put the text node on the parent
  		  parent.appendChild(dataNode);
  	  }
    }
docs: Pulls a text segment apart by annotations within it and creates multiple Text Nodes
  applying the annotation to each text segment as approriate.
  
  @param text the text to be processed for annotations
  @param parent