Add a couple more validation checks (#456)

This commit is contained in:
James Nylen 2018-07-20 13:30:21 -05:00 committed by GitHub
parent 7f33cdc825
commit 7b0e9459e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -139,6 +139,23 @@ exports.parseFromDirectory = contentPath => {
); );
} }
if (
$td.eq( 1 ).children().length !== 1 ||
! $td.eq( 1 ).children().eq( 0 ).is( 'a' )
) {
readmeError(
'Invalid content in Website column: %s',
$( tr ).html().replace( /\n/g, '' )
);
}
if ( $td.eq( 2 ).children().length > 0 ) {
readmeError(
'Extra content in Region column: %s',
$( tr ).html().replace( /\n/g, '' )
);
}
if ( if (
lastCompanyName && lastCompanyName &&
readmeEntry.name.toLowerCase() < lastCompanyName.toLowerCase() readmeEntry.name.toLowerCase() < lastCompanyName.toLowerCase()