code: func (parser *Parser) getRawPages(rawReader io.Reader, pages chan<- []byte) {
  	reader := bufio.NewReader(rawReader)
  
  	buffer := make([]byte, 0)
  	inPage := false
  
  	eof := false
  
  	for !eof {
  		text, err := reader.ReadBytes('>')
  		parser.BytesProcessed += int64(len(text))
  
  		if err != nil {
  			if err == io.EOF {
  				eof = true
  			} else {
  				log.Println(err.Error() + " skipping line")
  			}
  		}
  
  		startTag := []byte("<page>")
  		startIndex := bytes.Index(text, startTag)
  
  		endTag := []byte("</page>")
  		endIndex := bytes.Index(text, endTag)
  
  		if startIndex != -1 {
  			inPage = true
  			buffer = text[startIndex:]
  		} else if endIndex != -1 {
  			inPage = false
  			buffer = append(buffer, text[:endIndex+len(endTag)]...)
  
  			if bytes.Index(buffer, []byte("#REDIRECT")) == -1 {
  				pages <- buffer
  			}
  
  			buffer = make([]byte, 0)
  		} else if inPage {
  			buffer = append(buffer, text...)
  		}
  	}
  
  	close(pages)
  }
docs: // getRawPages creates full pages from a reader that can then be parsed with an XML parser.