diff --git a/cypress/e2e/versions.spec.js b/cypress/e2e/versions.spec.js
index 6ee87c89dbb..4c0350d8fb8 100644
--- a/cypress/e2e/versions.spec.js
+++ b/cypress/e2e/versions.spec.js
@@ -34,12 +34,12 @@ describe('Versions', () => {
cy.get('[data-files-versions-versions-list] li a').should('have.length', 3)
cy.get('[data-files-versions-versions-list] li a').eq(1).click()
- cy.get('.viewer__content #read-only-editor')
+ cy.getContent()
.find('h1')
.should('contain.text', 'V2')
cy.get('[data-files-versions-versions-list] li a').eq(2).click()
- cy.get('.viewer__content #read-only-editor')
+ cy.getContent()
.find('h1')
.should('contain.text', 'V1')
@@ -68,12 +68,12 @@ describe('Versions', () => {
cy.get('[data-files-versions-versions-list] li a').should('have.length', 3)
cy.get('[data-files-versions-versions-list] li a').eq(1).click()
- cy.get('.viewer__content #read-only-editor')
+ cy.getContent()
.find('h1')
.should('contain.text', 'V2')
cy.get('[data-files-versions-versions-list] li a').eq(2).click()
- cy.get('.viewer__content #read-only-editor')
+ cy.getContent()
.find('h1')
.should('contain.text', 'V1')
@@ -113,7 +113,7 @@ describe('Versions', () => {
.should('contain', 'Compare to current version')
.click()
- cy.get('.viewer__content #read-only-editor')
+ cy.getContent()
.find('h1')
.should('contain.text', '#V1')
diff --git a/src/components/Editor/MarkdownContentEditor.vue b/src/components/Editor/MarkdownContentEditor.vue
index af2128cc4e3..992a83c578d 100644
--- a/src/components/Editor/MarkdownContentEditor.vue
+++ b/src/components/Editor/MarkdownContentEditor.vue
@@ -8,10 +8,12 @@
:show-outline-outside="showOutlineOutside"
@outline-toggled="outlineToggled">
-
-
-
-
+
+
+
+
+
+
@@ -75,6 +77,10 @@ export default {
type: String,
default: null,
},
+ showMenuBar: {
+ type: Boolean,
+ default: true,
+ },
showOutlineOutside: {
type: Boolean,
default: false,
@@ -175,6 +181,7 @@ export default {
}
-
diff --git a/src/components/ViewerComponent.vue b/src/components/ViewerComponent.vue
index b8d359cf5c4..efa8cb61f65 100644
--- a/src/components/ViewerComponent.vue
+++ b/src/components/ViewerComponent.vue
@@ -17,7 +17,11 @@
id="editor-container"
data-text-el="editor-container"
class="text-editor source-viewer">
-
+
{{ t('text', 'Edit') }}
@@ -33,7 +37,7 @@ import axios from '@nextcloud/axios'
import PencilIcon from 'vue-material-design-icons/Pencil.vue'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import PlainTextReader from './PlainTextReader.vue'
-import RichTextReader from './RichTextReader.vue'
+import MarkdownContentEditor from './Editor/MarkdownContentEditor.vue'
import { translate, translatePlural } from '@nextcloud/l10n'
import { getSharingToken } from '../helpers/token.js'
@@ -47,8 +51,8 @@ export default {
components: {
NcButton: Vue.extend(NcButton),
PencilIcon: Vue.extend(PencilIcon),
- RichTextReader: Vue.extend(RichTextReader),
PlainTextReader: Vue.extend(PlainTextReader),
+ MarkdownContentEditor: Vue.extend(MarkdownContentEditor),
Editor: getEditorInstance,
},
provide() {
@@ -112,7 +116,7 @@ export default {
/** @return {boolean} */
readerComponent() {
- return this.mime === 'text/markdown' ? RichTextReader : PlainTextReader
+ return this.mime === 'text/markdown' ? MarkdownContentEditor : PlainTextReader
},
},