hasUnsupportedPlainContainerControls function
bool
hasUnsupportedPlainContainerControls(
- String text
)
Implementation
bool hasUnsupportedPlainContainerControls(String text) {
for (var i = 0; i < text.length; i++) {
final code = text.codeUnitAt(i);
if (code == 0x1B) {
if (i + 1 >= text.length) return true;
final next = text.codeUnitAt(i + 1);
if (next == 0x5B) continue; // CSI, including SGR.
return true;
}
if (code == 0x9B) continue; // C1 CSI.
if (code >= 0x80 && code <= 0x9F) return true;
}
return false;
}