mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 09:26:37 +03:00
Fix docs generating invalid links for Vector results (#87)
This commit is contained in:
parent
41d1dac1c6
commit
57d99eabbb
|
@ -1,4 +1,5 @@
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
|
|
||||||
|
|
||||||
class DocsWriter:
|
class DocsWriter:
|
||||||
|
@ -153,9 +154,25 @@ class DocsWriter:
|
||||||
# Generic results cannot have any link
|
# Generic results cannot have any link
|
||||||
self.write(tlobject.result)
|
self.write(tlobject.result)
|
||||||
else:
|
else:
|
||||||
self.write('<a href="')
|
if re.search('^vector<', tlobject.result, re.IGNORECASE):
|
||||||
self.write(self.type_to_path(tlobject.result))
|
# Notice that we don't simply make up the "Vector" part,
|
||||||
self.write('">%s</a>' % tlobject.result)
|
# because some requests (as of now, only FutureSalts),
|
||||||
|
# use a lower type name for it (see #81)
|
||||||
|
vector, inner = tlobject.result.split('<')
|
||||||
|
inner = inner.strip('>')
|
||||||
|
self.write('<a href="')
|
||||||
|
self.write(self.type_to_path(vector))
|
||||||
|
self.write('">%s</a><' % vector)
|
||||||
|
|
||||||
|
self.write('<a href="')
|
||||||
|
self.write(self.type_to_path(inner))
|
||||||
|
self.write('">%s</a>' % inner)
|
||||||
|
|
||||||
|
self.write('>')
|
||||||
|
else:
|
||||||
|
self.write('<a href="')
|
||||||
|
self.write(self.type_to_path(tlobject.result))
|
||||||
|
self.write('">%s</a>' % tlobject.result)
|
||||||
|
|
||||||
self.write('</pre>')
|
self.write('</pre>')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user