0

How does one comment out a line inside a TFS Markdown Widget? When I say "comment out" what I am referring to is making a line of text not visible to the view when it is saved. In other words, a line of text that is only viewable to me (as the editor) when I open the widget for editing.

<!--- This does not work -->
[comment]: # This does not work
[comment]: <> This does not work
// This does not work
/* This does not work */

Update: These DO work:

[comment]: # (This does work)
[//]: # (This does work)

The key, and I did not realize this, is that the comment itself has to be inside parens. And what I have further discovered is that only the open parens is required!

zeeple
  • 5,509
  • 12
  • 43
  • 71

1 Answers1

1

Update:

Both [comment]: # and [comment]: <> should be work. It's regardless of the content in []. So, there is no difference between [comment] or [\\], even[123].

However, suggest you use # instead of <>, also add an empty line before the comment.

The most platform-independent syntax is

(empty line)
[comment]: # (This actually is the most platform independent comment)

More detail info you can refer the answer from Nick Volynkin Comments in Markdown.


Moreover, here's some basic Markdown syntax guidance. For more, see Daring Fireball. enter image description here enter image description here enter image description here

Here is Markdown guidance in VSTS and TFS.

Community
  • 1
  • 1
PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62
  • Forgive me, but I do not see where there is any mention of commenting a line in your answer. What am I missing? – zeeple Sep 26 '16 at 18:02
  • But I do wanna say thank you for responding! I uprooted your answer even though I don't think it answers the question. – zeeple Sep 26 '16 at 20:29
  • Sorry for the misunderstanding. Originally, you are meaning the code comments, just like `//` in C#. It's the same with comments in Markdown for TFS Markdown widgets. Your update works perfect, you can add it as an answer and mark it. It's more intuitive for others to see. `[comment]: <>` and `[//]: <>`also works. However, suggest you use `# ` instead of `<>`, also add an empty line before the comment such as `(empty line) [comment]: # ( most platform independent comment)` More details you can refer this answer: http://stackoverflow.com/questions/4823468/comments-in-markdown/32190021#32190021 – PatrickLu-MSFT Sep 27 '16 at 02:05