1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// This file is part of helpers4.
// Copyright (C) 2025 baxyz
// SPDX-License-Identifier: LGPL-3.0-or-later
/// Turns `text` into a Markdown blockquote by prefixing every line with `> `.
///
/// Empty lines get a bare `>` (no trailing space), so the quote stays one block. Line breaks are
/// kept as they are, including a trailing one, and a quote inside a quote nests naturally
/// (`> > text`).
///
/// # Arguments
///
/// - `text` - The text to quote, on one or several lines.
///
/// # Returns
///
/// The quoted text.
///
/// # Examples
///
/// ```
/// use helpers4::markdown::blockquote;
///
/// assert_eq!(blockquote("first\n\nsecond"), "> first\n>\n> second");
/// ```