def gen_text(self, text):
     id = wikiutil.anchor_name_from_text(text)
     nr = self._ids[id] = self._ids.get(id, 0) + 1
     if nr == 1:
         return id
     return id + u'-%d' % nr
Beispiel #2
0
 def gen_text(self, text):
     id = wikiutil.anchor_name_from_text(text)
     nr = self._ids[id] = self._ids.get(id, 0) + 1
     if nr == 1:
         return id
     return id + u'-{0}'.format(nr)
 def _check(self, text, expected):
     encoded = wikiutil.anchor_name_from_text(text)
     assert expected == encoded