Extract fails to find messages in files with Jinja comments enabled when prefix is ##
if Flask is set with Inline comments like this Flask.jinja_options = {'extensions': ['jinja2.ext.autoescape', 'jinja2.ext.with_'], 'line_comment_prefix': '##'}
And, you have a file in the search path which has text to extract but is also using the ## to comment out a line, then extract console says it is 'extracting messages from< the file>' but it might not find them. Uncommenting the ## lines if allowed or simply deleting them and running again will find the messages and they are added to the .pot file.
Here is a file that fails:
`<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
{{ _('hello world') }}
<div>
## {% end if %}
</div>
</body>
</html>`
Note that this is perfectly valid jinja2 since the orphan {% end if %} is commented out but extract will not add hello world to .pot file and does not throw an error. Deleting the commented line and extracting again will work. Note that not all ## comments seem to break it
After a good night's sleep, I took another look and tried different comment characters with the same result. I think the problem is simpler:
- I suspect that Extract does not know about Jinja2 inline comments at all so the ## are just characters. This means it will process every line in the file even if commented out.
- Extract does not skip files with bad HTML - adding line
<bad div>still works - Extract DOES skip files with bad Jinja2 - adding line {% bad jinja %} will cause Extract to skip the file
If a fix is not easy, a good start would be to throw an error message in the console instead of the normal extracting messages from xxxx