pseudomuto / protoc-gen-doc

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

markdown anchors have invalid characters #457

Closed derlin closed 2 years ago

derlin commented 3 years ago

The markdown anchors (inside <a name=".."> and in the TOC contain special characters such as . and / that are not compatible with BitBucket and some other tools. It would be great to sanitize the anchors, by replacing any slash with _ and any special character with -.

For example, given a proto com.example.test.Example, the generated anchor would be:

<a name="com-example-test-example"></a>

And for a file com/example/test/v1/example.proto:

<a name="com_example_test_v1_example-proto">
pseudomuto commented 2 years ago

Closed via #460