Skip to content

Commit

Permalink
Merge branch 'mde-improvements' into 'main'
Browse files Browse the repository at this point in the history
Mde improvements

See merge request reportcreator/reportcreator!468
  • Loading branch information
MWedl committed Mar 1, 2024
2 parents 314812b + 03efb0e commit cf39061
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

## Next
* Allow configuring the PDF rendering timeout (applies only when a separate worker is used)
* Add filename in markdown editor for uploaded files
* Move cursor after uploaded file/image in markdown editor
* Prevent cutting off spellcheck error underlines in string fields


## v2024.16 - 2024-02-22
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/components/Markdown/TextFieldContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ defineExpose({
border-radius: 10%;
}
// Hide scrollbar
.cm-scroller {
// Hide scrollbar
overflow: hidden;
// Prevent cutting off spellcheck error underline
padding-bottom: 1px;
}
}
</style>
2 changes: 1 addition & 1 deletion frontend/src/composables/lockedit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ export function useProjectLockEdit<T>(options: {
if (res.resource_type === UploadedFileType.IMAGE) {
return `![](/images/name/${res.name}){width="auto"}`;
} else {
return `[](/files/name/${res.name})`;
return `[${res.name}](/files/name/${res.name})`;
}
}
function rewriteFileUrl(fileSrc: string) {
Expand Down
7 changes: 5 additions & 2 deletions frontend/src/composables/markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,12 @@ export function useMarkdownEditor({ props, emit, extensions }: {

const mdFileText = results.filter(u => u).join('\n');
if (pos === undefined || pos === null) {
pos = editorView.value.state.selection.main.from;
pos = editorView.value.state.selection.main.to;
}
editorView.value.dispatch({ changes: { from: pos, to: pos, insert: mdFileText } });
editorView.value.dispatch(editorView.value.state.update({
changes: { from: pos, to: pos, insert: mdFileText },
selection: { anchor: pos! + mdFileText.length },
}));
} finally {
fileUploadInProgress.value = false;
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/notes/personal/[noteId].vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ async function uploadFile(file: File) {
if (obj.resource_type === 'file') {
return `[${obj.name}](/files/name/${obj.name})`;
} else {
return `![](/images/name/${obj.name}){width="auto"}`;
return `![${obj.name}](/images/name/${obj.name}){width="auto"}`;
}
}
function rewriteFileUrl(imgSrc: string) {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/projects/[projectId]/reporting.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<split-menu v-model="localSettings.reportInputMenuSize">
<template #menu>
<v-list density="compact" class="pb-0 h-100 d-flex flex-column">
<v-list density="compact" class="pb-0 pt-0 h-100 d-flex flex-column">
<div class="flex-grow-1 overflow-y-auto">
<v-list-subheader title="Sections" class="mt-0" />
<v-list-item
Expand Down
2 changes: 1 addition & 1 deletion packages/markdown/editor/language.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const markdownLanguageFacet = defineLanguageFacet({
block: {open: '<!--', close: '-->'}
},
closeBrackets: {
brackets: ["(", "[", "{", "'", '"', "`", "*", "_", "~"],
brackets: ["(", "[", "{", "'", '"', "`", "_", "~"],
},
});

Expand Down

0 comments on commit cf39061

Please sign in to comment.