diff --git a/images/icon-black.svg b/images/icon-black.svg index 36cc714bd..f710dce46 100644 --- a/images/icon-black.svg +++ b/images/icon-black.svg @@ -1,5 +1,5 @@ - TrilliumNext Notes + TriliumNext Notes \ No newline at end of file diff --git a/images/icon-color.svg b/images/icon-color.svg index 8e33632d2..173712891 100644 --- a/images/icon-color.svg +++ b/images/icon-color.svg @@ -1,6 +1,6 @@ - TrilliumNext Notes + TriliumNext Notes

A diff:

+
Hello
+            -world
+            +worldy
+            
`; + const expected = trimIndentation`\ + A diff: + + \`\`\`diff + Hello + -world + +worldy + + \`\`\``; + + expect(markdownExportService.toMarkdown(html)).toBe(expected); + }); + + it("removes auto tag for code blocks", () => { + const html = trimIndentation`\ +
Hello
+            -world
+            +worldy
+            
`; + const expected = trimIndentation`\ + \`\`\` + Hello + -world + +worldy + + \`\`\``; + + expect(markdownExportService.toMarkdown(html)).toBe(expected); + }); + + it("supports code block with no language tag", () => { + const html = trimIndentation`\ +
Hello
`; + const expected = trimIndentation`\ + \`\`\` + Hello + \`\`\``; + + expect(markdownExportService.toMarkdown(html)).toBe(expected); + }); +}); \ No newline at end of file diff --git a/spec/support/utils.spec.ts b/spec/support/utils.spec.ts new file mode 100644 index 000000000..3c3b2ce80 --- /dev/null +++ b/spec/support/utils.spec.ts @@ -0,0 +1,14 @@ +import { trimIndentation } from "./utils.js"; + +describe("Utils", () => { + it("trims indentation", () => { + expect(trimIndentation`\ + Hello + world + 123` + ).toBe(`\ +Hello + world +123`); + }); +}); \ No newline at end of file diff --git a/spec/support/utils.ts b/spec/support/utils.ts new file mode 100644 index 000000000..849cfe840 --- /dev/null +++ b/spec/support/utils.ts @@ -0,0 +1,21 @@ +export function trimIndentation(strings: TemplateStringsArray) { + const str = strings.toString(); + + // Count the number of spaces on the first line. + let numSpaces = 0; + while (str.charAt(numSpaces) == ' ' && numSpaces < str.length) { + numSpaces++; + } + + // Trim the indentation of the first line in all the lines. + const lines = str.split("\n"); + const output = []; + for (let i=0; i { /** @returns true if the note has string content (not binary) */ hasStringContent(): boolean { - return this.type !== undefined && utils.isStringNote(this.type, this.mime); + return utils.isStringNote(this.type, this.mime); // here was !== undefined && utils.isStringNote(this.type, this.mime); I dont know why we need !=undefined. But it filters out canvas libary items } isContentAvailable() { diff --git a/src/public/app/components/root_command_executor.js b/src/public/app/components/root_command_executor.js index 6d65d5c80..a69d7c006 100644 --- a/src/public/app/components/root_command_executor.js +++ b/src/public/app/components/root_command_executor.js @@ -82,9 +82,10 @@ export default class RootCommandExecutor extends Component { async showBackendLogCommand() { await appContext.tabManager.openTabWithNoteWithHoisting('_backendLog', { activate: true }); } - + async showLaunchBarSubtreeCommand() { await this.showAndHoistSubtree('_lbRoot'); + this.showLeftPaneCommand(); } async showShareSubtreeCommand() { diff --git a/src/public/app/widgets/containers/ribbon_container.js b/src/public/app/widgets/containers/ribbon_container.js index 522a29e37..d6dcbe95c 100644 --- a/src/public/app/widgets/containers/ribbon_container.js +++ b/src/public/app/widgets/containers/ribbon_container.js @@ -227,7 +227,7 @@ export default class RibbonContainer extends NoteContextAwareWidget { .attr('data-ribbon-component-name', ribbonWidget.name) .append($('') .addClass(ret.icon) - .attr("data-title", ret.title) + .attr("title", ret.title) .attr('data-toggle-command', ribbonWidget.toggleCommand)) .append(" ") .append($('').text(ret.title)); diff --git a/src/public/app/widgets/dialogs/about.js b/src/public/app/widgets/dialogs/about.js index d58cb1091..f7ddea083 100644 --- a/src/public/app/widgets/dialogs/about.js +++ b/src/public/app/widgets/dialogs/about.js @@ -12,7 +12,7 @@ const TPL = `