def parse_categories(self, markup):
categories = []<EOL>m = re.findall(self.re["<STR_LIT>"], markup)<EOL>for category in m:<EOL><INDENT>category = category.split("<STR_LIT:|>")<EOL>page = category[<NUM_LIT:0>].strip()<EOL>display = u"<STR_LIT>"<EOL>if len(category) > <NUM_LIT:1>: <EOL><INDENT>display = category[<NUM_LIT:1>].strip()<EOL><DEDENT>if not page in categories:<EOL><INDENT>categories.append(page)<EOL><DEDENT><DEDENT>return categories<EOL>
Returns a list of categories the page belongs to.

        # A Wikipedia category link looks like:
        # [[Category:Computing]]
        # This indicates the page is included in the given category.
        # If "Category" is preceded by ":" this indicates a link to a category.