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

Annoying behaviour when records end with lists in code blocks #1093

Closed
xvw opened this issue Mar 21, 2024 · 2 comments
Closed

Annoying behaviour when records end with lists in code blocks #1093

xvw opened this issue Mar 21, 2024 · 2 comments

Comments

@xvw
Copy link
Contributor

xvw commented Mar 21, 2024

Let's consider this example:

{@ocaml[
type t = { foo: int list }
let x = {foo = [1;2;3]}
let k = 10
]}

It will produce:

[code
 type t = { foo; int list }
 let x = {foo = [1; 2; 3
]
let k = 10
]}  -- invisible

When writing code by hand, it's trivially fixable by adding, for example, small spaces. But if the code is an output of MDX or formatted by OCamlformat, it can be more annoying!

@panglesd
Copy link
Collaborator

panglesd commented Mar 21, 2024

Not sure if it solve this since it can be auto-generated as well, but similarly to ocaml's multiline string you can "name" the delimiters.

E.g:

{blibli@ocaml[
type t = { foo: int list }
let x = {foo = [1;2;3]}
let k = 10
]blibli}

@xvw
Copy link
Contributor Author

xvw commented Mar 21, 2024

It solve everything! Thank you very much!

@xvw xvw closed this as completed Mar 21, 2024
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

No branches or pull requests

2 participants