mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-06-28 16:20:34 +08:00
Merge pull request #494 from Klotske/fix-word-count
#492 - Add regex word counter
This commit is contained in:
@@ -12,7 +12,7 @@ interface TrackedTextboxProps {
|
||||
}
|
||||
|
||||
export const TrackedTextarea = (props: TrackedTextboxProps) => {
|
||||
const wordCount = props.text.split(" ").length - 1;
|
||||
const wordCount = (props.text.match(/\w+/g) || []).length;
|
||||
|
||||
let progressColor: string;
|
||||
switch (true) {
|
||||
|
||||
Reference in New Issue
Block a user