Index: uspace/lib/ui/src/paint.c
===================================================================
--- uspace/lib/ui/src/paint.c	(revision ca2680d04b96dc8439f39dce7618923428b11279)
+++ uspace/lib/ui/src/paint.c	(revision 0eca788e9bddc3a87922b5da27b6666288ed497a)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2022 Jiri Svoboda
  * All rights reserved.
  *
@@ -39,4 +39,5 @@
 #include <gfx/render.h>
 #include <gfx/text.h>
+#include <ui/accel.h>
 #include <ui/paint.h>
 #include <stdlib.h>
@@ -566,53 +567,4 @@
 }
 
-/** Process text with '~' markup.
- *
- * Parse text with tilde markup into a list of strings. @a *rbuf is set
- * to point to a newly allocated buffer containing consecutive null-terminated
- * strings.
- *
- * Each part between two '~' becomes one string. '~~' is translated into
- * a literal '~' character. @a *endptr is set to point to the first character
- * beyond the end of the list.
- *
- * @param str String with tilde markup
- * @param rbuf Place to store pointer to newly allocated buffer.
- * @param endptr Place to store end pointer (just after last character)
- * @return EOK on success or an error code
- */
-static int ui_text_process(const char *str, char **rbuf, char **endptr)
-{
-	const char *sp;
-	char *dp;
-	char *buf;
-
-	buf = malloc(str_size(str) + 1);
-	if (buf == NULL)
-		return ENOMEM;
-
-	/* Break down string into list of (non)highlighted parts */
-	sp = str;
-	dp = buf;
-	while (*sp != '\0') {
-		if (*sp == '~') {
-			if (sp[1] == '~') {
-				sp += 2;
-				*dp++ = '~';
-			} else {
-				++sp;
-				*dp++ = '\0';
-			}
-		} else {
-			*dp++ = *sp++;
-		}
-	}
-
-	*dp++ = '\0';
-	*rbuf = buf;
-	*endptr = dp;
-
-	return EOK;
-}
-
 /** Compute UI text width.
  *
@@ -664,5 +616,5 @@
 
 	/* Break down string into list of (non)highlighted parts */
-	rc = ui_text_process(str, &buf, &endptr);
+	rc = ui_accel_process(str, &buf, &endptr);
 	if (rc != EOK)
 		return rc;
