In my last patch, I used replace-regexp-in-string to trim newline character \n at the end of each line. Unfortunately, it concatenates two (or more) lines directly without inserting whitespaces in-between. This patch should fix the aforementioned bug.
For this modification, a lisp function split-string from subr.el is used. split-string makes no assumption about whitespaces at the start or the end of input string, so it is safer, as quoted from its documentation:
If you want to trim whitespace from the substrings, the reliably correct
way is using TRIM. Making SEPARATORS match that whitespace gives incorrect
results when there is whitespace at the start or end of STRING. If you
see such calls to ‘split-string’, please fix them.
Also, I have made a living example in my fork of orgmk.
In my last patch, I used
replace-regexp-in-string
to trim newline character\n
at the end of each line. Unfortunately, it concatenates two (or more) lines directly without inserting whitespaces in-between. This patch should fix the aforementioned bug.For this modification, a lisp function
split-string
fromsubr.el
is used.split-string
makes no assumption about whitespaces at the start or the end of input string, so it is safer, as quoted from its documentation:Also, I have made a living example in my fork of orgmk.
Thanks.