Skip to content

Commit

Permalink
Escape the hover text (#650)
Browse files Browse the repository at this point in the history
In C#, you can get hover text that contains angle brackets.
Angle brackets don't need to be escaped in markdown.
The problem is that mdpopups.md2html doesn't escape our angle brackets
and causes invalid HTML to be generated, so let's escape our hover text
before we toss it into md2html.
  • Loading branch information
LoneBoco authored and rwols committed Jul 17, 2019
1 parent 6956769 commit c9a7390
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugin/hover.py
Expand Up @@ -139,9 +139,9 @@ def hover_content(self, point, response: 'Optional[Any]') -> str:
value = ""
language = None
if isinstance(item, str):
value = item
value = escape(item)
else:
value = item.get("value")
value = escape(item.get("value"))
language = item.get("language")
if language:
formatted.append("```{}\n{}\n```\n".format(language, value))
Expand Down

0 comments on commit c9a7390

Please sign in to comment.