mirror of
https://github.com/penpot/penpot.git
synced 2026-08-01 10:56:20 +00:00
🐛 Fix line breaks not rendering in text shapes
This commit is contained in:
parent
e870497ae1
commit
e8ce2a43f2
@ -1139,7 +1139,11 @@ impl TextSpan {
|
|||||||
fn process_ignored_chars(text: &str, browser: u8) -> String {
|
fn process_ignored_chars(text: &str, browser: u8) -> String {
|
||||||
text.chars()
|
text.chars()
|
||||||
.filter_map(|c| {
|
.filter_map(|c| {
|
||||||
if c < '\u{0020}' || c == '\u{2028}' || c == '\u{2029}' {
|
// Preserve line breaks: \n (U+000A), \r (U+000D), and Unicode separators
|
||||||
|
if c == '\n' || c == '\r' || c == '\u{2028}' || c == '\u{2029}' {
|
||||||
|
return Some(c);
|
||||||
|
}
|
||||||
|
if c < '\u{0020}' {
|
||||||
if browser == Browser::Firefox as u8 {
|
if browser == Browser::Firefox as u8 {
|
||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user