Socket
Book a DemoInstallSign in
Socket

slidge-style-parser

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

slidge-style-parser

0.1.9
pipPyPI
Maintainers
1

Github

PyPi

License: AGPL-3.0-or-later

A parsing library for Slidge. Supports parsing these attributes:

"_underline_"

"*bold*"

"~strikethrough~"

"`code span`"

"```language

code block

```"

">quote"

"||spoiler||"

"\_escape style_"

Most of them correspond to XEP-0393: Message Styling.

Methods:

format_for_telegram(body: String, mentions: Optional<(_, start, end_index_exclusive)>) -> (body: String, Vec<(format: String, offset: usize, length: usize, language: String)>)

format_for_matrix(body: String, mentions: Optional<(mxid, start, end_index_exclusive)>) -> body: String

format_body(body: String, new_tags: HashMap<String, (String, String)>) -> String

new_tags = {

"_": ("<em>", "</em>"),

"*": ("<strong>", "</strong>"),

"~": ("<del>", "</del>"),

"`": ("<code>", "</code>"),

"```": ("<pre><code>", "</code></pre>"),

"```language": ('<pre><code class="language-{}">', "</code></pre>"),

">": ("<blockquote>", "</blockquote>"),

"||": ("<span data-mx-spoiler>", "</span>"),

"\n": ("<br>", "")

}

To build: maturin build

FAQs

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.