Skip to content

Commit 6b5fc8d

Browse files
committed
[DOC] Remove _emphasis_ in code blocks which is not handled as emphasis anymore
1 parent 43d879d commit 6b5fc8d

File tree

7 files changed

+47
-47
lines changed

7 files changed

+47
-47
lines changed

complex.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1803,7 +1803,7 @@ rb_dbl_complex_new(double real, double imag)
18031803
* Complex.rect(1, Rational(0, 1)).to_i # => 1
18041804
*
18051805
* Raises RangeError if <tt>self.imag</tt> is not exactly zero
1806-
* (either <tt>Integer(0)</tt> or <tt>Rational(0, _n_)</tt>).
1806+
* (either <tt>Integer(0)</tt> or <tt>Rational(0, n)</tt>).
18071807
*/
18081808
static VALUE
18091809
nucomp_to_i(VALUE self)
@@ -1827,7 +1827,7 @@ nucomp_to_i(VALUE self)
18271827
* Complex.rect(1, Rational(0, 1)).to_f # => 1.0
18281828
*
18291829
* Raises RangeError if <tt>self.imag</tt> is not exactly zero
1830-
* (either <tt>Integer(0)</tt> or <tt>Rational(0, _n_)</tt>).
1830+
* (either <tt>Integer(0)</tt> or <tt>Rational(0, n)</tt>).
18311831
*/
18321832
static VALUE
18331833
nucomp_to_f(VALUE self)
@@ -1852,7 +1852,7 @@ nucomp_to_f(VALUE self)
18521852
* Complex.rect(1, 0.0).to_r # => (1/1)
18531853
*
18541854
* Raises RangeError if <tt>self.imag</tt> is not exactly zero
1855-
* (either <tt>Integer(0)</tt> or <tt>Rational(0, _n_)</tt>)
1855+
* (either <tt>Integer(0)</tt> or <tt>Rational(0, n)</tt>)
18561856
* and <tt>self.imag.to_r</tt> is not exactly zero.
18571857
*
18581858
* Related: Complex#rationalize.

dir.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,14 +319,14 @@ def self.[](*args, base: nil, sort: true)
319319
#
320320
# Dir.glob('io.?') # => ["io.c"]
321321
#
322-
# - <tt>'[_set_]'</tt>: Matches any one character in the string _set_;
322+
# - <tt>'[set]'</tt>: Matches any one character in the string _set_;
323323
# behaves like a {Regexp character class}[rdoc-ref:Regexp@Character+Classes],
324324
# including set negation (<tt>'[^a-z]'</tt>):
325325
#
326326
# Dir.glob('*.[a-z][a-z]').take(3)
327327
# # => ["CONTRIBUTING.md", "COPYING.ja", "KNOWNBUGS.rb"]
328328
#
329-
# - <tt>'{_abc_,_xyz_}'</tt>:
329+
# - <tt>'{abc,xyz}'</tt>:
330330
# Matches either string _abc_ or string _xyz_;
331331
# behaves like {Regexp alternation}[rdoc-ref:Regexp@Alternation]:
332332
#
@@ -388,10 +388,10 @@ def self.[](*args, base: nil, sort: true)
388388
#
389389
# - File::FNM_EXTGLOB:
390390
# enables the pattern extension
391-
# <tt>'{_a_,_b_}'</tt>, which matches pattern _a_ and pattern _b_;
391+
# <tt>'{a,b}'</tt>, which matches pattern _a_ and pattern _b_;
392392
# behaves like a
393393
# {regexp union}[rdoc-ref:Regexp.union]
394-
# (e.g., <tt>'(?:_a_|_b_)'</tt>):
394+
# (e.g., <tt>'(?:a|b)'</tt>):
395395
#
396396
# pattern = '{LEGAL,BSDL}'
397397
# Dir.glob(pattern) # => ["LEGAL", "BSDL"]

doc/_regexp.rdoc

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -414,21 +414,21 @@ Each of these anchors matches a boundary:
414414

415415
Lookahead anchors:
416416

417-
- <tt>(?=_pat_)</tt>: Positive lookahead assertion:
417+
- <tt>(?=pat)</tt>: Positive lookahead assertion:
418418
ensures that the following characters match _pat_,
419419
but doesn't include those characters in the matched substring.
420420

421-
- <tt>(?!_pat_)</tt>: Negative lookahead assertion:
421+
- <tt>(?!pat)</tt>: Negative lookahead assertion:
422422
ensures that the following characters <i>do not</i> match _pat_,
423423
but doesn't include those characters in the matched substring.
424424

425425
Lookbehind anchors:
426426

427-
- <tt>(?<=_pat_)</tt>: Positive lookbehind assertion:
427+
- <tt>(?<=pat)</tt>: Positive lookbehind assertion:
428428
ensures that the preceding characters match _pat_, but
429429
doesn't include those characters in the matched substring.
430430

431-
- <tt>(?<!_pat_)</tt>: Negative lookbehind assertion:
431+
- <tt>(?<!pat)</tt>: Negative lookbehind assertion:
432432
ensures that the preceding characters do not match
433433
_pat_, but doesn't include those characters in the matched substring.
434434

@@ -574,7 +574,7 @@ A simple regexp has (at most) one match:
574574
re.match('1943-02-04').size # => 1
575575
re.match('foo') # => nil
576576

577-
Adding one or more pairs of parentheses, <tt>(_subexpression_)</tt>,
577+
Adding one or more pairs of parentheses, <tt>(subexpression)</tt>,
578578
defines _groups_, which may result in multiple matched substrings,
579579
called _captures_:
580580

@@ -647,8 +647,8 @@ A regexp may contain any number of groups:
647647

648648
- For a large number of groups:
649649

650-
- The ordinary <tt>\\_n_</tt> notation applies only for _n_ in range (1..9).
651-
- The <tt>MatchData[_n_]</tt> notation applies for any non-negative _n_.
650+
- The ordinary <tt>\\n</tt> notation applies only for _n_ in range (1..9).
651+
- The <tt>MatchData[n]</tt> notation applies for any non-negative _n_.
652652

653653
- <tt>\0</tt> is a special backreference, referring to the entire matched string;
654654
it may not be used within the regexp itself,
@@ -661,7 +661,7 @@ A regexp may contain any number of groups:
661661

662662
As seen above, a capture can be referred to by its number.
663663
A capture can also have a name,
664-
prefixed as <tt>?<_name_></tt> or <tt>?'_name_'</tt>,
664+
prefixed as <tt>?<name></tt> or <tt>?'name'</tt>,
665665
and the name (symbolized) may be used as an index in <tt>MatchData[]</tt>:
666666

667667
md = /\$(?<dollars>\d+)\.(?'cents'\d+)/.match("$3.67")
@@ -676,7 +676,7 @@ When a regexp contains a named capture, there are no unnamed captures:
676676
/\$(?<dollars>\d+)\.(\d+)/.match("$3.67")
677677
# => #<MatchData "$3.67" dollars:"3">
678678

679-
A named group may be backreferenced as <tt>\k<_name_></tt>:
679+
A named group may be backreferenced as <tt>\k<name></tt>:
680680

681681
/(?<vowel>[aeiou]).\k<vowel>.\k<vowel>/.match('ototomy')
682682
# => #<MatchData "ototo" vowel:"o">
@@ -732,10 +732,10 @@ see {Atomic Group}[https://www.regular-expressions.info/atomic.html].
732732

733733
==== Subexpression Calls
734734

735-
As seen above, a backreference number (<tt>\\_n_</tt>) or name (<tt>\k<_name_></tt>)
735+
As seen above, a backreference number (<tt>\\n</tt>) or name (<tt>\k<name></tt>)
736736
gives access to a captured _substring_;
737737
the corresponding regexp _subexpression_ may also be accessed,
738-
via the number (<tt>\\g<i>n</i></tt>) or name (<tt>\g<_name_></tt>):
738+
via the number n (<tt>\\gn</tt>) or name (<tt>\g<name></tt>):
739739

740740
/\A(?<paren>\(\g<paren>*\))*\z/.match('(())')
741741
# ^1
@@ -768,12 +768,12 @@ See {Subexpression calls}[https://learnbyexample.github.io/Ruby_Regexp/groupings
768768

769769
==== Conditionals
770770

771-
The conditional construct takes the form <tt>(?(_cond_)_yes_|_no_)</tt>, where:
771+
The conditional construct takes the form <tt>(?(cond)yes|no)</tt>, where:
772772

773773
- _cond_ may be a capture number or name.
774774
- The match to be applied is _yes_ if _cond_ is captured;
775775
otherwise the match to be applied is _no_.
776-
- If not needed, <tt>|_no_</tt> may be omitted.
776+
- If not needed, <tt>|no</tt> may be omitted.
777777

778778
Examples:
779779

@@ -802,7 +802,7 @@ The absence operator is a special group that matches anything which does _not_ m
802802

803803
==== Unicode Properties
804804

805-
The <tt>/\p{_property_name_}/</tt> construct (with lowercase +p+)
805+
The <tt>/\p{property_name}/</tt> construct (with lowercase +p+)
806806
matches characters using a Unicode property name,
807807
much like a character class;
808808
property +Alpha+ specifies alphabetic characters:
@@ -1033,23 +1033,23 @@ See also {Extended Mode}[rdoc-ref:Regexp@Extended+Mode].
10331033

10341034
Each of these modifiers sets a mode for the regexp:
10351035

1036-
- +i+: <tt>/_pattern_/i</tt> sets
1036+
- +i+: <tt>/pattern/i</tt> sets
10371037
{Case-Insensitive Mode}[rdoc-ref:Regexp@Case-Insensitive+Mode].
1038-
- +m+: <tt>/_pattern_/m</tt> sets
1038+
- +m+: <tt>/pattern/m</tt> sets
10391039
{Multiline Mode}[rdoc-ref:Regexp@Multiline+Mode].
1040-
- +x+: <tt>/_pattern_/x</tt> sets
1040+
- +x+: <tt>/pattern/x</tt> sets
10411041
{Extended Mode}[rdoc-ref:Regexp@Extended+Mode].
1042-
- +o+: <tt>/_pattern_/o</tt> sets
1042+
- +o+: <tt>/pattern/o</tt> sets
10431043
{Interpolation Mode}[rdoc-ref:Regexp@Interpolation+Mode].
10441044

10451045
Any, all, or none of these may be applied.
10461046

10471047
Modifiers +i+, +m+, and +x+ may be applied to subexpressions:
10481048

1049-
- <tt>(?_modifier_)</tt> turns the mode "on" for ensuing subexpressions
1050-
- <tt>(?-_modifier_)</tt> turns the mode "off" for ensuing subexpressions
1051-
- <tt>(?_modifier_:_subexp_)</tt> turns the mode "on" for _subexp_ within the group
1052-
- <tt>(?-_modifier_:_subexp_)</tt> turns the mode "off" for _subexp_ within the group
1049+
- <tt>(?modifier)</tt> turns the mode "on" for ensuing subexpressions
1050+
- <tt>(?-modifier)</tt> turns the mode "off" for ensuing subexpressions
1051+
- <tt>(?modifier:subexp)</tt> turns the mode "on" for _subexp_ within the group
1052+
- <tt>(?-modifier:subexp)</tt> turns the mode "off" for _subexp_ within the group
10531053

10541054
Example:
10551055

@@ -1166,22 +1166,22 @@ A regular expression containing non-US-ASCII characters
11661166
is assumed to use the source encoding.
11671167
This can be overridden with one of the following modifiers.
11681168

1169-
- <tt>/_pat_/n</tt>: US-ASCII if only containing US-ASCII characters,
1169+
- <tt>/pat/n</tt>: US-ASCII if only containing US-ASCII characters,
11701170
otherwise ASCII-8BIT:
11711171

11721172
/foo/n.encoding # => #<Encoding:US-ASCII>
11731173
/foo\xff/n.encoding # => #<Encoding:ASCII-8BIT>
11741174
/foo\x7f/n.encoding # => #<Encoding:US-ASCII>
11751175

1176-
- <tt>/_pat_/u</tt>: UTF-8
1176+
- <tt>/pat/u</tt>: UTF-8
11771177

11781178
/foo/u.encoding # => #<Encoding:UTF-8>
11791179

1180-
- <tt>/_pat_/e</tt>: EUC-JP
1180+
- <tt>/pat/e</tt>: EUC-JP
11811181

11821182
/foo/e.encoding # => #<Encoding:EUC-JP>
11831183

1184-
- <tt>/_pat_/s</tt>: Windows-31J
1184+
- <tt>/pat/s</tt>: Windows-31J
11851185

11861186
/foo/s.encoding # => #<Encoding:Windows-31J>
11871187

doc/language/encodings.rdoc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ These keyword-value pairs specify encoding options:
393393

394394
- <tt>:replace: nil</tt> (default): Set replacement string to default value:
395395
<tt>"\uFFFD"</tt> ("�") for a Unicode encoding, <tt>'?'</tt> otherwise.
396-
- <tt>:replace: _some_string_</tt>: Set replacement string to the given +some_string+;
396+
- <tt>:replace: some_string</tt>: Set replacement string to the given +some_string+;
397397
overrides +:fallback+.
398398

399399
Examples:
@@ -407,12 +407,12 @@ These keyword-value pairs specify encoding options:
407407
One of these may be specified:
408408

409409
- <tt>:fallback: nil</tt> (default): No replacement fallback.
410-
- <tt>:fallback: _hash_like_object_</tt>: Set replacement fallback to the given
411-
+hash_like_object+; the replacement string is <tt>_hash_like_object_[X]</tt>.
412-
- <tt>:fallback: _method_</tt>: Set replacement fallback to the given
413-
+method+; the replacement string is <tt>_method_(X)</tt>.
414-
- <tt>:fallback: _proc_</tt>: Set replacement fallback to the given
415-
+proc+; the replacement string is <tt>_proc_[X]</tt>.
410+
- <tt>:fallback: hash_like_object</tt>: Set replacement fallback to the given
411+
+hash_like_object+; the replacement string is <tt>hash_like_object[X]</tt>.
412+
- <tt>:fallback: method</tt>: Set replacement fallback to the given
413+
+method+; the replacement string is <tt>method(X)</tt>.
414+
- <tt>:fallback: proc</tt>: Set replacement fallback to the given
415+
+proc+; the replacement string is <tt>proc[X]</tt>.
416416

417417
Examples:
418418

doc/language/globals.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ require 'English'
3030
| `$+` | `$LAST_PAREN_MATCH` | Last group matched or `nil` | `nil` | No | Matcher methods |
3131
| `$1` | | First group matched or `nil` | `nil` | Yes | Matcher methods |
3232
| `$2` | | Second group matched or `nil` | `nil` | Yes | Matcher methods |
33-
| <tt>$_n_</tt> | | <i>n</i>th group matched or `nil` | `nil` | Yes | Matcher methods |
33+
| <tt>$n</tt> | | <i>n</i>th group matched or `nil` | `nil` | Yes | Matcher methods |
3434

3535
### Separators
3636

@@ -167,7 +167,7 @@ English - `$LAST_PAREN_MATCH`.
167167

168168
### `$1`, `$2`, \Etc. (Matched Group)
169169

170-
For <tt>$_n_</tt> the <i>n</i>th group of the match.
170+
For <tt>$n</tt> the <i>n</i>th group of the match.
171171

172172
No \English.
173173

@@ -282,9 +282,9 @@ by Kernel#load and Kernel#require.
282282
Singleton method `$LOAD_PATH.resolve_feature_path(feature)`
283283
returns:
284284

285-
- <tt>[:rb, _path_]</tt>, where `path` is the path to the Ruby file to be
285+
- <tt>[:rb, path]</tt>, where `path` is the path to the Ruby file to be
286286
loaded for the given `feature`.
287-
- <tt>[:so, _path_]</tt>, where `path` is the path to the shared object file
287+
- <tt>[:so, path]</tt>, where `path` is the path to the shared object file
288288
to be loaded for the given `feature`.
289289
- `nil` if there is no such `feature` and `path`.
290290

file.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7963,11 +7963,11 @@ Init_File(void)
79637963
*
79647964
* ==== File::FNM_EXTGLOB
79657965
*
7966-
* Flag File::FNM_EXTGLOB enables pattern <tt>'{_a_,_b_}'</tt>,
7966+
* Flag File::FNM_EXTGLOB enables pattern <tt>'{a,b}'</tt>,
79677967
* which matches pattern '_a_' and pattern '_b_';
79687968
* behaves like
79697969
* a {regexp union}[rdoc-ref:Regexp.union]
7970-
* (e.g., <tt>'(?:_a_|_b_)'</tt>):
7970+
* (e.g., <tt>'(?:a|b)'</tt>):
79717971
*
79727972
* pattern = '{LEGAL,BSDL}'
79737973
* Dir.glob(pattern) # => ["LEGAL", "BSDL"]

test/ruby/sentence.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def inner_inspect(ary, r)
211211
# returns new sentence object which
212212
# _target_ is substituted by the block.
213213
#
214-
# Sentence#subst invokes <tt>_target_ === _string_</tt> for each
214+
# Sentence#subst invokes <tt>target === string</tt> for each
215215
# string in the sentence.
216216
# The strings which === returns true are substituted by the block.
217217
# The block is invoked with the substituting string.

0 commit comments

Comments
 (0)