# Inline Syntax

This page lists the inline formatting, escape characters and line-break rules NanoMD supports.

## Font Formatting

| Syntax | Output | Standard mode |
|---|---|---|
| `**text**`, `__text__` | `<strong>` | Yes |
| `*text*`, `_text_` | `<em>` | Yes |
| `~~text~~` | `<s>` | Yes |
| `==text==` | `<mark>` | No |
| `^text^` | `<sup>` | No |
| `~text~` | `<sub>` | No |
| `` `text` `` | `<code>` (content HTML-escaped first) | Yes |

## Matching Rules

| Rule | Detail |
|---|---|
| Single line | Markers and content must be on the same line |
| No same marker inside | `**a*b**` is not bold |
| No surrounding whitespace | `** text **` stays literal |
| Unpaired | A lone marker stays literal, e.g. `b**` |
| Bold italic | `***text***` outputs `<em><strong>text</strong></em>` |

Inline code handles a single backtick only; the double-backtick form `` `` `x` `` `` leaves the outer ` `` ` in the output.

## Escapes

Prefix these characters with `\` to keep them from being read as syntax; they are output as HTML entities:

| Source | Output |
|---|---|
| `\!` `\#` `\*` `\_` `\~` `\^` `\=` | `&excl;` `&num;` `&ast;` `&lowbar;` `&tilde;` `&Hat;` `&equal;` |
| `\<` `\>` `\[` `\]` `\(` `\)` | `&lt;` `&gt;` `&lsqb;` `&rsqb;` `&lpar;` `&rpar;` |
| `` \` `` | `&grave` (missing its trailing semicolon in v1.11.6) |

In v1.11.6 a `$` is output as `@dollar@` and escaping does not help; see [Parsing Pipeline](/parsing-pipeline) for the cause.

## Line Breaks and Paragraphs

| Source | Output |
|---|---|
| A single newline | Kept as `\n`; `.pd-md-viewer` does not set `white-space: pre-wrap`, so the browser treats it as a space and does not break the line |
| One or more consecutive blank lines | One `<br>` |

NanoMD does not produce `<p>` paragraph elements.

## Raw HTML

HTML tags in the text pass through unchanged, which fills gaps Markdown lacks, such as `<u>underline</u>` or `<details>`. It also means untrusted content must be filtered by you; see [Security](/security).
