Coder Social home page Coder Social logo

Comments (3)

mjbvz avatar mjbvz commented on May 12, 2024

I just tested <img> paths on a few servers and with file: uris. In all cases, %2d seems to be decoded into - when resolving the path

If the file name has the literal text %2d in it, I think the proper encoding would be to also encode the percent sign: %252d. But now we're double encoding and I'm guessing ADO won't understand that anyways

ADO seems to be doing something nonstandard, although I'd be happy to be proven wrong if you can point me to a spec saying otherwise. Maybe it worked differently in older VS Code versions, but that was likely a bug with VS Code also not following standard behavior


For the preview, an extension could use a markdown extension to change how paths are resolved

For the editor, an extension could also provide it's own document links instead of relying on VS Code's

from vscode-markdown-languageservice.

teppolainio avatar teppolainio commented on May 12, 2024

Ah, my bad @mjbvz for bad bug report. I iterated my finding a bit based on your input and now it seems there might be a bug on how VSCode takes file name literals to Markdown links instaed of encoded file names.

Bit of a story and investigation following up

ADO wiki requires file name literal to have %2D if I need to have - shown on ADO wiki UI. For example if I need to have wiki page "One-dimensional" on ADO wiki I need to have its file name literally One%2Ddimensional.md on file system according to https://learn.microsoft.com/en-us/azure/devops/project/wiki/wiki-file-structure?view=azure-devops#file-naming-conventions (ADO wiki takes wiki page name from file name).

I tried again with following steps:

  1. Create file One%2Ddimensional.md to file system.
  2. Open another Markdown file (markdown2.md) in order to create link to file One%2Ddimensional.md.
  3. Start writing markdown as: [Link](./One to markdown2.md and accept automatically suggested file One%2Ddimensional.md. This creates Markdown snippet [Link](./One%2Ddimensional.md).
  4. Open preview of markdown2.md and click "Link".
  5. Observe how editor does not find file One-dimensional.md

Now it seems that issue might actually be VSCode givin non-encoded file name One%2Ddimensional.md from file system to Markdown link instead of encoded file name One%252Ddimensional.md. Quick test with ADO wiki hints that ADO wiki supports encoded file name.

Please see picture below. I attached this just to be sure we understand scenario same way.
image

from vscode-markdown-languageservice.

mjbvz avatar mjbvz commented on May 12, 2024

Ok, thanks for the details. It sounds like the bug is with VS Code's path suggestions. I'll move this to the correct repo and update the title

from vscode-markdown-languageservice.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.