Skip to content

Commit

Permalink
[yaml-frontmatter mode] Allow pandoc-style closing with ...
Browse files Browse the repository at this point in the history
This allows to end yaml-frontmatters with either `---` or `...`, as
suggested [on the discussion board][1]. The old behaviour was to just
accept `---`.

[1]: https://discuss.codemirror.net/t/pandoc-markdown-style-yaml-frontmatter/2182
  • Loading branch information
seifferth authored and cone56 committed Jan 6, 2020
1 parent 98f4879 commit a462fe0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mode/yaml-frontmatter/yaml-frontmatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
return innerMode.token(stream, state.inner)
}
} else if (state.state == FRONTMATTER) {
var end = stream.sol() && stream.match(/---/, false)
var end = stream.sol() && stream.match(/(---|\.\.\.)/, false)
var style = yamlMode.token(stream, state.inner)
if (end) {
state.state = BODY
Expand Down

0 comments on commit a462fe0

Please sign in to comment.