Comments (3)
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.
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:
- Create file
One%2Ddimensional.md
to file system. - Open another Markdown file (
markdown2.md
) in order to create link to fileOne%2Ddimensional.md
. - Start writing markdown as:
[Link](./One
tomarkdown2.md
and accept automatically suggested fileOne%2Ddimensional.md
. This creates Markdown snippet[Link](./One%2Ddimensional.md)
. - Open preview of
markdown2.md
and click "Link". - 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.
from vscode-markdown-languageservice.
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)
- Make logging more consistent
- Allow folding html tags with blank new lines HOT 1
- Allow folding of tables and block quotes
- Add autocompletion support for reference links HOT 4
- Support renaming src links in Markdown img elements
- Image reference link incorrectly marked as unused HOT 2
- Renaming angle bracket link incorrectly escapes link
- Adding parens to link should force use of angle brackets
- Links to files with angle brackets aren't detected
- Rename should escape angle brackets as needed
- Rename should try removing angle brackets if they are no longer needed
- Renaming markdown files corrupts links with fragments and angle brackets
- Ability to provide an ignore list of reference links for markdown validation HOT 5
- Markdown link definition fail positive
- Markdown link diagnostics false positive on checkboxes
- Problems regarding to the link detection and link definitions HOT 2
- Common DocFx [!NOTE] notation being flagged with verify links HOT 3
- Ill-formed markdown link with Extract to link definition HOT 1
- Strip emoji from local header reference or provide an option to do that HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-markdown-languageservice.