Strip isolation chars from deck options warnings to fix RTL display (#1457)

Co-authored-by: Damien Elmes <dae@users.noreply.github.com>
This commit is contained in:
Abdo 2021-10-26 13:11:25 +03:00 committed by GitHub
parent 7f0384b968
commit 20d9a26a8c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -5,6 +5,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<script lang="ts">
import { slide } from "svelte/transition";
import Row from "./Row.svelte";
import { withoutUnicodeIsolation } from "../lib/i18n/";
export let warning: string;
</script>
@ -12,7 +13,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
{#if warning}
<Row>
<div class="col-12 alert alert-warning mb-0" in:slide out:slide>
{warning}
{withoutUnicodeIsolation(warning)}
</div>
</Row>
{/if}

View file

@ -62,6 +62,10 @@ export function withCollapsedWhitespace(s: string): string {
return s.replace(/\s+/g, " ");
}
export function withoutUnicodeIsolation(s: string): string {
return s.replace(/[\u2068-\u2069]+/g, "");
}
export async function setupI18n(args: { modules: ModuleName[] }): Promise<void> {
const resp = await fetch("/_anki/i18nResources", {
method: "POST",