Clarify docs: Weak spacings eat markup space (#1648)

Co-authored-by: Laurenz <laurmaedje@gmail.com>
This commit is contained in:
raphCode 2023-07-05 12:54:33 +02:00 committed by GitHub
parent 8bf0bb5da9
commit 8711b5eeed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,15 +31,26 @@ pub struct HElem {
/// Moreover, from multiple adjacent weak spacings all but the largest one /// Moreover, from multiple adjacent weak spacings all but the largest one
/// collapse. /// collapse.
/// ///
/// Weak spacing in markup also causes all adjacent markup spaces to be
/// removed, regardless of the amount of spacing inserted. To force a space
/// next to weak spacing, you can explicitly write `[#" "]` (for a normal
/// space) or `[~]` (for a non-breaking space). The latter can be useful to
/// create a construct that always attaches to the preceding word with one
/// non-breaking space, independently of wether a markup space existed in
/// front or not.
///
/// ```example /// ```example
/// #h(1cm, weak: true) /// #h(1cm, weak: true)
/// We identified a group of /// We identified a group of _weak_
/// _weak_ specimens that fail to /// specimens that fail to manifest
/// manifest in most cases. However, /// in most cases. However, when
/// when #h(8pt, weak: true) /// #h(8pt, weak: true) supported
/// supported /// #h(8pt, weak: true) on both sides,
/// #h(8pt, weak: true) on both /// they do show up.
/// sides, they do show up. ///
/// Further #h(0pt, weak: true) more,
/// even the smallest of them swallow
/// adjacent markup spaces.
/// ``` /// ```
#[default(false)] #[default(false)]
pub weak: bool, pub weak: bool,