forked from Tadrisino/MathApp_frontend
MathText: last-line guard that turns stray LaTeX/markdown into plain Unicode
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { Fragment } from 'react';
|
||||
import { plainMath } from './plainMath';
|
||||
|
||||
/**
|
||||
* متنِ فارسی که ریاضی لایش است («عدد −۱ میشود»، «رأس (۱، −۴) است»).
|
||||
@@ -32,7 +33,8 @@ const EDGE_END = /[\s،؛:!؟«»"'.=]+$/;
|
||||
// سمتِ خودشان میکشیدند، پس فهرست باز برعکس میشد.
|
||||
const LTR = { unicodeBidi: 'isolate-override', direction: 'ltr' } as const;
|
||||
|
||||
export function MathText({ text }: { text: string }) {
|
||||
export function MathText({ text: raw }: { text: string }) {
|
||||
const text = plainMath(raw);
|
||||
const out: React.ReactNode[] = [];
|
||||
const depth = bracketDepth(text);
|
||||
let last = 0, i = 0;
|
||||
|
||||
Reference in New Issue
Block a user