Joplin is "an open source note taking and to-do application with synchronisation capabilities." It displays both the Markdown input and its rendered output. You can export notes in HTML, Markdown, or PDF.

It allows for end-to-end encryption of notes, which means that notes will be illegible on the server used for synchronization. Encryption is not enabled by default.

I use Joplin and its web clipper every day.

Licensing: MIT License (Expat) (Source code)

Documentation on searching in Joplin