> For the complete documentation index, see [llms.txt](https://vector-privacy.gitbook.io/vector-privacy/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vector-privacy.gitbook.io/vector-privacy/vector-messenger/features/markdown.md).

# Markdown

Vector Markdown and Text Stylization

Vector Messenger has integrated [GitHub Flavored Markdown (GFM)](https://marked.js.org/#specifications) style, with unique customizations and additions. Markdown is a method of stylizing text inside the messenger. Examples are making text bold, italic, underlined, adding code blocks, and so forth. Markdown is a helpful tool for reading, legibility, and communicating thoughts in a more clear method. It can help the user more quickly identify the message, including adding title headers or bullet points. As simple paragraph or body text can make reading less interesting for some, markdown styling is used as a common tool to help convey ideas in a more optimal fashion. For reference, the GitBook you are reading now uses markdown styling.

***

## Examples

### Headers

```
# H1 Heading
## H2 Heading
### H3 Heading
#### H4 Heading
##### H5 Heading
###### H6 Heading
```

{% hint style="info" %}
Only ATX-style headings using `#` are supported.&#x20;

Setext-style headings (underlining text with `===` or `---`) are disabled.
{% endhint %}

***

### Text Stylization

```
**Bold Text** or __Bold Text__
*Italic Text* or _Italic Text_
~~Strikethrough Text~~
<u>Underlined Text</u>
`Inline Code`
||Spoiler Text||
```

{% hint style="info" %}
Tip: Tapping or clicking inline code will automatically copy it to your clipboard.
{% endhint %}

***

### Lists

**Unordered Lists**

```
* Item 1
* Item 2
  * Sub-item 2.1
  * Sub-item 2.2
```

**Ordered Lists**

```
1. First item
2. Second item
3. Third item
```

{% hint style="info" %}
Only `-` and `*` are supported as list markers. The `+` marker is disabled.
{% endhint %}

***

### Blockquotes

```
> This is a blockquote.
> Each line must start with > to continue the quote.
```

{% hint style="info" %}
Every line of a blockquote must begin with `>`. Lines without it will not be included in the quote block.
{% endhint %}

***

### Subtext

```
-# This renders as small, muted text.
```

Subtext must start on its own line. Inline formatting like bold and italic still works within it.

***

### Hyperlinks

```
[Link Text](https://example.com)
```

To share a link without generating a preview, wrap the URL in angle brackets:

```
[Link Text](<https://example.com>)
```

#### Link Spoofing Protection

Markdown lets you display any text over any URL, which makes it easy to disguise a malicious destination behind trusted-looking text. Vector blocks this. If a link's visible text claims a different destination than where it actually goes, the link is not rendered as clickable at all. Instead, the raw markdown is shown so the true destination stays visible.

For example, this will not render as a link:

```
[https://trusted.com](https://scam.com)
```

[https://trusted.com](https://scam.io/) <- Example Fake Site\
(hover link above to see how links can be spoofed)

Links where the text and destination match, or where the text isn't URL-shaped, work normally. Subdomains of the same site are also accepted, so a link reading `docs.example.com` pointing to `example.com` is fine.

***

### Tables

```
| Column 1 | Column 2 | Column 3 |
|----------|----------|----------|
| Cell 1   | Cell 2   | Cell 3   |
| Cell 4   | Cell 5   | Cell 6   |
```

{% hint style="info" %}
Tables are automatically wrapped in a scrollable container on smaller screens.
{% endhint %}

***

### Horizontal Rule

```
---
```

Sometimes referred to as a page break or divider, this creates a horizontal line that acts as a visual separator between sections. It is useful for organizing longer messages and giving distinct ideas room to breathe.

***

### Code Blocks

For utilizing Code Blocks markdown formatting, start and end with 3 consecutive backticks or backquotes. On the first line after your last backtick, you can write the specified programming language and markdown will automatically detect it to make it easier to read. Every code block includes a copy button for convenience.

```rust
use vector_sdk::VectorBot;

#[tokio::main]
async fn main() -> vector_sdk::Result<()> {
    let bot = VectorBot::builder()
        .nsec("nsec1...")
        .build()
        .await?;

    let chat = bot.dm("npub1example...");

    let message_id = chat.send("Hello, world!").await?;
    println!("Message sent: {}", message_id);

    Ok(())
}
```

***

### Collapsible Sections

```
<details>
<summary>Click to expand</summary>
Hidden content goes here.
</details>
```

***

### Custom Changes

The following are Vector-specific customizations to standard GFM behavior:

* Disabled using the `+` sign to create lists. Only `-` and `*` are supported.
* Disabled markdown images. Images are handled as file attachments instead.
* Disabled autolinks (bare URLs). Vector handles URL detection and linking separately.
* Disabled setext-style headings (`===` / `---`). Only ATX `#` headings are supported.
* Integrated `highlight.js` for code block syntax highlighting.
* Added spoilers using `||spoiler text||` Discord-like syntax.
* Code blocks include an injected copy button for convenience.
* Inline code can be tapped or clicked to copy to clipboard.
* Links wrapped in angle brackets `[text](<url>)` suppress link previews.
* Tables are automatically wrapped in a scrollable container on smaller screens.
