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

fix: use the global format default for C file comments #847

Merged

Conversation

flavorjones
Copy link
Contributor

Describe the problem being solved

When users set a default format choice with the --markup= option, comments from a C file do not inherit that default.

This means that even if I use --markup=markdown, the C comments would be parsed as if they were "rdoc".

How is this problem solved?

This changeset sets the default markup format for C comments to the global option when they're created during parsing. I've added test coverage for the previous behavior and the new behavior.

Anything else reviewers should note?

Note that RDoc::Markup::PreProcess will apply any comment-local :markup: directives in the #handle method, and override this default as necessary.

This is a prefactor for fixing comment format handling.
Previously, Parser::C comments all defaulted to "rdoc" format, even
when the user had set a different default with the `--markup=<choice>`
option.
@tenderlove tenderlove merged commit 836c829 into ruby:master Oct 15, 2021
@flavorjones flavorjones deleted the flavorjones-fix-default-format-for-c-files branch February 2, 2024 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants