# Markdown Stress Testing

# Markdown parity — complete manual fixture

START OF FIXTURE — this sentence should remain visible in both published posts.

## 01. Headings

# Heading level 1

## Heading level 2

### Heading level 3

#### Heading level 4

##### Heading level 5

###### Heading level 6

Setext heading level 1
======================

Setext heading level 2
----------------------

### Repeated heading

First occurrence, for checking table-of-contents links.

### Repeated heading

Second occurrence; its table-of-contents link should reach this occurrence.

## 02. Paragraphs, spacing, and line breaks

This is the first paragraph. It contains ordinary prose.

This is the second paragraph.

This line has a soft break.
This follows the soft break.

This line ends with two spaces.  
This follows a Markdown hard break.

This line ends with a backslash.\
This follows a backslash hard break.

This uses an explicit HTML break.<br>This follows the HTML break.

## 03. Emphasis and inline formatting

**Bold with asterisks**, __bold with underscores__, *italic with asterisks*, and _italic with underscores_.

***Bold and italic***, **bold with _italic inside_**, and *italic with **bold inside***.

~~Strikethrough~~ and ~~**bold strikethrough**~~.

<u>Underlined text</u> and <mark>highlighted text</mark>.

Press <kbd>Ctrl</kbd> + <kbd>K</kbd>, or <kbd>⌘</kbd> + <kbd>K</kbd>.

Water is H<sub>2</sub>O. A square is x<sup>2</sup>.

<abbr title="HyperText Markup Language">HTML</abbr> has a tooltip.

snake_case_word and camelCaseWord should remain ordinary words.

## 04. Escaping, entities, and Unicode

Escaped punctuation: \*asterisks\*, \_underscores\_, \[brackets\], \#hash, \>greater-than, and \|pipe.

Literal backslashes: C:\\Users\\Example\\Documents.

These entities should remain visible as text: &lt;article&gt;, &amp;, &quot;quoted&quot;, &#39;apostrophe&#39;, and &#169;.

The text `&lt;article&gt;` should show the entity spelling inside code.

The `<div>` element is mentioned inside inline code, not used as an HTML block.

Emoji: 😀 🚀 ✅ 💡 🧪. Punctuation: “quotes”, ‘apostrophe’, an em dash — and an ellipsis …

Unicode text: café, naïve, 日本語, हिन्दी, العربية.

## 05. Links

[Ordinary link](https://example.com)

[Link with a title](https://example.com "Example link title")

[**Bold link text**](https://example.com/bold "Bold link title") and [*italic link text*](https://example.com/italic).

[`code` inside a link](https://example.com/code).

[A URL containing parentheses](https://example.com/path_(example)).

[Query parameters](https://example.com/search?q=markdown&sort=newest).

Autolink: <https://example.com/autolink>.

Bare URL: https://example.com/bare_url.

Email link: [Example email](mailto:hello@example.com).

Email autolink: <hello@example.com>.

[Reference-style link][reference-link], [collapsed reference][], and [shortcut reference].

[Jump to the final section](#end-of-fixture).

[reference-link]: https://example.com/reference "Reference link title"
[collapsed reference]: https://example.com/collapsed
[shortcut reference]: https://example.com/shortcut

## 06. Unordered lists

- First bullet
- Second bullet with **bold** and a [link](https://example.com)
  - Nested bullet
    - Third-level bullet
  - Another nested bullet
- Last top-level bullet

* Star-marker item one
* Star-marker item two

+ Plus-marker item one
+ Plus-marker item two

## 07. Ordered lists and starting numbers

1. First item
2. Second item
   1. Nested first item
   2. Nested second item
3. Third item

An ordered list that starts at five:

5. Five
6. Six
7. Seven

A zero-based list:

0. Zero
1. One

Parenthesis-style list markers:

1) Parenthesis first
2) Parenthesis second

## 08. Loose lists and mixed nesting

- First loose item.

  Second paragraph belonging to the first item.

- Second loose item.

  > A quote inside the second item.

- Third loose item.

  ```js
  const insideList = true;
  ```

1. An ordered item with bullets:
   - Nested bullet one
   - Nested bullet two
2. Another ordered item.

## 09. Task lists

- [ ] Unchecked task
- [x] Checked task
- [X] Uppercase checked marker
- [ ] Task with **bold**, *italic*, and a [link](https://example.com)
  - [x] Completed nested task
  - [ ] Incomplete nested task

Empty task items, including an empty item with a nested list:

- [ ]
- [x]
- [X]
- [ ]
  - [x] Child of an empty task
- [x] Sibling after the empty task

An empty task in a loose list:

- [ ]

  This explanation belongs to the empty task above.

- [x] Finished loose-list task.

Mixed task and ordinary bullet items:

- [x] Checked task
- Ordinary bullet
- [ ] Unchecked task

Ordered task markers:

1. [ ] Ordered unchecked task
2. [x] Ordered checked task

Literal markers that should not accidentally become empty tasks:

- [ ]not-a-task
- \[ \]
- `[ ]`

## 10. Blockquotes

> A simple blockquote with **bold**, *italic*, and a [link](https://example.com).

> First paragraph in a quote.
>
> Second paragraph in the same quote.
>
> > A nested blockquote.
>
> - A bullet in the quote
> - Another bullet

> - [ ] Quoted unchecked task
> - [x] Quoted checked task

## 11. Horizontal rules

Dash rule:

---

Asterisk rule:

***

Underscore rule:

___

## 12. Tables

| Left aligned | Center aligned | Right aligned |
| :--- | :---: | ---: |
| Alpha | Beta | 123 |
| **Bold** | *Italic* | ~~Strike~~ |
| [Link](https://example.com) | `inline code` | 45.67 |
| Escaped pipe: a \| b | Line one<br>Line two | 0 |
|  | Empty left cell |  |
| H<sub>2</sub>O | x<sup>2</sup> | <kbd>K</kbd> |

| No explicit | Alignment |
| --- | --- |
| One | Two |

A table without outer pipes:

Name | Value
--- | ---
First | 1
Second | 2

## 13. Inline code

Run `npm install` and inspect `src/lib/markdown.ts`.

Use double backticks to include a backtick: ``a `backtick` inside code``.

Formatting stays literal: `**not bold**`, `<div>not an element</div>`, and `[not a link](https://example.com)`.

Dollar math stays literal in code: `$x^2 + y_1$`.

Backslash math stays literal in code: `\(x^2 + y_1\)`.

## 14. Fenced code and language aliases

```js
const greeting = "Hello, Hashnode";
console.log(greeting);
```

```ts
type Result = { ok: boolean; count: number };
const result: Result = { ok: true, count: 3 };
```

```tsx
export const Greeting = () => <strong>Hello</strong>;
```

```python
def square(value: int) -> int:
    return value ** 2
```

```bash
printf '%s\n' "$HOME"
echo 'Dollar signs: $5 and $10'
```

```json
{
  "enabled": true,
  "items": [1, 2, 3],
  "message": "<div> & literal text"
}
```

```html
<article class="example">
  <h2>This is source code, not a rendered heading</h2>
</article>
```

```css
.example {
  display: grid;
  gap: 1rem;
}
```

```sql
SELECT id, title FROM posts WHERE is_active = true;
```

```diff
- const version = "old";
+ const version = "new";
```

```plaintext
This block explicitly requests plain text.
SELECT * FROM posts;
body { color: red; }
```

```
This block has no language label.
SELECT * FROM posts;
body { color: red; }
It should not receive a guessed SQL or CSS language.
```

```not-a-real-language
Unknown language labels should still leave readable code.
```

~~~js
const tildeFence = true;
~~~

````markdown
An outer fence can contain a shorter fence:
```js
const nestedFence = true;
```
````

## 15. Indented code blocks

The following lines have four leading spaces:

    const indentedCode = true;
    console.log("Keep the indentation");

## 16. Math and currency

Inline backslash math: \(x^2 + y_1 = z^2\).

Legacy doubled-backslash math: \\(a^2 + b^2 = c^2\\).

Inline dollar math: $x^2 + y_1 = z^2$.

LaTeX commands: $\frac{a}{b} + \alpha = \beta$.

A comparison inside math: \(a < b\).

Display math:

$$
E = mc^2
$$

Another display formula:

$$
\sum_{i=1}^{n} i = \frac{n(n+1)}{2}
$$

Currency must remain ordinary text: it costs $5 to $10. Plans cost $100 and $200.

Literal numeric range: $5-10$.

Code still takes precedence:

```text
$x^2 + y_1$
\(x^2 + y_1\)
$$ E = mc^2 $$
```

## 17. Footnotes

A numeric footnote[^1], a named footnote[^named], and the same numeric footnote again[^1].

A single-word definition[^word] and a URL-only definition[^url].

Labels with an underscore[^under_score] and an asterisk[^star*label].

A footnote with multiple paragraphs and a list[^long-note].

Adjacent definitions are referenced here: first[^adjacent-a], then second[^adjacent-b].

[^1]: Numeric note with **bold**, *italic*, and `code`.
[^named]: A named note with a [link](https://example.com).
[^word]: Yes
[^url]: https://example.com/footnote
[^under_score]: An underscore-label definition.
[^star*label]: An asterisk-label definition.
[^long-note]: First paragraph of the long note.

    Second paragraph of the same note.

    - First item in the note.
    - Second item in the note.

[^adjacent-a]: First adjacent definition.
[^adjacent-b]: Second adjacent definition.

## 18. Images, titles, alignment, and sizing

The image samples reuse Hashnode's logo so their alignment and sizing can be compared.

Plain Markdown image:

![Hashnode logo](https://cdn.hashnode.com/res/hashnode/image/upload/v1611902473383/CDyAuTy75.png)

Image with a title:

![Logo with a title](https://cdn.hashnode.com/res/hashnode/image/upload/v1611902473383/CDyAuTy75.png "Image title / caption probe")

Empty alternative text:

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1611902473383/CDyAuTy75.png)

Hashnode left alignment:

![Left aligned](https://cdn.hashnode.com/res/hashnode/image/upload/v1611902473383/CDyAuTy75.png align="left")

Hashnode center alignment:

![Centered](https://cdn.hashnode.com/res/hashnode/image/upload/v1611902473383/CDyAuTy75.png align="center")

Hashnode right alignment:

![Right aligned](https://cdn.hashnode.com/res/hashnode/image/upload/v1611902473383/CDyAuTy75.png align="right")

HTML image with a title, size, and alignment:

<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1611902473383/CDyAuTy75.png" alt="Sized and right aligned" title="HTML image title" width="96" height="96" align="right" />

Linked image:

[![Clickable logo](https://cdn.hashnode.com/res/hashnode/image/upload/v1611902473383/CDyAuTy75.png)](https://hashnode.com)

Reference-style image:

![Reference image][logo-image]

[logo-image]: https://cdn.hashnode.com/res/hashnode/image/upload/v1611902473383/CDyAuTy75.png "Reference image title"

## 19. Hashnode mentions

Hello @[Fazle](@fazlerocks), this is a Hashnode mention.

A mention in a sentence: thanks to @[Hashnode](@hashnode) for reading.

## 20. Callouts

<div data-node-type="callout"><div data-node-type="callout-emoji">💡</div><div data-node-type="callout-text"><p>A tip callout with <strong>bold</strong>, <em>italic</em>, and a <a href="https://example.com">link</a>.</p></div></div>

<div data-node-type="callout"><div data-node-type="callout-emoji">⚠️</div><div data-node-type="callout-text"><p>A warning callout.</p><p>A second paragraph inside the callout.</p></div></div>

## 21. Collapsible details

<details><summary>Raw HTML details — click to expand</summary><p>This paragraph is inside the details element.</p><ul><li>First item</li><li>Second item</li></ul></details>

<details data-node-type="hn-details-summary"><summary>Editor-style details — click to expand</summary><div data-type="details-content"><p>This uses the editor's details attributes.</p><p>Keep this second paragraph.</p></div></details>

## 22. Hashnode embeds

Standalone YouTube embed:

%[https://www.youtube.com/watch?v=jNQXAC9IVRw]

Inline embed, with text on both sides:

BEFORE INLINE EMBED %[https://www.youtube.com/watch?v=jNQXAC9IVRw] AFTER INLINE EMBED.

An ordinary website card:

%[https://example.com]

Two inline embeds:

FIRST %[https://www.youtube.com/watch?v=jNQXAC9IVRw] MIDDLE %[https://example.com] LAST.

## 23. Hashnode widgets and embed combinations

Replace every occurrence of verify-widget in the source with a real widget ID from this publication before using these cases. Without a configured widget, compare placeholder preservation only.

Standalone widget:

%%[verify-widget]

Inline widget:

BEFORE WIDGET %%[verify-widget] AFTER WIDGET.

Widget before embed:

%%[verify-widget] %[https://www.youtube.com/watch?v=jNQXAC9IVRw]

Embed before widget:

%[https://www.youtube.com/watch?v=jNQXAC9IVRw] %%[verify-widget]

Widget and embed without a separating space:

%%[verify-widget]%[https://www.youtube.com/watch?v=jNQXAC9IVRw]

Embed and widget without a separating space:

%[https://www.youtube.com/watch?v=jNQXAC9IVRw]%%[verify-widget]

Repeated widgets:

%%[verify-widget] %%[verify-widget]

Several tokens between prose:

ARTICLE START %%[verify-widget] BETWEEN %[https://example.com] AGAIN %%[verify-widget] ARTICLE END.

The paragraph after the widgets and embeds must remain visible.

## 24. Additional HTML

<p>A paragraph containing <strong>strong</strong>, <em>emphasis</em>, <del>deleted</del>, and <ins>inserted</ins> text.</p>

<figure><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1611902473383/CDyAuTy75.png" alt="Figure logo" width="80" height="80" /><figcaption>An explicit HTML figure caption.</figcaption></figure>

<iframe src="https://www.youtube.com/embed/jNQXAC9IVRw" width="560" height="315" frameborder="0" allowfullscreen></iframe>

## 25. Compatibility probes — support is not assumed

These cases deliberately exercise syntax or editor round trips that may not be fully supported. Record differences; do not assume every construct should gain special formatting.

### Definition-list syntax

Term one
: Definition one

Term two
: Definition two

### GitHub-style alert syntax

> [!NOTE]
> A GitHub-style note may render as an ordinary blockquote here.

> [!WARNING]
> A GitHub-style warning may render as an ordinary blockquote here.

### Other Markdown extensions

==Highlight shorthand==, H~2~O, x^2^, and :smile: are extension probes. The explicit HTML equivalents appear earlier.

### Mermaid fence

```mermaid
flowchart LR
  Author --> Markdown
  Markdown --> PublishedPost
```

### Additional math forms

Simple math without operators: \(x\) and $x$.

Display bracket delimiters:

\[
a^2 + b^2 = c^2
\]

LaTeX spacing command:

$$
\int_0^1 x^2\,dx = \frac{1}{3}
$$

### Literal custom syntax inside code

`%[https://example.com]` and `%%[verify-widget]` are intended as literal code samples here.

```markdown
%[https://example.com]
%%[verify-widget]
- [ ]
[^literal]: This is code, not a footnote definition.
```

### Raw alignment, comments, and open details

<div align="center">This raw div requests centered text.</div>

<!-- This comment is invisible when rendered; inspect stored Markdown to compare preservation. -->

<details open><summary>Initially open details probe</summary><p>Check whether the open state survives.</p></details>

## End of fixture

END OF FIXTURE — this heading and sentence must remain visible after all embeds, widgets, code blocks, and HTML.

Use the footnote back-links to return to their references. The hidden Footnotes label should not become a visible table-of-contents entry.

