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

Option to fold/collapse the URL part of a markdown link #1751

Open
2 of 8 tasks
aleksey-rowan opened this issue Nov 19, 2021 · 3 comments
Open
2 of 8 tasks

Option to fold/collapse the URL part of a markdown link #1751

aleksey-rowan opened this issue Nov 19, 2021 · 3 comments
Labels
area.misc type.feature New functionality

Comments

@aleksey-rowan
Copy link
Contributor

Please select if your request is either something new or an enhancement

  • Enhancement of an existing Feature.
  • Request of a new feature.

Please select the area your request applies to. (Multiple selections are possible)

  • Onboard. Initial vault setup and import/export pods
  • Create. Note creation, lookup, snippets and templates
  • Retrieve. Backlinks, references, graph view
  • Structure. Refactoring, multi-vault and schemas
  • Publish. Sharing your repo with the world
  • Misc (Choose this if your not sure)

Is your feature request related to a problem? Please describe

When inserting links to resources with long URLs or base64-encoded data, resulting links are cumbersome to use and they take up a lot of space. Like this Google Maps link:

[Wellesley to Severn](https://www.google.com/maps/dir/43.5918249,-80.6148742/44.7356773,-79.6835935/@44.016405,-81.115561,483716m/data=!3m1!1e3!4m13!4m12!1m5!3m4!1m2!1d-80.7995998!2d44.083526!3s0x882a2a729ae7cdb3:0x56598fa0d2365421!1m0!2m3!6e0!7e2!8j1633971600!3e0)

image

Describe the solution you'd like

The URL part of the markdown link is automatically folded/collapsed and expands only under the cursor. Something like this:

[Wellesley to Severn](...)

image

Describe alternatives you've considered

There is no alternative.

Additional context

VSCode had a similar request but it got closed (microsoft/vscode#87797); another related issue is still open, but it doesn't look like anything is happening with it (microsoft/vscode#50840).

@hikchoi
Copy link
Contributor

hikchoi commented Nov 22, 2021

Thank you for the suggestion.
Unfortunately I think inline folding is not possible at the moment. This is definitely something we want once we have control over it though.

We'll keep this brewing in the backburner for now.

@aleksey-rowan
Copy link
Contributor Author

As a workaround, you could try using the Inline-fold extension.

@bonnebulle
Copy link

bonnebulle commented Jan 8, 2024

Thanks @aleksey-rowan
exactrly what I was searching ... for Wikilinks :
Exemple : [[gparent.parent.child_name]] -> [[child_name]]
I cant find any issue here, nor in the doc

My setup/settings with Inline-fold extension :

  "[markdown]": {
    "inlineFold.regex":"\\[\\[(([\\.A-Za-zÀ-ú0-9_\\-\\:]{1,}?)\\.)([A-Za-zÀ-ú0-9_\\-\\:]{1,}?)\\]\\]",
    "inlineFold.regexFlags": "g",
    "inlineFold.regexGroup": 1,
    "inlineFold.unfoldedOpacity": 0.6,
    "inlineFold.maskChar": "",
    "inlineFold.after": "",
    "inlineFold.maskColor": "#000",
    "inlineFold.unfoldOnLineSelect": true,
    "inlineFold.autoFold": true,
  }

REGEX here :
https://regex101.com/library/nlSi7u


TODO/ alternative Regex...
doing the same with named/aliased wikilinks
Exemple : [[this name|gparent.parent.child_name]] -> [[this name]]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area.misc type.feature New functionality
Projects
None yet
Development

No branches or pull requests

3 participants