olivierkes / manuskript

A open-source tool for writers
http://www.theologeek.ch/manuskript
GNU General Public License v3.0
1.71k stars 226 forks source link

Fix regex for ignoring multi-line comments. #1212

Closed sagev9000 closed 10 months ago

sagev9000 commented 10 months ago

.* doesn't pick up newlines, so multi-line comments were not being correctly dropped from the word count. [\s\S] is a simple workaround, though any of [\w\W], [\d\D], or (.|\s) should also work.

TheJackiMonster commented 10 months ago

You are right. But I think we should use the re.DOTALL or re.S flag instead since it's more legible. See here and in the docs.