<commit_before><script>
    $(() => {
        $('form').submit(e => {
            const parser = new Parser.default()
            const $input = $('input[name={{ $inputName }}]')

            try {
                parser.parse($input.val())
            } catch (e) {
                const errors = parser.getErrors()
                let template = '<div class="text-danger">'
                errors.forEach(error => {
                    template += `${error}<br>`
                })
                template += '</div>'

                $input.after(template)

                return false
            }

            return true
        })
    })
</script><commit_msg>fix(frontend): enhance view of syntax errors<commit_after><script>
    $(() => {
        $('form').submit(e => {
            const parser = new Parser.default()
            const $input = $('input[name={{ $inputName }}]')
            const $syntaxErrors = $('.syntax-errors')

            try {
                parser.parse($input.val())
            } catch (e) {
                const errors = parser.getErrors()
                let template = ''
                errors.forEach(error => {
                    template += `${error}<br>`
                })

                if ($syntaxErrors.length) {
                  $syntaxErrors.html(template)
                } else {
                    $input.after(`
<div class="alert alert-danger syntax-errors">${template}</div>
`)
                }

                return false
            }

            return true
        })
    })
</script>
{'fraction_non_alphanumeric': 0.14634146341463414, 'fraction_numerical': 0.0, 'mean_word_length': 1.195774647887324, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2406849', 'n_tokens_mistral': 412, 'n_tokens_neox': 373, 'n_words': 75}