Skip to content

Fix issue #865#1439

Open
Tim-ats-d wants to merge 3 commits into
ocaml:masterfrom
Tim-ats-d:multines-line-link
Open

Fix issue #865#1439
Tim-ats-d wants to merge 3 commits into
ocaml:masterfrom
Tim-ats-d:multines-line-link

Conversation

@Tim-ats-d
Copy link
Copy Markdown

@Tim-ats-d Tim-ats-d commented May 22, 2026

First try to fix the issue #865. The patch is dead simple, I've only added a multilines_link_to_link which properly reformats multi lines link into normal ones.

As I'm not yet really familiar with the Odoc codebase, don't hesitate to tell where can I define the multilines_link_to_link function or if the test need to reside in its own file!

Cc @panglesd

Copy link
Copy Markdown
Collaborator

@panglesd panglesd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some comments. This also needs a change entry!

Comment thread src/parser/syntax.ml
Comment thread src/parser/syntax.ml Outdated
Comment on lines +171 to +178
let multilines_link_to_link link =
String.split_on_char '\n' link
|> List.map (fun line ->
String.trim @@
if String.ends_with ~suffix:{|\|} line then
String.(sub line 0 (length line - 1))
else line)
|> String.concat ""
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not really correspond to what we expect (escaping newlines):

a
b\      <--- there are whitespace after the \
c\      <--- no newlines after the \

will be interpreted as abc. The biggest problem probably being that the trailing \ is removed (?)

Comment thread src/parser/syntax.ml
Comment thread src/parser/syntax.ml Outdated
@Tim-ats-d Tim-ats-d force-pushed the multines-line-link branch from dc5e535 to c245e0d Compare May 27, 2026 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants