Hidden markdown text on GitHub

GithubMarkdown

Github Problem Overview


Is there anything in markdown syntax specifically on GitHub to support hidden text?

I just want to put some to-do notes in README.md for myself, not to be visible.


EXTRAS

As a tribute to the great answer by Tamas, and what's also asked a lot of times, below is an example of how to write foldable sections within MD files:

<details>
<summary><b>My section header in bold</b></summary>

Any folded content here. It requires an empty line just above it.

</details>

Github Solutions


Solution 1 - Github

Just use standard HTML comments:

<!-- This is commented out. -->

Solution 2 - Github

(This DOESN'T work on GitHub, which strips out CSS. But it can work in other Markdown viewers/editors. The reason I am adding it is because this question came up first when Googling hidden field markdown).

You can hide the field using CSS, if the rendering process respects it and doesn't strip it out:

Is this worth the hassle, as opposed to using an HTML comment? Probably not in most cases, though it does allow toggling visibility on and off.

#### hidden field with metadata 👇

<div class="meta_for_parser tablespecs" style="visibility:hidden">{"dataname":"environment","colvar":"varname","colval":"value"}</div>

#### hidden field with metadata 👆
glow a Rust-based terminal viewer

enter image description here

Typora, on macos

enter image description here

Macdown, on macos

enter image description here

But not GitHub

enter image description here

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionvitaly-tView Question on Stackoverflow
Solution 1 - GithubTamás SengelView Answer on Stackoverflow
Solution 2 - GithubJL PeyretView Answer on Stackoverflow