code: func (page *Page) getLinks(text []byte) {
  	linksLeft := true
  
  	for linksLeft {
  		startTag := []byte("[[")
  		startIndex := bytes.Index(text, startTag)
  
  		endTag := []byte("]]")
  		endIndex := bytes.Index(text, endTag)
  
  		if startIndex != -1 && endIndex != -1 && startIndex+len(startTag) < endIndex {
  			linkBody := text[startIndex+len(startTag) : endIndex]
  
  			pipeIndex := bytes.Index(linkBody, []byte("|"))
  
  			if pipeIndex != -1 {
  				linkBody = linkBody[:pipeIndex]
  			}
  
  			categoryTag := []byte("Category:")
  			categoryIndex := bytes.Index(linkBody, categoryTag)
  
  			if categoryIndex != -1 {
  				category := linkBody[len(categoryTag):]
  
  				page.Categories = append(page.Categories, string(category))
  			} else {
  				if isTitle(linkBody) {
  					page.Links = append(page.Links, string(linkBody))
  				}
  			}
  
  			text = text[endIndex+len(endTag):]
  		} else {
  			linksLeft = false
  		}
  	}
  }
docs: // getLinks populates a Page's Links and Categories fields by parsing the given XML.
  // It will only take into account internal links, piped links, and categories.
  // See http://www.mediawiki.org/wiki/Help:Links for the syntax of these links.