fix: Isolate unicode characters in display names (#9702)

This fixes a 'Follows you' badge on a profile page and account addresses in threads from being drawn backwards when an account has some special Unicode characters that change the direction of text in their name (i.e. U+202E RIGHT-TO-LEFT OVERRIDE).

Co-authored-by: fruye <fruye@unix.dog>
Reviewed-on: https://codeberg.org/calckey/calckey/pulls/9702
Co-authored-by: fruye <fruye@noreply.codeberg.org>
Co-committed-by: fruye <fruye@noreply.codeberg.org>
This commit is contained in:
fruye 2023-03-15 07:18:18 +00:00 committed by Kainoa Kanter
parent 1653cb5964
commit 77ff4ca78f

View file

@ -1,5 +1,5 @@
<template>
<Mfm :text="user.name || user.username" :plain="true" :nowrap="nowrap" :custom-emojis="user.emojis"/>
<Mfm :class="$style.root" :text="user.name || user.username" :plain="true" :nowrap="nowrap" :custom-emojis="user.emojis"/>
</template>
<script lang="ts" setup>
@ -13,3 +13,9 @@ const props = withDefaults(defineProps<{
nowrap: true,
});
</script>
<style lang="scss" module>
.root {
unicode-bidi: isolate;
}
</style>