The title of this pull request changed from “FEATURE: always insert images as separate paragraphs” to "FEATURE: always insert images on new lines and add newline after
Looks good but let’s merge after new beta is cut.
This pull request has been mentioned on Discourse Meta. There might be relevant details there:
you could just do:
return textArea.value.charAt(selectionStart - 1) === "\n";
at the end
return selectionStart === 0 || textArea.value.charAt(selectionStart - 1) === "\n";
instead of the whole
if / else if / else block
Since it’s already merged I guess it’s better not to spam now with a commit that contains refactoring only?
But I will be writing such conditions shorter since we prefer this style.
It’s fine to leave it as is. I personally don’t mind.