diff options
author | Mike Dalessio <[email protected]> | 2021-10-11 17:01:52 -0400 |
---|---|---|
committer | git <[email protected]> | 2021-10-16 01:39:06 +0900 |
commit | fbd0516afc2bb7219716aa4f810f83af8112ca49 (patch) | |
tree | 23717fa42b0ed163f0cb90a7ab420858bbaed92c /lib/rdoc | |
parent | d4894e81c0a2acb826686f178e4b1b1ed88adefa (diff) |
[ruby/rdoc] fix: comments in C files use the global markup option
Previously, Parser::C comments all defaulted to "rdoc" format, even
when the user had set a different default with the `--markup=<choice>`
option.
https://github.com/ruby/rdoc/commit/4643b08a26
Diffstat (limited to 'lib/rdoc')
-rw-r--r-- | lib/rdoc/parser/c.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/rdoc/parser/c.rb b/lib/rdoc/parser/c.rb index ee24a271cf..111f6e2091 100644 --- a/lib/rdoc/parser/c.rb +++ b/lib/rdoc/parser/c.rb @@ -173,6 +173,8 @@ class RDoc::Parser::C < RDoc::Parser @classes = load_variable_map :c_class_variables @singleton_classes = load_variable_map :c_singleton_class_variables + @markup = @options.markup + # class_variable => { function => [method, ...] } @methods = Hash.new { |h, f| h[f] = Hash.new { |i, m| i[m] = [] } } @@ -1223,6 +1225,8 @@ class RDoc::Parser::C < RDoc::Parser end def new_comment text = nil, location = nil, language = nil - RDoc::Comment.new(text, location, language) + RDoc::Comment.new(text, location, language).tap do |comment| + comment.format = @markup + end end end |