You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This library does not support rendering \unicode{xxx} into unicode characters, you can match such formulas before parsing and replace them with unicode characters to display
Here I use regular expressions to filter and replace, it should be able to support \unicode{xxx}, hope you can add it if you have time
/// replace all unicode directives before parsing////// rule of '\unicode{xxx}'/// - \unicode{ [^x][0-9a-zA-Z]* } -- decimal/// - \unicode{ x[0-9a-zA-Z]* } -- hexadecimalStringunicodeFilter(String raw) {
var reg =RegExp(
r'\${1,2}\\unicode\{(?<isHex>x)?(?<val>[0-9a-eA-E]*)\}\${1,2}',
dotAll:true,
);
String replaced ='';
int p =0;
reg.allMatches(raw).forEach((part) {
if (part.start > p) {
replaced += raw.substring(p, part.start);
}
bool isHex = part.namedGroup('isHex') =='x';
int? v =int.tryParse(part.namedGroup('val') ??'', radix: isHex ?16:10);
if (v !=null) replaced +=String.fromCharCode(v);
p = part.end;
});
return replaced;
}
The text was updated successfully, but these errors were encountered:
This library does not support rendering
\unicode{xxx}
into unicode characters, you can match such formulas before parsing and replace them with unicode characters to displayHere I use regular expressions to filter and replace, it should be able to support
\unicode{xxx}
, hope you can add it if you have timeThe text was updated successfully, but these errors were encountered: