Browse Source
Merge pull request #11756 from rusikv/bug/html-error-entity-error
Disabled "Named entity expected" for html editor
pull/11990/head
Igor Kulikov
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
11 additions and
1 deletions
-
ui-ngx/src/app/shared/components/html.component.ts
|
|
|
@ -126,7 +126,17 @@ export class HtmlComponent implements OnInit, OnDestroy, ControlValueAccessor, V |
|
|
|
}); |
|
|
|
// @ts-ignore
|
|
|
|
this.htmlEditor.session.on('changeAnnotation', () => { |
|
|
|
const annotations = this.htmlEditor.session.getAnnotations(); |
|
|
|
const annotations = this.htmlEditor.session.getAnnotations() || []; |
|
|
|
const length = annotations.length; |
|
|
|
let i = length; |
|
|
|
while (i--) { |
|
|
|
if(annotations[i].text.includes('Named entity expected')) { |
|
|
|
annotations.splice(i, 1); |
|
|
|
} |
|
|
|
} |
|
|
|
if (length > annotations.length) { |
|
|
|
this.htmlEditor.session.setAnnotations(annotations); |
|
|
|
} |
|
|
|
const hasErrors = annotations.filter(annotation => annotation.type === 'error').length > 0; |
|
|
|
if (this.hasErrors !== hasErrors) { |
|
|
|
this.hasErrors = hasErrors; |
|
|
|
|