Skip to content

Commit

Permalink
fix #105 - validate all strings (#117)
Browse files Browse the repository at this point in the history
any string that is not empty, including whitespace strings, should
validate?
  • Loading branch information
acao authored Jun 1, 2024
1 parent 41c0f66 commit edafa8f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/few-emus-live.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"codemirror-json-schema": patch
---

validate all strings with length > 1
2 changes: 1 addition & 1 deletion src/features/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export class JSONValidation {
const text = view.state.doc.toString();

// ignore blank json strings
if (!text || text.trim().length < 3) return [];
if (!text || !text.length) return [];

const json = this.parser(view.state);

Expand Down

0 comments on commit edafa8f

Please sign in to comment.