this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: draw-mode blank insertion supports mixed text+math selections

Expands the selection bounds to cover any partially-overlapped equation
before wrapping, rather than rejecting with an error. #blank[text $eq$]
is valid Typst so no special restructuring is needed once the equation
delimiters are fully included.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

+17 -2
+17 -2
crates/tala/src/editor.rs
··· 1820 1820 return; 1821 1821 } 1822 1822 if any_math { 1823 - insert_error.set(Some("Selection spans math and text — draw over one type only.".into())); 1824 - drawn_boxes.write().push(drawn_rect); 1823 + let spans = math_spans_sig.read().clone(); 1824 + let mut lo = min_start; 1825 + let mut hi = max_end; 1826 + for ms in &spans { 1827 + if ms.start < lo && ms.end > lo { lo = ms.start; } 1828 + if ms.start < hi && ms.end > hi { hi = ms.end; } 1829 + } 1830 + let new_frag = insert_blank_wrap(&fragment, lo, hi); 1831 + source.set(format!("{}{}{}", &cur[..cs], new_frag, &cur[ce..])); 1832 + insert_error.set(None); 1833 + let b64 = base64::engine::general_purpose::STANDARD.encode(&new_frag); 1834 + spawn(async move { 1835 + document::eval(&format!( 1836 + "var t=document.querySelector('.card-row.active textarea');\ 1837 + if(t)t.value=atob('{}');", b64 1838 + )).await.ok(); 1839 + }); 1825 1840 return; 1826 1841 } 1827 1842 let new_frag = insert_blank_wrap(&fragment, min_start, max_end);