#markdown #deltachat #dc #message-parser #deltachat-messenger

bin+lib deltachat_message_parser

email, link, hashtag, md and more - parsing for deltachat messages

3 releases (breaking)

0.5.0 Feb 27, 2023
0.4.0 May 9, 2022
0.3.0 Mar 4, 2022

#797 in Parser implementations

MPL-2.0 license

999 lines

DeltaChat Message Parser

Parsing of Links, Email adresses, simple text formatting (markdown subset), user mentions, hashtags and more in DeltaChat messages.

The specification can be found in spec.md.

WASM Demo: https://deltachat.github.io/message-parser/

Idea behind it

Have the same rich message parsing on all platforms.

The basic idea is that core can use this library to convert messages to an AST format, that can then be displayed by the UIs how they see fit, for desktop it will be converted to react elements.

Desktop already uses this package (minus the markdown, because it does not make sense to only have markdown only on one platform) as wasm module (see ./message_parser_wasm), later this will probably be integrated into deltachat core.

Coding Principles

  • many test cases
  • aim to be fast - so also benchmarks to make sure the lib stays fast enough


If used for message parsing, don't parse messages that are over 10 000 chars in size to ensure performance stays excelent. (the lib could and should support more than that and should aim to be fast enough for it, but on slow devices or transpiled to wasm or asmjs limiting it makes sense to avoid laggy/freezed interface)


cargo install cargo-criterion


cargo criterion

docs about benchmarking: https://bheisler.github.io/criterion.rs/book/criterion_rs.html



~66K SLoC