
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@deltachat/message_parser_wasm
Advanced tools
Parsing of Links, Email adresses, simple text formatting (markdown subset), user mentions, hashtags and more in DeltaChat messages.
Parsing of Links, email addresses, simple text formatting (markdown subset), user mentions, hashtags and more in DeltaChat messages.
The specification can be found in spec.md.
The parser is written in rust with the nom crate and compiled to web assembly for this package.
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 on desktop and not also on iOS and android) as wasm module (see
./message_parser_wasm), later this will probably be integrated into deltachat core.
Read more about the project on github: https://github.com/deltachat/message-parser
function parse_text(s: string, enable_markdown: boolean): ParsedElement[];
import init, { parse_text } from "./pkg/message_parser_wasm.js";
init().then(() => {
let parsed = parse_text("hello **world**", true)
let result = parsed.map(element => {
switch element.t {
case "Bold":
return `<b>${element.c}</b>`
break;
case "Text"
return element.c
// ...
default
console.error(`type ${element.t} not known/implemented yet`, element);
return JSON.stringify(element)
}
}).join("")
console.log(result) // "hello <b>world</b>"
})
DO NOT actually write html with user input like that, this is for demonstration purposes ONLY! It let's you and your users open to XSS attacks, the examples bellow are much better suitable for reference or copy+pasting.
also see example.js and test it live on https://deltachat.github.io/message-parser/
For usage in react you can look at how we integrated this package in deltachat-desktop: deltachat-desktop/src/renderer/components/message/MessageMarkdown.tsx
If you want to see it in action in deltachat-desktop, feel free to download it on https://get.delta.chat.
/** returns first emoji from text if text begins with an emoji */
export function get_first_emoji(input: string): string | undefined;
/** If string contains only emojis count the emojis otherwise retuns null */
export function count_emojis_if_only_contains_emoji(input: string): number | undefined;
wasm-pack buildwasm-pack build --scope deltachat --target web
wasm-pack testwasm-pack test --headless --firefox
wasm-pack publishwasm-pack publish --target web
FAQs
Parsing of Links, Email adresses, simple text formatting (markdown subset), user mentions, hashtags and more in DeltaChat messages.
We found that @deltachat/message_parser_wasm demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.