mirror of
https://github.com/penpot/penpot.git
synced 2026-03-22 10:23:43 +00:00
Merge pull request #8701 from penpot/superalex-fix-line-breaks-not-rendering-in-text-shapes
🐛 Fix line breaks not rendering in text shapes
This commit is contained in:
@@ -1139,7 +1139,11 @@ impl TextSpan {
|
||||
fn process_ignored_chars(text: &str, browser: u8) -> String {
|
||||
text.chars()
|
||||
.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 {
|
||||
None
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user