Closed NGenetzky closed 6 years ago
I bounced back and forth on this in earlier versions and found that for my own sanity, using split()
just made everything easier.
The reason for exposing START_DELIMITER
and END_DELIMITER
is so people can change the output.
I'm going to close this, but I appreciate the input.
Regex is a powerful tool and it could be used to more precisely split the data. The performance impact appears to be negligible.
(^---$\s*[\S\s]*?\s*^---$\s)([\S\s]*)
(^\+\+\+$\s*[\S\s]*?\s*^\+\+\+$\s)([\S\s]*)
(^{$\s*[\S\s]*?\s*^}$\s)([\S\s]*)
I believe this would eliminate the need for
START_DELIMITER
andEND_DELIMITER
; however, these are exposed all the way up to the public API (for some reason?) and so that may be an issue.If someone wanted to get fancy I am sure all three of the above regex could be generated from a function that accepts start and end delimiters.