Skip to content

Strip whitespaces from the end of the metadata field#3

Merged
jonludlam merged 2 commits intoocaml-doc:mainfrom
Julow:metadata-strip-sp
Dec 10, 2021
Merged

Strip whitespaces from the end of the metadata field#3
jonludlam merged 2 commits intoocaml-doc:mainfrom
Julow:metadata-strip-sp

Conversation

@Julow
Copy link
Copy Markdown
Contributor

@Julow Julow commented Dec 10, 2021

Spaces at this locations are not meant by the user to be data and require special handlings in tools like Mdx and OCamlformat:

(** {@ocaml foo=bar[ ]} *)
(** {@ocaml foo=bar [ ]} *)
(** {@ocaml foo=bar
      [ ]} *)
(** {@ocaml
      foo=bar
      [ ]} *)

All should parse to the same AST.

Spaces at this locations are not meant by the user to be data and
require special handlings in tools like Mdx and OCamlformat.
Copy link
Copy Markdown

@Leonidas-from-XIV Leonidas-from-XIV left a comment

Choose a reason for hiding this comment

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

This is exactly the change that I appreciate in MDX (since it free's me from stripping whitespace while making sure that other tools parsing odoc behave consistently) and as someone who would write odoc metadata (since I would not expect the whitespace to be meaningful)!

@jonludlam
Copy link
Copy Markdown
Collaborator

Thanks @Julow !

@jonludlam jonludlam merged commit d7a5963 into ocaml-doc:main Dec 10, 2021
jonludlam added a commit to jonludlam/opam-repository that referenced this pull request Dec 11, 2021
CHANGES:

- New syntax to allow associating metadata with code blocks
  (@Julow, ocaml-doc/odoc-parser#2, ocaml-doc/odoc-parser#3)
jonludlam pushed a commit to jonludlam/odoc-parser that referenced this pull request Feb 22, 2023
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.

3 participants