Skip to content

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

feat: add h1

ammarahm-edbe72e8760f29
diff --git a/apps/mobile/html/Web.bundle/site/constants.js b/apps/mobile/html/Web.bundle/site/constants.js
index 1aeabb524..e3df77739 100755
--- a/apps/mobile/html/Web.bundle/site/constants.js
+++ b/apps/mobile/html/Web.bundle/site/constants.js
@@ -26,6 +26,7 @@ const markdownPatterns = [
{ start: '*', end: '*', format: 'italic' },
{ start: '**', end: '**', format: 'bold' },
{ start: '`', end: '`', format: 'code' },
+ { start: '# ', format: 'h1' },
{ start: '## ', format: 'h2' },
{ start: '### ', format: 'h3' },
{ start: '#### ', format: 'h4' },
@@ -619,6 +620,16 @@ pre code {
overflow-x:auto !important;
}
+
+h1::before,
+h2::before,
+h3::before,
+h4::before,
+h5::before,
+h6::before {
+ background-color: ${pageTheme.colors.icon};
+}
+
`;
if (pageTheme.colors.night) {
diff --git a/apps/mobile/src/screens/editor/tiny/toolbar/commands.js b/apps/mobile/src/screens/editor/tiny/toolbar/commands.js
index 855b2eb8d..3c5f513d6 100644
--- a/apps/mobile/src/screens/editor/tiny/toolbar/commands.js
+++ b/apps/mobile/src/screens/editor/tiny/toolbar/commands.js
@@ -26,9 +26,7 @@ export const execCommands = {
hilitecolor: color => `tinymce.activeEditor.execCommand('HiliteColor',false, '${color}');`,
dforecolor: color => `tinymce.activeEditor.execCommand('ForeColor',false, '${color}');`,
dhilitecolor: color => `tinymce.activeEditor.execCommand('HiliteColor',false, '${color}');`,
-
fontname: fontname => `tinymce.activeEditor.execCommand('FontName',false, '${fontname}');`,
-
indent: `tinymce.activeEditor.execCommand('Indent');`,
outdent: `tinymce.activeEditor.execCommand('Outdent');`,
blockquote: `tinymce.activeEditor.execCommand('mceBlockQuote');`,
@@ -37,6 +35,7 @@ export const execCommands = {
fontsize: size => `tinymce.activeEditor.execCommand('FontSize', false, '${size}');`,
removeformat: `tinymce.activeEditor.execCommand('RemoveFormat');`,
p: `tinymce.activeEditor.execCommand('FormatBlock', false, 'p');`,
+ h1: `tinymce.activeEditor.execCommand('FormatBlock', false, 'h2');`,
h2: `tinymce.activeEditor.execCommand('FormatBlock', false, 'h2');`,
h3: `tinymce.activeEditor.execCommand('FormatBlock', false, 'h3');`,
h4: `tinymce.activeEditor.execCommand('FormatBlock', false, 'h4');`,
diff --git a/apps/mobile/src/screens/editor/tiny/toolbar/config.js b/apps/mobile/src/screens/editor/tiny/toolbar/config.js
index 8f1d8aabb..cd1d17f28 100644
--- a/apps/mobile/src/screens/editor/tiny/toolbar/config.js
+++ b/apps/mobile/src/screens/editor/tiny/toolbar/config.js
@@ -193,6 +193,12 @@ export const TOOLBAR_CONFIG = [
};
})
},
+ {
+ format: 'h1',
+ type: 'format',
+ showTitle: false,
+ fullname: 'Heading 1'
+ },
{
format: 'h2',
type: 'format',
@@ -213,13 +219,6 @@ export const TOOLBAR_CONFIG = [
showTitle: false,
fullname: 'Paragraph'
},
- {
- format: 'h2',
- text: 'Heading 2',
- type: 'format',
- showTitle: false,
- fullname: 'Heading 2'
- },
{
format: 'h3',
text: 'Heading 3',