summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuki Kurihara <co000ri@gmail.com>2025-12-03 07:24:01 +0900
committergit <svn-admin@ruby-lang.org>2025-12-02 22:24:29 +0000
commita63147eed1184cb812664d5917d6687635a23ab6 (patch)
tree86104a7a4969614730a9d64b35fb916186966b16
parente0746cc443dfe948fa8d0eac5ecaa36e7eb6c972 (diff)
[ruby/strscan] [DOC] Avoid being interpreted as a link
(https://github.com/ruby/strscan/pull/180) Since `[](n)` is being interpreted as a Markdown link, it cannot be displayed as a method call. I have corrected this by escaping the brackets so that they are interpreted as strings rather than links. ### Before ri ``` #{}[n] | <tt>n</tt>th captured substring. | +nil+. ``` html <img width="424" height="217" alt="image" src="https://github.com/user-attachments/assets/b45601ab-ed1c-4b82-b112-325f12bde197" /> ### After ri ``` #[](n) | <tt>n</tt>th captured substring. | +nil+. ``` html <img width="489" height="217" alt="image" src="https://github.com/user-attachments/assets/1212c147-42a5-4f62-8667-a279ccff67a3" /> https://github.com/ruby/strscan/commit/b3d56867fd
-rw-r--r--doc/strscan/strscan.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/doc/strscan/strscan.md b/doc/strscan/strscan.md
index c4ab203462..385e92f84e 100644
--- a/doc/strscan/strscan.md
+++ b/doc/strscan/strscan.md
@@ -417,7 +417,7 @@ Each of these methods returns a captured match value:
| Method | Return After Match | Return After No Match |
|-----------------|-----------------------------------------|-----------------------|
| #size | Count of captured substrings. | +nil+. |
-| #[](n) | <tt>n</tt>th captured substring. | +nil+. |
+| #\[\](n) | <tt>n</tt>th captured substring. | +nil+. |
| #captures | Array of all captured substrings. | +nil+. |
| #values_at(*n) | Array of specified captured substrings. | +nil+. |
| #named_captures | Hash of named captures. | <tt>{}</tt>. |