pseudomuto / protoc-gen-doc

Documentation generator plugin for Google Protocol Buffers
MIT License
2.63k stars 464 forks source link

Fix absolute doc_opt paths on Windows (#497) #506

Open S1artie opened 1 year ago

S1artie commented 1 year ago

This PR contains a fix for the Windows absolute path problem described under issue #497.

It implements a heuristic that attempts to detect the specific Windows absolute path situation in the first two parameter parts (template file and output file) and rectifies it by recombining the accidentially-splitted parts. Unfortunately that seems to be the best-possible solution to the underlying problem as long as the --doc_opt format specification is to be kept as-is.

Tests have been added that fail with the original code, but succeed with the fix.

S1artie commented 1 year ago

ping @pseudomuto as requested