We can document code with backticks in JSdoc to see it styled like interpreted markdown when hovering over the definition:
/** * This function is similar to `someFunction(foo)` */ function bar() { ... } This shows up as approximately the following on hover:
This function is similar to
someFunction(foo)
But how can we document code that uses backticks, like tagged templates?
/** * This function is similar to `taggedFn\`foo ${someVar}\`` */ function boo() { ... } This shows up as approximately the following on hover (the formatting issues are intentional to illustrate the problem):
This function is similar to
taggedFn\foo ${someVar}``
This last example is how some other apps like Discord normally handle it: by allowing to escape backticks with a backslash as is common in markdown. However, this doesn't work in VSCode when hovering over the function definition as shown in the example output.
Note: Not tagging this question for JSdoc / PHPdoc because while these are the only instances where VSCode does this type of markdown rendering in code, it's not actually related to JSdoc or the others.