feat: use more flexible splitter.

This commit is contained in:
rabbitism
2024-06-24 11:47:36 +08:00
parent 63c0b0547f
commit cd12ab5560

View File

@@ -274,8 +274,7 @@ public class TagInput : TemplatedControl
} }
else if (AcceptsReturn && args.Key==Key.Enter) else if (AcceptsReturn && args.Key==Key.Enter)
{ {
var texts = _textBox.Text?.Split(new[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries) ?? var texts = _textBox.Text?.Split(["\r", "\n"], StringSplitOptions.RemoveEmptyEntries) ?? [];
[];
foreach (var text in texts) foreach (var text in texts)
{ {
AddTags(text); AddTags(text);