diff --git a/app/internal_packages/composer-signature/lib/signature-utils.es6 b/app/internal_packages/composer-signature/lib/signature-utils.es6
index 0738437c1..751fdfa38 100644
--- a/app/internal_packages/composer-signature/lib/signature-utils.es6
+++ b/app/internal_packages/composer-signature/lib/signature-utils.es6
@@ -12,7 +12,7 @@ export function currentSignatureId(body) {
}
export function applySignature(body, signature) {
- let additionalWhitespace = '
';
+ let additionalWhitespace = '
';
// Remove any existing signature in the body
let newBody = body;
diff --git a/app/internal_packages/composer-signature/specs/signature-composer-dropdown-spec.jsx b/app/internal_packages/composer-signature/specs/signature-composer-dropdown-spec.jsx
index 5a24f7ea4..91b09e46e 100644
--- a/app/internal_packages/composer-signature/specs/signature-composer-dropdown-spec.jsx
+++ b/app/internal_packages/composer-signature/specs/signature-composer-dropdown-spec.jsx
@@ -47,8 +47,7 @@ describe('SignatureComposerDropdown', function signatureComposerDropdown() {
);
ReactTestUtils.Simulate.mouseDown(this.signature);
expect(this.button.props.session.changes.add).toHaveBeenCalledWith({
- body: `${this.button.props.draft
- .body}${sigToAdd.body}`,
+ body: `${this.button.props.draft.body}
${sigToAdd.body}`,
});
});
it('finds and removes the signature when no signature is clicked and there is a current signature', () => {
diff --git a/app/internal_packages/composer-signature/specs/signature-composer-extension-spec.es6 b/app/internal_packages/composer-signature/specs/signature-composer-extension-spec.es6
index 8a9e7e107..327909d4b 100644
--- a/app/internal_packages/composer-signature/specs/signature-composer-extension-spec.es6
+++ b/app/internal_packages/composer-signature/specs/signature-composer-extension-spec.es6
@@ -38,11 +38,11 @@ describe('SignatureComposerExtension', function signatureComposerExtension() {
SignatureComposerExtension.prepareNewDraft({ draft: a });
expect(a.body).toEqual(
- `This is a test! ${TEST_SIGNATURE.body}Hello world
`
+ `This is a test!
${TEST_SIGNATURE.body}Hello world
`
);
SignatureComposerExtension.prepareNewDraft({ draft: b });
expect(b.body).toEqual(
- `This is a another test.${TEST_SIGNATURE.body}`
+ `This is a another test.
${TEST_SIGNATURE.body}`
);
});
diff --git a/app/internal_packages/composer/specs/send-action-button-spec.jsx b/app/internal_packages/composer/specs/send-action-button-spec.jsx
index a7e9b4576..57d69481f 100644
--- a/app/internal_packages/composer/specs/send-action-button-spec.jsx
+++ b/app/internal_packages/composer/specs/send-action-button-spec.jsx
@@ -28,7 +28,7 @@ const NoIconUrl = {
performSendAction() {},
};
-fdescribe('SendActionButton', function describeBlock() {
+describe('SendActionButton', function describeBlock() {
beforeEach(() => {
spyOn(Actions, 'sendDraft');
this.isValidDraft = jasmine.createSpy('isValidDraft');
diff --git a/app/internal_packages/composer/styles/composer.less b/app/internal_packages/composer/styles/composer.less
index d9032ec41..02257f358 100644
--- a/app/internal_packages/composer/styles/composer.less
+++ b/app/internal_packages/composer/styles/composer.less
@@ -55,7 +55,7 @@
}
}
blockquote {
- color: purple;
+ color: #500050;
}
&:hover {
border: 1px dashed @border-color-divider;
diff --git a/app/src/components/composer-editor/base-block-plugins.jsx b/app/src/components/composer-editor/base-block-plugins.jsx
index a7d07812f..5860ac91f 100644
--- a/app/src/components/composer-editor/base-block-plugins.jsx
+++ b/app/src/components/composer-editor/base-block-plugins.jsx
@@ -161,6 +161,14 @@ const rules = [
config = BLOCK_CONFIG.code;
}
+ // div elements that are entirely empty and have no meaningful-looking styles applied
+ // would probably just add extra whitespace
+ if (tagName === 'div' && !el.hasChildNodes()) {
+ const s = (el.getAttribute('style') || '').toLowerCase();
+ if (!s.includes('background') && !s.includes('margin') && !s.includes('padding')) {
+ return;
+ }
+ }
// return block
if (config) {
return {
diff --git a/app/src/components/composer-editor/base-mark-plugins.jsx b/app/src/components/composer-editor/base-mark-plugins.jsx
index 28c1111b1..10fe3b217 100644
--- a/app/src/components/composer-editor/base-mark-plugins.jsx
+++ b/app/src/components/composer-editor/base-mark-plugins.jsx
@@ -7,6 +7,8 @@ import {
hasMark,
} from './toolbar-component-factories';
+import BaseBlockPlugins from './base-block-plugins';
+
export const DEFAULT_FONT_SIZE = 2;
export const DEFAULT_FONT_OPTIONS = [
{ name: 'Small', value: 1 },
@@ -194,13 +196,28 @@ const rules = [
}
if (marks.length) {
+ // convert array of marks into a tree. If the marks are on a BLOCK
+ // tagname, also nest the marks within the block node that would
+ // have been created, since the block will not be created if we return
+ // a value.
+ let block = null;
+ for (const plugin of BaseBlockPlugins) {
+ if (block) break;
+ if (!plugin.rules) continue;
+ for (const { deserialize } of plugin.rules) {
+ block = deserialize(el, next);
+ if (block) {
+ break;
+ }
+ }
+ }
const root = marks[0];
let tail = root;
for (let x = 1; x < marks.length; x++) {
tail.nodes = [marks[x]];
tail = tail.nodes[0];
}
- tail.nodes = next(el.childNodes);
+ tail.nodes = block ? [block] : next(el.childNodes);
return root;
}
},
diff --git a/app/src/flux/stores/draft-factory.es6 b/app/src/flux/stores/draft-factory.es6
index ec161faef..6afb10e01 100644
--- a/app/src/flux/stores/draft-factory.es6
+++ b/app/src/flux/stores/draft-factory.es6
@@ -34,7 +34,7 @@ class DraftFactory {
async createDraft(fields = {}) {
const account = this._accountForNewDraft();
const defaults = {
- body: '',
+ body: '
',
subject: '',
version: 0,
unread: false,
@@ -164,15 +164,15 @@ class DraftFactory {
accountId: message.accountId,
replyToHeaderMessageId: message.headerMessageId,
body: `
-
-
+
+
${DOMUtils.escapeHTMLCharacters(
message.replyAttributionLine()
)}
${prevBody}
-
+
`,
});
@@ -200,7 +200,7 @@ class DraftFactory {
accountId: message.accountId,
forwardedHeaderMessageId: message.headerMessageId,
body: `
-
+
---------- Forwarded message ---------
@@ -208,7 +208,7 @@ class DraftFactory {
${fields.join('
')}
${body}
-
+
`,
});