dvWebFileProblem function
Why path cannot name a snippet file, or null when it can.
Implementation
String? dvWebFileProblem(String path) {
final List<String> parts = path.split('/');
if (parts.length < 2 ||
parts.first != dvHtmlSnippetDirectory ||
parts.any((String part) => part == '..' || part == '.' || part.isEmpty)) {
return '"$path" must be a file under html/, such as html/head.html'
'${parts.first == 'web' ? ' (web/ is generated by the build and not kept in git)' : ''}.';
}
return null;
}