Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: Rename in markdown files #147738

Closed
3 tasks done
mjbvz opened this issue Apr 20, 2022 · 0 comments
Closed
3 tasks done

Test: Rename in markdown files #147738

mjbvz opened this issue Apr 20, 2022 · 0 comments

Comments

@mjbvz
Copy link
Collaborator

mjbvz commented Apr 20, 2022

Refs #146291

Complexity: 5

Create Issue


#146291 adds support for using rename (F2) inside markdown files.

Here's a quick review of the places where this can be triggered and the expected behavior of a rename

Rename on a header: # Some Header

You should be able to trigger a rename on a header. As part of the rename, it should update the header along with all slugified links to the header. Updated locations include:

  • # Some Header — The header itself
  • [text](#some-header) — Link within the file to the header (the links are slugified)
  • [text]: #some-header — Definition link within the file to the header (the links are slugified)
  • [text](./other.md#some-header) — Links across files to the header
  • [text](./other#some-header) — Links across files to the header. In this case the file does not have an file extension
  • [text](/path/to/other#some-header) — Link from the workspace root to the file

Rename on link to header [text](#header)

If you trigger a rename on a link to a header instead of the header itself, you should be able to enter the full header name in the rename box (i.e. not the slugified text). This should update the header itself along with all the slugified references to it (see above for examples of places that should be updated)

[text](./other.md#header)

On #header in an another markdown file referencing a header. Should work the same as above

[text][ref]

Rename on a reference link (ref) should update all refs in the current file:

  • [text][ref] — All uses of ref for links
  • [ref] — Shorthand reference links
  • [ref]: https://example.com — The link definition

Make sure renames here do not go across files

<http://example.com>

You should also be able to rename http(s) link. Expected renamed locations include:

  • [text](http://example.com) — Links
  • <http://example.com> — Auto links
  • [text]: http://example.com — Definition links

File path renames text

You should be able to use F2 on link paths to rename files (which should both update the references to the link and also rename the target file

Some edge cases to consider here:

  • Try renaming both md files and non-md files
  • If you rename a link to a markdown file that does now use a .md extension ([text](./file)) then you should be able to enter a new file name without a .md and confirm the the links don't use the file extension but the file on disk still does
  • Try renames for paths with spaces and other special characters in their names

For this test plan item, try using rename in markdown. See what works as expected and what doesn't

I've intentionally kept this issue open ended in order to collect feedback on the expected behavior of this feature. I know there's a lot to test here, so please give this item what you feel like is an appropriate amount of testing and don't go overboard

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants