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

Missing escaping of brackets #4

Closed
Niols opened this issue May 28, 2021 · 2 comments · Fixed by ocaml/opam-repository#22197
Closed

Missing escaping of brackets #4

Niols opened this issue May 28, 2021 · 2 comments · Fixed by ocaml/opam-repository#22197
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Niols
Copy link

Niols commented May 28, 2021

md2mld (version 0.3.0 from OPAM) does not seem to escape brackets from Markdown. If I take the file:

Here is some text [...] and then some more.

Here is a bracket: [

Here is a closing bracket: ]

I get an identical .mld file. If I then give this file to odoc, it complains and produces an HTML like the following:

image

where the brackets have been interpreted as code. It should look like the following in Markdown:

image

@Niols
Copy link
Author

Niols commented May 28, 2021

From the documentation of ocamldoc (odoc and ocamldoc share the same syntax), one escaped strings: typeset the given string as is; special characters (’{’, ’}’, ’[’, ’]’ and ’@’) must be escaped by a ’\’.

@mseri mseri added bug Something isn't working help wanted Extra attention is needed labels May 28, 2021
@mseri
Copy link
Owner

mseri commented May 28, 2021

I need to look at how omd parses those. I don't manipulate the md in the code, I just get the parsetree from omd and use that directly. But it should be possible to escape them when generating the mld.

@mseri mseri closed this as completed in 3e9c32c Oct 2, 2022
mseri added a commit that referenced this issue Oct 2, 2022
Escape square brackets, braces and at characters in text nodes (fixes #4)
mseri added a commit to mseri/opam-repository that referenced this issue Oct 3, 2022
CHANGES:

- Add support for `-version` option ([mseri/md2mld#10](mseri/md2mld#10) dmbaturin)
- Escape square brackets, braces and `@` characters in text nodes, fixes [mseri/md2mld#4](mseri/md2mld#4) ([mseri/md2mld#9](mseri/md2mld#9) dmbaturin)
- Add support for reading Markdown from the standard input ([mseri/md2mld#8](mseri/md2mld#8) dmbaturin)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants