Улучшено распознавание xml-формата

This commit is contained in:
Book Pauk
2020-12-15 15:04:30 +07:00
parent b1f5f3dd28
commit 8ef6551560
3 changed files with 10 additions and 2 deletions

View File

@@ -6,7 +6,10 @@ class ConvertFb2 extends ConvertBase {
check(data, opts) {
const {dataType} = opts;
return (dataType && dataType.ext == 'xml' && data.toString().indexOf('<FictionBook') >= 0);
return (
( (dataType && dataType.ext == 'xml') || this.isDataXml(data) ) &&
data.toString().indexOf('<FictionBook') >= 0
);
}
async run(data, opts) {