File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
app/javascript/components/bootcamp/FrontendExercisePage/LHS Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -57,14 +57,17 @@ export function LHS() {
57
57
if ( ! jsEditorRef . current || ! htmlEditorRef . current ) return
58
58
59
59
const htmlText = htmlEditorRef . current . state . doc . toString ( )
60
- const isHTMLValid = validateHtml ( htmlText )
61
-
62
- if ( ! isHTMLValid . isValid ) {
63
- setTab ( 'html' )
64
- toast . error (
65
- `Your HTML is invalid. Please check the linter and look for unclosed tags.`
66
- )
67
- return
60
+
61
+ if ( htmlText . length > 0 ) {
62
+ const isHTMLValid = validateHtml ( htmlText )
63
+
64
+ if ( ! isHTMLValid . isValid ) {
65
+ setTab ( 'html' )
66
+ toast . error (
67
+ `Your HTML is invalid. Please check the linter and look for unclosed tags.`
68
+ )
69
+ return
70
+ }
68
71
}
69
72
70
73
const jsView = jsEditorRef . current
You can’t perform that action at this time.
0 commit comments