rst-parser icon indicating copy to clipboard operation
rst-parser copied to clipboard

Normalize paths to run on windows

Open srsbiz opened this issue 6 months ago • 0 comments

On windows all paths returned by build-in functions or SplFile object methods contain \ as directory separator. This breaks many things, like calculating relative directory for file being parsed, to include other files.

This can be easily fixed by using Symfony\Component\Filesystem\Path::normalize on any path that may be used to compare against other strings.

Windows path starts with partition letter followed by colon, so there is potential BC break in FileIncluder.php, where colon was used as path separator for $includeRoot argument. This feature to pass multiple roots was undocumented and there were no tests for it, so I hope this change will not have much impact.

srsbiz avatar Jan 31 '24 20:01 srsbiz