Skip to content

A platform for community discussion. Free, open, simple.

UX: ensure whitespace isn't removed when playing with quotes

Régis Hanole209faa6cf09
diff --git a/app/assets/javascripts/discourse/components/quote-button.js.es6 b/app/assets/javascripts/discourse/components/quote-button.js.es6
index 5d41b049cc7..49ee520e95a 100644
--- a/app/assets/javascripts/discourse/components/quote-button.js.es6
+++ b/app/assets/javascripts/discourse/components/quote-button.js.es6
@@ -78,7 +78,10 @@ export default Ember.Component.extend({
const $quoteButton = this.$();
// remove the marker
- markerElement.parentNode.removeChild(markerElement);
+ const parent = markerElement.parentNode;
+ parent.removeChild(markerElement);
+ // merge back all text nodes so they don't get messed up
+ parent.normalize();
// work around Safari that would sometimes lose the selection
if (isSafari) {