mirror of
https://github.com/alecthomas/chroma.git
synced 2025-07-01 00:35:06 +02:00
Invert default "ensure newline" behaviour so that it is opt-in.
See #47.
This commit is contained in:
@ -300,7 +300,7 @@ func (r *RegexLexer) Tokenise(options *TokeniseOptions, text string) (Iterator,
|
||||
if options == nil {
|
||||
options = defaultOptions
|
||||
}
|
||||
if !r.config.DontEnsureNL && !strings.HasSuffix(text, "\n") {
|
||||
if r.config.EnsureNL && !strings.HasSuffix(text, "\n") {
|
||||
text += "\n"
|
||||
}
|
||||
state := &LexerState{
|
||||
|
Reference in New Issue
Block a user