pseudomuto / protoc-gen-doc

Documentation generator plugin for Google Protocol Buffers
MIT License
2.59k stars 462 forks source link

Generated html doc type anchor vs id attribute missmatch #533

Open danielfonda opened 2 months ago

danielfonda commented 2 months ago

Hi all,

It appears that when generating proto html docs, the type reference anchor doesn't generate properly.

Example:

message UserData {
  name = 1;
  age = 2;
}

message User {
  id = 1;
  UserData = 2;
}

The above example generates a table for User as expected. The type column for its UserData will include a link to <a href="#UserData">

The problem is that the definition for UserData includes a dot for its id attribute. So the actual generated html code looks like: <h3 id=".UserData">UserData</h3> (notice the dot before the ID).

Am I doing something wrong, or is this a bug?

Thanks 🙏