Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ocamldoc generates invalid html for object types in parameter lists, type parameters #8645

Closed
wiml opened this issue Apr 26, 2019 · 4 comments · Fixed by #10363
Closed

ocamldoc generates invalid html for object types in parameter lists, type parameters #8645

wiml opened this issue Apr 26, 2019 · 4 comments · Fixed by #10363
Labels

Comments

@wiml
Copy link

wiml commented Apr 26, 2019

ocamldoc does not HTML-escape the left angle bracket (<&lt;) when emitting documentation for object types in some circumstances, resulting in invalid HTML.

For example both of these declarations exhibit the problem:

val foo : int -> < bah : int -> int >

type  'a thing = < bar : ( < baz : int; .. > as 'a ); >

The problem doesn't seem to happen when generating html docs in a single shot, but these commands will demonstrate the problem if the above declarations are in foo.mli:

ocamldoc -dump foo.odoc -colorize-code foo.mli
mkdir -p somedocs
ocamldoc -load foo.odoc -colorize-code -html -d somedocs
@Octachron
Copy link
Member

I don't see any difference between the html files generated directly with

ocamldoc foo.mli -html -colorize-code

and the one generated indirectly.

As far as I can see, the html backend only escapes < and > in the specialized path for the toplevel of a type declaration and not for generic type expressions.

@github-actions
Copy link

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

@github-actions github-actions bot added the Stale label Apr 19, 2021
@gasche
Copy link
Member

gasche commented Apr 19, 2021

@Octachron do you think this is an issue worth fixing, or should we decide to close as ocamldoc is on life support?

@Octachron
Copy link
Member

I would say that the bug is sufficiently limited in scope to try to fix it. I will have a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants