Wrap headings and links
This commit is contained in:
parent
265a69a6ed
commit
31913dc059
8
av98.py
8
av98.py
|
@ -913,13 +913,13 @@ you'll be able to transparently follow links to Gopherspace!""")
|
|||
initial_indent = "> ", subsequent_indent="> ") + "\n")
|
||||
elif line.startswith("###"):
|
||||
line = line[3:].lstrip("\t ")
|
||||
tmpf.write("\x1b[4m" + line + "\x1b[0m""\n")
|
||||
tmpf.write("\x1b[4m" + textwrap.fill(line, self.options["width"]) + "\x1b[0m""\n")
|
||||
elif line.startswith("##"):
|
||||
line = line[2:].lstrip("\t ")
|
||||
tmpf.write("\x1b[1m" + line + "\x1b[0m""\n")
|
||||
tmpf.write("\x1b[1m" + textwrap.fill(line, self.options["width"]) + "\x1b[0m""\n")
|
||||
elif line.startswith("#"):
|
||||
line = line[1:].lstrip("\t ")
|
||||
tmpf.write("\x1b[1m\x1b[4m" + line + "\x1b[0m""\n")
|
||||
tmpf.write("\x1b[1m\x1b[4m" + textwrap.fill(line, self.options["width"]) + "\x1b[0m""\n")
|
||||
else:
|
||||
tmpf.write(textwrap.fill(line, self.options["width"]) + "\n")
|
||||
tmpf.close()
|
||||
|
@ -935,6 +935,8 @@ you'll be able to transparently follow links to Gopherspace!""")
|
|||
def _format_geminiitem(self, index, gi, url=False):
|
||||
protocol = "" if gi.scheme == "gemini" else " %s" % gi.scheme
|
||||
line = "[%d%s] %s" % (index, protocol, gi.name or gi.url)
|
||||
if gi.name:
|
||||
line = textwrap.fill(line, self.options["width"], subsequent_indent=" ")
|
||||
if gi.name and url:
|
||||
line += " (%s)" % gi.url
|
||||
return line
|
||||
|
|
Loading…
Reference in New Issue