From 7e057402b91320c9d5495d83e4f92a4bd6d035ee Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Mon, 20 Nov 2023 16:32:59 +0000 Subject: [PATCH] Graphics: wrapString now also wraps on slashes (to allow wrapping of URLs) --- ChangeLog | 1 + libs/graphics/jswrap_graphics.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c9ec00f913..63bbb881dc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -28,6 +28,7 @@ Storage: Storage.writeJSON now escapes with a more compact `\x##`/`\#` character escape notation (still valid JSON) This allows Espruino to save non-unicode strings with characters in the unicode range, and to also re-load them as non-unicode Graphics: Graphics.stringMetrics now returns 'unrenderableChars/imageCount/maxImageHeight' for much more info about rendering strings + Graphics: wrapString now also wraps on slashes (to allow wrapping of URLs) 2v19 : Fix Object.values/entries for numeric keys after 2v18 regression (fix #2375) nRF52: for SD>5 use static buffers for advertising and scan response data (#2367) diff --git a/libs/graphics/jswrap_graphics.c b/libs/graphics/jswrap_graphics.c index 2452249b3c..4a80e277aa 100644 --- a/libs/graphics/jswrap_graphics.c +++ b/libs/graphics/jswrap_graphics.c @@ -2473,7 +2473,7 @@ JsVar *jswrap_graphics_wrapString(JsVar *parent, JsVar *str, int maxWidth) { } #endif wordWidth += _jswrap_graphics_getCharWidth(&gfx, &info, ch); - if (ch==',' || ch=='.' || ch=='-' || ch=='-' || ch==':') + if (ch==',' || ch=='.' || ch=='-' || ch=='/' || ch=='\\' || ch==':') canSplitAfter = true; if (!jsvStringIteratorHasChar(&it)) endOfText=true; }