Skip to content
This repository was archived by the owner on Nov 12, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ readme = "README.md"
# default `fig` feature: that is `twig::meta` (frontmatter read and edited
# through fig, and a document's `twig:` key obeyed), which leaf never asks for,
# and it would bring fig's YAML, TOML, JSON and figl parsers with it.
twig-doc = { version = "6", default-features = false }
twig-markdown = "6"
twig-djot = "6"
twig-html = "6"
twig-asciidoc = "6"
twig-xml = "6"
twig-doc = { version = "7", default-features = false }
twig-markdown = "7"
twig-djot = "7"
twig-html = "7"
twig-asciidoc = "7"
twig-xml = "7"
# The CSS inside a `style` attribute: the presentation vocabulary is written
# there, so another app renders it, and every edit to it keeps the declarations
# leaf did not write. Shared with thorn, which edits an SVG's `style` the same way.
Expand Down
31 changes: 16 additions & 15 deletions apps/leaf-dioxus-tui/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 14 additions & 14 deletions apps/leaf-dioxus/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 14 additions & 14 deletions archive/apps/leaf/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 6 additions & 8 deletions archive/crates/leaf-ffi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3400,8 +3400,8 @@ impl LeafDoc {
/// [`insert_page_break`](Self::insert_page_break) places a page break,
/// which is this gesture with leaf's own name. It arrives in
/// [`DocView::directives`] as it went in: `attrs` is the
/// [`DirectiveAttr`] list a [`DirectiveView`] carries, an empty value a
/// bare attribute.
/// [`DirectiveAttr`] list a [`DirectiveView`] carries. An empty value is
/// written `key=""`, the flag every format reads back as one.
///
/// A name twig will not write (it is an ASCII letter and then letters,
/// digits, `-` and `_`), a label holding a line end or a square bracket,
Expand All @@ -3414,10 +3414,8 @@ impl LeafDoc {
label: Option<String>,
attrs: Vec<DirectiveAttr>,
) -> DocView {
let attrs: Vec<(String, Option<String>)> = attrs
.into_iter()
.map(|a| (a.key, (!a.value.is_empty()).then_some(a.value)))
.collect();
let attrs: Vec<(String, Option<String>)> =
attrs.into_iter().map(|a| (a.key, Some(a.value))).collect();
let mut g = self.lock();
g.doc.insert_directive(&name, label.as_deref(), &attrs);
g.frame()
Expand Down Expand Up @@ -5247,7 +5245,7 @@ mod tests {
}

/// A host's directive goes in as the view hands it out — name, label and
/// the `DirectiveAttr` list, an empty value a bare attribute — and a
/// the `DirectiveAttr` list, an empty value written `key=""` — and a
/// reported height reserves its rows under the same key.
#[test]
fn a_directive_goes_in_the_way_it_comes_out() {
Expand All @@ -5265,7 +5263,7 @@ mod tests {
let v = d.insert_directive("x-card".into(), Some("A card".into()), attrs);
assert!(
d.source()
.contains("::x-card[A card]{src=\"https://x.org/a\" wide}")
.contains("::x-card[A card]{src=\"https://x.org/a\" wide=\"\"}")
);
let [x] = v.directives.as_slice() else {
panic!("one directive");
Expand Down
Loading