-
Notifications
You must be signed in to change notification settings - Fork 29.2k
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
Support tilde character (~) in Razor links #305
Comments
@rhires Are you Something like: <a href="~/some/path/to/something.txt"> |
Yes, for example this item in _Layout.cshtml: |
Ok, I think I understand. In your <link rel="stylesheet" href="~/css/bootstrap.css" />
<link rel="stylesheet" href="/css/bootstrap.css" /> When you |
I added code to detect the '~' and remove it. So the URL will resolve to the current workspace folder. That's IMO the best we can do as we don't know the Razor application root. |
Code does translate correctly the tilde ~ as a proper path reference when the code runs (but that may be mono or core-clr doing that magic, or roslyn), but when I cmd-click the link, Code offers to create a new folder in the path that literally includes the tilde as the folder name in that path, when it should convert it to the proper path of wwwroot...this is in the _Layout.cshtml file. I'm unsure where to look in the code so I can see what it's doing to offer a fix.
The text was updated successfully, but these errors were encountered: