docfx icon indicating copy to clipboard operation
docfx copied to clipboard

Unable to process files with url-escaped symbols in names

Open mrEDitor opened this issue 6 years ago • 5 comments

Operation System: (Windows or Linux or MacOS) tested on Windows

DocFX Version Used: 2.39.2.0 (reproducable at 2.45.1 as well)

Template used: (default or statictoc or contain custom template) default

Steps to Reproduce:

  1. name the file with %2D or any other url-escape code, e.g. im%2Descaped.md (as azure devops wiki does)
  2. use "files": [ "*.md" ] in docfx.json
  3. try to build

Expected Behavior: document builds

Actual Behavior:

Build failed.
[19-09-24 08:42:50.944]Error:System.IO.DirectoryNotFoundException: Unable to find part of path "D:\md\azurewiki2docfx\sources\im%2Aescaped.md".
   в System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)

Minimal reproducible example (ZIP).

mrEDitor avatar Sep 24 '19 09:09 mrEDitor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs.

stale[bot] avatar Dec 23 '19 09:12 stale[bot]

Hey, what is the point to close old issues? Neither stalebot, nor anyone else will fix it if it is closed.

mrEDitor avatar Dec 23 '19 19:12 mrEDitor

Sorry for late response... There must be some bug in the logic to fetch the file. You could try to work around this issue by changing the file name first.

superyyrrzz avatar Dec 26 '19 08:12 superyyrrzz

The issue is while using the System.Uri to convert absolute path to relative path. it can be fixed easily when we move to netstandard2.1 thanks to the new method System.IO.Path.GetRelativePath.

Now I have done a fix. but I cannot raise a pull request as I don't have access to the repository. Can anyone help me? how can i become a contributor to this project?

mrgopalakrishnan avatar Jun 11 '21 09:06 mrgopalakrishnan

Now I have done a fix. but I cannot raise a pull request as I don't have access to the repository. Can anyone help me? how can i become a contributor to this project?

Does a pull request from a forked repo work for you?

aguzev avatar May 06 '22 19:05 aguzev

This is fixed in the latest version.

yufeih avatar Dec 01 '23 05:12 yufeih

@yufeih Could you point me the pr for these fixes ? The issue is still happening with the version 2.75.2. This one is blocking us from moving some of our content processing of the ADO wiki's to CI/CD pipeline. I will be happy to assist with a fix if one is needed.

saipramod avatar Feb 14 '24 23:02 saipramod