From 57d99eabbb6c09067ad931b2e7894f6e7b487f37 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Fri, 19 May 2017 10:01:58 +0200 Subject: [PATCH] Fix docs generating invalid links for Vector results (#87) --- docs/docs_writer.py | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/docs/docs_writer.py b/docs/docs_writer.py index 750b0f92..29bc2be4 100644 --- a/docs/docs_writer.py +++ b/docs/docs_writer.py @@ -1,4 +1,5 @@ import os +import re class DocsWriter: @@ -153,9 +154,25 @@ class DocsWriter: # Generic results cannot have any link self.write(tlobject.result) else: - self.write('%s' % tlobject.result) + if re.search('^vector<', tlobject.result, re.IGNORECASE): + # Notice that we don't simply make up the "Vector" part, + # 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('%s<' % vector) + + self.write('%s' % inner) + + self.write('>') + else: + self.write('%s' % tlobject.result) self.write('')