Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/text.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/tests
AgeCommit message (Collapse)Author
2022-10-05feat: add tests for mentionsLuka Trovic
Signed-off-by: Luka Trovic <luka@nextcloud.com>
2022-10-03Added a unittest for escaping of table cellsFerdinand Thiessen
Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
2022-09-20Load Mention extension in RichText.jsJonas
Signed-off-by: Jonas <jonas@freesources.org>
2022-09-06add tests for attachment metadata url generationJulien Veyssier
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
2022-09-06adjust frontend testsJulien Veyssier
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
2022-09-06rename most frontend image stuff to attachment (except the Tiptap node)Julien Veyssier
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
2022-08-30tests: add paragraph to expected outputMax
It was added to ensure the trailing paragraph extension of tiptap does not trigger an autosave without other changes. Signed-off-by: Max <max@nextcloud.com>
2022-08-30Test that loading does not trigger a document changeJulius Härtl
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-08-25Mock additional methods of @nextcloud/auth during testsJulius Härtl
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-07-29Added tests for the front matter nodeFerdinand Thiessen
Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
2022-07-19Do not remove escaping from brackets, fixes #2703Ferdinand Thiessen
Removed the erroneous replacement of escaped brackets with plain brackets as this breaks valid markdown. Added a test case for this. Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
2022-07-19Added markdown parsing rules to tag special syntax to be not modified when savedFerdinand Thiessen
Added a markdown-it and tiptap extension to tag special, unknown, markdown syntax which would be escaped by prosemirror-markdown on save. The tagged part is not touched while saving if they are not modified manually. Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
2022-07-15Fix parsing of whitespace used in task listsFerdinand Thiessen
Switch to @hedgedoc/markdown-it-task-lists to fix parsing of task lists, namely allowing any whitespace inside the brackets, as by the github markdown specs. Doing this as markdown-it-task-lists seems orphaned, while hedgedoc is maintained and the bug is fixed there. This required adjusting the task-list testcase as the output is slightly different. Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
2022-07-15Ensure whitespaces in markdown files are preservedFerdinand Thiessen
Adjusted test cases to test whitespace characters are not touched. Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
2022-07-09Do not unintended remove or modify link titles, fixes #2699Ferdinand Thiessen
Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
2022-07-04package: expose ImageResolver so it can be provided to RichTextReaderMax
Signed-off-by: Max <max@nextcloud.com>
2022-06-10Bring back inline code supportJulius Härtl
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-06-07fix: remove nodes/index.js - import directlyMax
`vite dev` will load all imports in imported files. So for now it is better to not bundle multiple files in indexes. Signed-off-by: Max <max@nextcloud.com>
2022-06-07fix: image rendering via public previewsMax
Public Preview only has one route - it does not make use of the fileId. Signed-off-by: Max <max@nextcloud.com>
2022-06-07fix: image display with fallback to preview urlMax
If no session is established we cannot use the text endpoint. Use the dav endpoints instead. The ImageResolver now needs the fileId of the text file to compute the relative path to the image inside the attachments folder. Signed-off-by: Max <max@nextcloud.com>
2022-06-07refactor: inject $imageResolver in EditorWrapperMax
Signed-off-by: Max <max@nextcloud.com>
2022-06-07refactor: introduce ImageResolverMax
Prepare for injecting the image resolver. Make it easy to test the logic of which url to query for an image. Signed-off-by: Max <max@nextcloud.com>
2022-06-07Implement toMarkdown for hard break instead of replacing after markdown ↵Julius Härtl
transformation Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-05-23remove ImageView Jest tests, we will make better ones with CypressJulien Veyssier
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
2022-05-11fix: only show delete image button when editingMax
Also test for it being shown and triggering the deleteNode when editing. Signed-off-by: Max <max@nextcloud.com>
2022-03-31fix: preserve td and th attributesMax
Prosemirror expects colspan, rowspan and the like to calculate the table layout. Signed-off-by: Max <max@nextcloud.com>
2022-03-31fix: table layout to match prosemirror expectationsMax
Signed-off-by: Max <max@nextcloud.com>
2022-03-31fix: keep tables separate in markdownMax
Also make sure that table rows are rendered on one line each. Signed-off-by: Max <max@nextcloud.com>
2022-03-31fix: handling of various table formatsMax
Signed-off-by: Max <max@nextcloud.com>
2022-03-31refactor: render Markdown in table nodesMax
Each node is responsible for rendering its markdown content. This splits the responsibility and simplifies the `toMarkdown` functions a lot. At the same time it makes it harder to beautify the entire table because every cell only knows about itself - not about the rest of the column. To work around this we can introduce padding attributes for TableCell and TableHeader. These need to be updated when the content of the table changes. They will also allow us to preserve the original padding from a markdown file. Signed-off-by: Max <max@nextcloud.com>
2022-03-31feature: initial table supportMax
First take at parsing and serializing markdown tables. Use TableHead and TableBody nodes to mimic the markdown table structure with a single heading line on top and multiple td lines following. Signed-off-by: Max <max@nextcloud.com>
2022-03-22fix: detect callouts pasted from handbookMax
Signed-off-by: Max <max@nextcloud.com>
2022-03-14✅ (#2184): add markdown testsVinicius Reis
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
2022-03-14🚚 (#2184): use callout instead of callout-containerVinicius Reis
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
2022-03-14🚚 (#2184): rename feature to calloutsVinicius Reis
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
2022-03-14✨ (#2128): add markdown-it-containerVinicius Reis
define info, warn, error and success containers Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
2022-03-02fix: indicator of the task list.Max
See #2018. Use tiptap TaskList and TaskItem. Markdown-it happily mixes tasks and bullet points in the same list. Tiptap lists are strictly separated. Split bullet and tasks into BulletList and TaskList in markdown-io. Just like this will turn into three different lists: * one - two + three This will now also turn into three different lists with the middle one being a task list: * first list * [ ] todo * [x] done * third list Signed-off-by: Max <max@nextcloud.com>
2022-03-01Merge branch 'fix/master/image_data_urls' of ↵Max
https://github.com/DerpgonCz/text into DerpgonCz-fix/master/image_data_urls
2022-03-01update: replace the deprecated @babel/polyfillMax
Importing `core-js/stable` as recommended by https://babeljs.io/docs/en/babel-polyfill It is also not listed in our package.json. So far it was provided as a dependency of `emoji-mart-vue-fast` via `@nextcloud/vue`. Signed-off-by: Max <max@nextcloud.com>
2022-02-14fix: bring back horizontal ruleMax
Also drop @tiptap/starter-kit as we are not using it anymore. Signed-off-by: Max <max@nextcloud.com>
2022-02-09upgrade: tiptap v2Azul
Migrate the entire editor to tiptap v2. Some changes were introduces that go beyond just using the new tiptap API: *Collaboration* Port tiptap1 collaboration. We still want to use our session and sync mechanism. *Serialization* Add Markdown extension to handle serialization. Tiptap config extensions are not automatically added to the prosemirror schema anymore. The extension adds the `toMarkdown` config value to the prosemirror schema. With the new naming scheme tiptap nodes for a number of elements do not match the prosemirror names. Camelcase the marks and nodes from `defaultMarkdownSerializer` so they match the tiptap names. *Menubar* * Specify args for isActive function directly rather than setting a function. * Make use of the editor instance inside the MenuBar component. * Use the editor rather than slots for command, focused etc. * disable icons based on editor.can * Show menubar as long as submenus are open. When opening a submenu of the menubar keep track of the open menu even for the image and the remaining action menu. Also refocus the editor whenever a submenu is closed. *MenuBubble* Let tippy handle the positioning Tippy is really good at positioning the menu bubble. Remove all our workarounds and let it do its thing. In order for this to work the content of the MenuBubble actually needs to live inside the tippy-content. Tippy bases its calculations on the width of tippy-content. So if we have the content hanging in a separate div with absolute positioning tippy-content will be 0x0 px and not represent the actual width of the menu bubble. *Upgrade image node and ImageView.* Quite a bit of the syntax changed. We now need a wrapping `<node-view-wrapper>` element. Pretty good docs at https://tiptap.dev/guide/node-views/vue#render-a-vue-component We also need to handle the async action. It will run the action on it's own. So in `clickIcon()` we need to test if the action returned anything. Tiptap v1 had inline images. v2 keeps them outside of paragraphs by default. Configure Image node to use inline images as markdownit creates inline images right now. *Trailing Node* Tiptap v2 does not ship the trailing node extension anymore. Included the one from the demos and turned it from typescript into javascript. *Tests* In order to isolate some problems tests were added. The tests in Undeline.spec.js were green right from the beginning. They are not related to the fix and only helped isolate the problem. Also introduced a cypress test for Lists that tests the editor without rendering the page and logging in. It is very fast and fairly easy to write. *Refactorings* * Split marks into separate files. Signed-off-by: Max <max@nextcloud.com>
2022-02-07[master] Render data URL images as-isMichal Junek
Signed-off-by: Michal Junek <michal@junek.pw>
2022-01-24handle __ as underline when loading markdown filesMax
Signed-off-by: Max <max@nextcloud.com>
2022-01-24refactor: move markdownit to its own directoryMax
Signed-off-by: Max <max@nextcloud.com>
2022-01-03add basic tests for ImageView.vueJulien Veyssier
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
2021-11-11fix: handling of preview urls and testsAzul
Preserve urls that start with `core/preview` no matter if `hasPreview` is in there or not. Also do not add a duplicate `/` in dav urls. `this.filePath` already starts with a `/`. Add a test for dav paths and fix some others that were broken by #1800. Signed-off-by: Azul <azul@riseup.net>
2021-11-11Mock current user in jestJulius Härtl
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2021-11-11Adjust jest setupJulius Härtl
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2021-11-11tests: provide current directory to ImageView test as optionAzul
We moved away from querying `getCurrentDirectory` and instead send it to the node as a prop. Do that in the tests to make sure `ImageViews` have `options.currentDirectory` set. Signed-off-by: Azul <azul@riseup.net>
2021-07-19Update use of `OCA.Viewer` api to the nextcloud 22 versionAzul
Looks like the [accessor to state] was removed from the Viewer api and replaced with [separate getters]. So we need to replace `OCA.Viewer.state.file` with `OCA.Viewer.file`. Fixes #1676 [accessor to state]: (https://github.com/nextcloud/viewer/commit/dbfa6bc8ead717530001a981b7d442510bf8d897#diff-c29528ea58a2d0307765d4357b88c9a469c148ccca2d82b653dbb97290ab6ab1L52-L63) [separate getters]: (https://github.com/nextcloud/viewer/commit/dbfa6bc8ead717530001a981b7d442510bf8d897#diff-c29528ea58a2d0307765d4357b88c9a469c148ccca2d82b653dbb97290ab6ab1R79-R81) Signed-off-by: Azul <azul@riseup.net>