mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
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:
parent
7f0384b968
commit
20d9a26a8c
2 changed files with 6 additions and 1 deletions
|
@ -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}
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue