Skip to content

Commit 609ea8b

Browse files
committed
correct links in markdown formatting
1 parent 7d69234 commit 609ea8b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

robotcode/language_server/robotframework/utils/markdownformatter.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,10 @@ def _format_link(self, text: str) -> str:
160160
def remove_link(self, text: str) -> str:
161161
# 2nd, 4th, etc. token contains link, others surrounding content
162162
tokens = self._link.split(text)
163-
164-
formatters: Iterator[Callable[[str], Any]] = itertools.cycle([self._remove_link])
165-
return "".join(f(t) for f, t in zip(formatters, tokens))
163+
if len(tokens) > 1:
164+
formatters: Iterator[Callable[[str], Any]] = itertools.cycle([self._remove_link])
165+
return "".join(f(t) for f, t in zip(formatters, tokens))
166+
return text
166167

167168
def _remove_link(self, text: str) -> str:
168169
if "|" not in text:

0 commit comments

Comments
 (0)