Allow for trailing spaces after front matter open/close fences (fixes #208).

This commit is contained in:
David Anson 2019-07-27 18:10:26 -07:00
parent 91b4fcd55f
commit cd7a65cedd
8 changed files with 36 additions and 2 deletions

View file

@ -8,7 +8,8 @@ module.exports.newLineRe = /\r[\n\u0085]?|[\n\u2424\u2028\u0085]/;
// Regular expression for matching common front matter (YAML and TOML)
module.exports.frontMatterRe =
/((^---$[^]*?^---$)|(^\+\+\+$[^]*?^(\+\+\+|\.\.\.)$))(\r\n|\r|\n|$)/m;
// eslint-disable-next-line max-len
/((^---\s*$[^]*?^---\s*$)|(^\+\+\+\s*$[^]*?^(\+\+\+|\.\.\.)\s*$))(\r\n|\r|\n|$)/m;
// Regular expression for matching inline disable/enable comments
const inlineCommentRe =