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-07-10Do not unintended remove or modify link titles, fixes #2699Ferdinand Thiessen
Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
2022-06-10Bring back inline code supportJulius Härtl
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-06-08Implement toMarkdown for hard break instead of replacing after markdown ↵Julius Härtl
transformation Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-05-24manual backport of #2426, refs #2411, Improve image attachment managementJulien Veyssier
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
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>
2020-09-25Fix images in public linksJulius Härtl
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-08-11fix: use Viewer state to determine current dirAzul
This is more relyable then parsing the window location query for dir: * ?dir does not change when navigating between files right now * ?dir is not present when the viewer is used from within other apps. We used to fallback to the viewer state which solved the latter. However it is easier and less error prone to just rely on viewer state in the first place. Signed-off-by: Azul <azul@riseup.net>
2020-08-11links with complete urlsAzul
This way they also work if the viewer was opened from other apps than the file app. Also move the `relPath` param into the fragment. It is only used to remember the relative path for generating the short markdown form from the link. Signed-off-by: Azul <azul@riseup.net>
2020-08-11calculate dir for relative linksAzul
Signed-off-by: Azul <azul@riseup.net>
2020-08-11rewrite links to local filesAzul
The markdown we create for links to local files looks like this: ``` [Check this out!](subdir/file.md?fileid=123) ``` Turn this into a link like this ``` <a href="?dir=/current&openfile=123&relPath=subdir/file.md"> Check this out! </a> ``` The `relPath` part of the url is needed to convert it back to the original markdown. Includes a test. Next steps: * open links to local files in same tab. * change dir param according to relative Path. Signed-off-by: Azul <azul@riseup.net>
2020-08-11refactor: define our own Link mark to rewrite hrefsAzul
The short relative links used in markdown need to be converted to working urls in the href attributes. In order to properly serialize the content the full urls in html need to be converted to relative links as well. This commit splits out the href handling into a new helper. This way it can be easily tested. Signed-off-by: Azul <azul@riseup.net>
2020-06-16Adjust ignored tests that fail due to whitespace changesJulius Härtl
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-06-16Update spec to commonmark 0.29Julius Härtl
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-06-09allow relative image sources with fileidAzul
includes a unit test for turning the src in markdown into a src for html that can be resolved by nextcloud Signed-off-by: Azul <azul@riseup.net>
2019-12-02Fix espacing and cover with tests (fixes #325)Julius Härtl
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2019-12-02Implement checkbox supportJulius Härtl
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2019-09-04Use tightLists optionJulius Härtl
Signed-off-by: Julius Härtl <jus@bitgrid.net> Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
2019-07-10Keep checkboxes as plain textJulius Härtl
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2019-07-05Add test vectorsJulius Härtl
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2019-07-02Use text node to serialize plain textJulius Härtl
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2019-07-02Fix testsJulius Härtl
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2019-07-02Allow plain text editing of filesJulius Härtl
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2019-06-25Fix testsJulius Härtl
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2019-06-12Add basic tests for markdown serializerJulius Härtl
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2019-06-11TestsJulius Härtl
Signed-off-by: Julius Härtl <jus@bitgrid.net>