Note: I removed the trim logic in the preprocessor, for a couple of reasons:
According to the Jekyll front matter docs, front matter doesn't work if there is even a byte order mark. So I take that to mean any whitespace before the initial --- will also prevent Jekyll from processing it. Thus I thought it made more sense to only process files with --- at the very beginning with no leading whitespace.
Removing trailing whitespace from the end of the file could create some false positives or negatives in core ESLint rules (e.g., no-trailing-whitespace, eol-last), which care about trailing whitespace.
In general, the preprocessor should try to change the text as little as possible.
I added some postprocess tests as well-- in those cases, I just used the CLIEngine executeOnFiles method to simplify things a bit. Let me know if you think anything should change.
Note: I removed the trim logic in the preprocessor, for a couple of reasons:
---
will also prevent Jekyll from processing it. Thus I thought it made more sense to only process files with---
at the very beginning with no leading whitespace.no-trailing-whitespace
,eol-last
), which care about trailing whitespace.I added some postprocess tests as well-- in those cases, I just used the CLIEngine
executeOnFiles
method to simplify things a bit. Let me know if you think anything should change.