Hiding Passwords with Markdown

I love using markdown to organize stuff. The issue is, I store passwords and usernames in some of my notes but I hate having them in clear text in case people are looking over my shoulder. Some markdown websites/plugins have the use of !> to hide text until it’s hovered over with a mouse. Something like that would be great!

C10

You could add something like this to userstyle.css

.hidden {
  background: #000;
  font-color: #000;
  transition: background 0.5s ease;
}

.hidden:hover {
  background: none;
}

And then in your notes you could use it like:

Here is a large block of text with a hidden <span class="hidden">password</span> that is only revealed on hover.

I know it’s not ideal, but you can get this working today as opposed to waiting for someone to implement this as a feature.

P.S. I got most of this code from here

2 Likes

You can also use MD Comment syntax to hide text in the MD Preview.

1 Like

MD/HTML comments work, but not when inside a MD table… which is unfortunate.

I guess i’ll just have to use some HTML and customize the CSS. Cause that seems like the only way to get it to work within a MD table

Thanks for the responses!

Yep, this works in an MD table with no CSS.

<!-- hidden text -->

1 Like

Ohhhh that actually worked. Was this due to the update? MD seems updated as well on this new Joplin version. I could have incorrectly used the tags when I tried earlier (possible).

Thanks!

1 Like

Hmm, maybe we could add a few markdown extensions like discourse does. IMO it shouldn’t be hard to add. @laurent has to decide, if he wants this in Joplin.

There are more pressing issues to tackle, but maybe we can keep this in the back of our heads…

e.g.:

[spoiler]This text will be blurred[/spoiler] click on it to make it readable

This text will be blurred click on it to make it readable

and

[details="Summary"]
This text will be hidden
[/details]
Summary

This text will be hidden

2 Likes

Hi @tessus! Are there any chances that this syntax will be added to Joplin?

I doubt it, unless someone creates 2 markdown-it plugins, which we then could add to Joplin.

I don't think there's even a Markdown syntax for this. Using square bracket tags is really bbcode and let's not go there :slight_smile:

I think Caleb's solution is the way to go. Just use Html, which is already supported and more portable than bbcode, along with userstyle.css

I’d like the syntax from this plugin: https://github.com/markdown-it/markdown-it-container (and another tool Pandoc uses something like that: https://pandoc.org/MANUAL.html#divs-and-spans)

But it also requires using custom userstyle.css