Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hentioe/entitydown_ex
Separate Markdown into plain text and structured markup entities
https://github.com/hentioe/entitydown_ex
Last synced: 14 days ago
JSON representation
Separate Markdown into plain text and structured markup entities
- Host: GitHub
- URL: https://github.com/hentioe/entitydown_ex
- Owner: Hentioe
- Created: 2023-05-08T13:09:01.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-05-12T22:26:44.000Z (over 1 year ago)
- Last Synced: 2024-04-14T16:58:46.476Z (7 months ago)
- Language: Elixir
- Size: 43 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Entitydown
Extract plain text and markup entities from Markdown text.
## Usage
```elixir
iex> Entitydown.extract "Hello, click [here](https://t.me/) to visit the Telegram official website."
{"Hello, click here to visit the Telegram official website.\n",
[
%Entitydown.Entity{
type: :text_link,
offset: 13,
length: 4,
url: "https://t.me/",
language: nil
}
]}iex> Entitydown.extract "[_I am an italicized link_](https://t.me/)." # Nested
{"I am an italicized link.\n",
[
%Entitydown.Entity{
type: :text_link,
offset: 0,
length: 23,
url: "https://t.me/",
language: nil
},
%Entitydown.Entity{
type: :italic,
offset: 0,
length: 23,
url: nil,
language: nil
}
]}
```Its main purpose is to replace Telegram's support for Markdown because it lacks security (**which can easily lead to message sending failures**). This library converts Markdown text to secure entity parameters to avoid this issue.
This library is still under development and its support for Markdown is **not yet comprehensive**.