andrigamerita d264f45979
fix: code blocks of unknown languages cause HTML injection (#3711)
* fix: code blocks of unknown languages cause HTML injection

A code block of unknown language (that is, a language not treated as special by Memos and not handled by highlight.js) should fall back on rendering its plaintext content. However, the content is never properly escaped before it is appended to the DOM, and thus any string that happens to contain HTML is unsafely rendered. This commit fixes the issue by ensuring that, when none of the previous cases handle the text, any HTML entities are escaped first.

* Update CodeBlock.tsx to conform to eslint
2024-07-19 08:32:58 +08:00
2024-07-17 23:16:09 +08:00
2024-07-15 22:32:59 +08:00
2024-05-08 20:03:01 +08:00
2024-06-11 22:05:28 +08:00
2024-06-03 23:50:59 +08:00
2024-07-16 22:19:48 +08:00
2024-01-28 08:17:11 +08:00
2024-04-27 00:22:27 +08:00
2023-02-08 08:51:36 +08:00
2024-05-01 10:28:32 +08:00
2022-06-19 11:32:49 +08:00
2024-06-06 23:09:13 +08:00
2023-11-23 08:55:57 +08:00

Memos

A privacy-first, lightweight note-taking service. Easily capture and share your great thoughts.

Home PageBlogsDocsLive Demo

Docker pull Discord

demo

Key points

  • Open source and free to use. Embrace a future where creativity knows no boundaries with our open-source solution. All features are free to use and will never be charged in any form or content.
  • Self-hosting with Docker in just seconds. Enjoy the flexibility, scalability, and ease of setup that Docker provides, allowing you to have full control over your data and privacy.
  • Pure text with added Markdown support. Say goodbye to the overwhelming mental burden of rich formatting and embrace a minimalist approach.
  • Customize and share your notes effortlessly. With our intuitive sharing features, you can easily collaborate and distribute your notes with others.
  • RESTful API for third-party services. Embrace the power of integration and unleash new possibilities with our RESTful API support.

Deploy with Docker in seconds

docker run -d --name memos -p 5230:5230 -v ~/.memos/:/var/opt/memos neosmemo/memos:stable

Note

This command is only applicable for Unix/Linux systems. For Windows, please refer to the detailed documentation.

The ~/.memos/ directory will be used as the data directory on your local machine, while /var/opt/memos is the directory of the volume in Docker and should not be modified.

Learn more about other installation methods.

Contribution

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. We greatly appreciate any contributions you make. Thank you for being a part of our community! 🥰

Internationalization

Memos supports multiple languages. You can help us translate Memos into your language. We use Weblate to manage translations.

Translation status

Star history

Star History Chart

Other projects

  • Slash: An open source, self-hosted bookmarks and link sharing platform. Save and share your links very easily.
  • Gomark: A markdown parser written in Go for Memos. And its WebAssembly version is also available.
Description
An open-source, lightweight note-taking solution. The pain-less way to create your meaningful notes. Your Notes, Your Way.
Readme MIT 72 MiB
Languages
Go 54%
TypeScript 45.2%
Less 0.3%
JavaScript 0.2%
Shell 0.1%