Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

add support for line break

ammarahm-ed73412ce50e60
diff --git a/apps/mobile/src/views/Editor/tiny/toolbar/commands.js b/apps/mobile/src/views/Editor/tiny/toolbar/commands.js
index 01b5d52b3..b947785ce 100644
--- a/apps/mobile/src/views/Editor/tiny/toolbar/commands.js
+++ b/apps/mobile/src/views/Editor/tiny/toolbar/commands.js
@@ -233,7 +233,7 @@ export const execCommands = {
}
})();
`,
- imagefloatleft:`(function () {
+ imagefloatleft: `(function () {
let node = tinymce.activeEditor.selection.getNode();
if (node.tagName === 'IMG') {
@@ -253,7 +253,7 @@ let node = tinymce.activeEditor.selection.getNode();
})();
`,
- imagefloatright:`(function () {
+ imagefloatright: `(function () {
let node = tinymce.activeEditor.selection.getNode();
if (node.tagName === 'IMG') {
@@ -273,9 +273,8 @@ let node = tinymce.activeEditor.selection.getNode();
}
})()
- `
- ,
- imagefloatnone:`(function () {
+ `,
+ imagefloatnone: `(function () {
let node = tinymce.activeEditor.selection.getNode();
if (node.tagName === 'IMG') {
@@ -294,8 +293,11 @@ let node = tinymce.activeEditor.selection.getNode();
}
})()
- `
-
+ `,
+ 'line-break': `
+ tinymce.activeEditor.undoManager.transact(function() {
+ tinymce.activeEditor.execCommand('InsertLineBreak');
+ });`,
};
const handleImageResponse = response => {
diff --git a/apps/mobile/src/views/Editor/tiny/toolbar/config.js b/apps/mobile/src/views/Editor/tiny/toolbar/config.js
index 69294846c..f36380c45 100644
--- a/apps/mobile/src/views/Editor/tiny/toolbar/config.js
+++ b/apps/mobile/src/views/Editor/tiny/toolbar/config.js
@@ -28,6 +28,11 @@ export const TOOLBAR_CONFIG = [
type: 'format',
fullname: 'Strikethrough',
},
+ {
+ format: 'line-break',
+ type: 'format',
+ fullname: 'Line break',
+ },
{
format: 'align',
type: 'tooltip',
@@ -354,7 +359,7 @@ export const TOOLBAR_CONFIG = [
type: 'format',
fullname: 'Search & Replace',
},
- /* {
+ /* {
format: 'settings',
type: 'settings',
fullname: 'Editor Settings',
diff --git a/apps/mobile/src/views/Editor/tiny/toolbar/constants.js b/apps/mobile/src/views/Editor/tiny/toolbar/constants.js
index 891edd128..7eac497e8 100644
--- a/apps/mobile/src/views/Editor/tiny/toolbar/constants.js
+++ b/apps/mobile/src/views/Editor/tiny/toolbar/constants.js
@@ -182,4 +182,5 @@ export const TOOLBAR_ICONS = {
imagefloatleft:"format-float-left",
imagefloatright:"format-float-right",
imagefloatnone:"format-float-none",
+ "line-break":"keyboard-return"
};