question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can we allow `isTrusted` configuration for MarkdownString?

See original GitHub issue

In VSCode MarkdownString can have a property isTrusted set to true in order to:

Indicates that this markdown string is from a trusted source. Only trusted markdown supports links that execute commands, e.g. Run it.

Currently, it seems that we don’t have an option to configure it. Source

Would it be possible to add a way to configure isTrusted property?

My use case would be to allow people to click on a type definition inside a tooltip and see the documentation of that types in a documentation panel. This is already something we are doing from inside that documentation panel.

Demo

2019-07-12 12 56 21

Use case

The user could click on string to see that type documentation.

Capture d’écran 2019-07-12 à 12 56 49

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
manav-acommented, Oct 30, 2019

I would also like to see this be possible. Is there any update on this issue? I don’t mind submitting the PR if need be.

0reactions
dbaeumercommented, Oct 7, 2020

Here is what I did to address this:

  • client options can now specify a markdown: { isTrused: boolean }.
  • ensured that clients can tweak that in the middleware

I decided to not add this as a concept to LSP since this is very VS Code specific.

Read more comments on GitHub >

github_iconTop Results From Across the Web

In Visual Studio code version 1.64, MarkdownString with 4 ...
I think the preferred way is to use this: const markdownString = new vscode.MarkdownString(); const codeBlock = `const a = 12; if (a)...
Read more >
October 2022 - Visual Studio Code
For MarkdownString , the isTrusted property now takes an allowlist of commands that can be executed (all other commands will be blocked): const...
Read more >
Event API: isTrusted | Can I use... Support tables for ... - CanIUse
1 Starting with Chrome 53 and Opera 40, untrusted events do not invoke the default action. 2 In Internet Explorer, all events are...
Read more >
How to use the vscode.MarkdownString function in vscode
Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues...
Read more >
vscode TreeItem TypeScript Examples - ProgramCreek.com
You can vote up the ones you like or vote down the ones you don't like, ... getTreeItem(element: MenuItem): TreeItem { let iconPath:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found