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

Markdown links with styled text are parsed incorrectly #1231

Open
st0012 opened this issue Dec 12, 2024 · 1 comment
Open

Markdown links with styled text are parsed incorrectly #1231

st0012 opened this issue Dec 12, 2024 · 1 comment

Comments

@st0012
Copy link
Member

st0012 commented Dec 12, 2024

Given 2 links:

[Link to Foo](https://example.com)

[Link to `Foo`](https://example.com)

RDoc can't handle the 2nd case:

Screenshot 2024-12-12 at 16 18 46

This happens to **bold** style too.

@st0012 st0012 added the bug label Dec 12, 2024
@amomchilov
Copy link

amomchilov commented Dec 12, 2024

Once this is implemented, we can improve doc/ruby/options.md like so:

options_md_improvements.patch
From 0a7a8f7aa5ab9a20107b8808f2cada9aa4d9dfbe Mon Sep 17 00:00:00 2001
From: Alexander Momchilov <[email protected]>
Date: Thu, 12 Dec 2024 12:18:14 -0500
Subject: [PATCH] Highlight param names as code

---
 doc/ruby/options.md | 74 ++++++++++++++++++++++-----------------------
 1 file changed, 37 insertions(+), 37 deletions(-)

diff --git a/doc/ruby/options.md b/doc/ruby/options.md
index 6e0278e143..2062fdafd5 100644
--- a/doc/ruby/options.md
+++ b/doc/ruby/options.md
@@ -61,15 +61,15 @@ nil
 
 See also:
 
-- {Option -a}[rdoc-ref:ruby/options.md@a-3A+Split+Input+Lines+into+Fields]:
+- {Option `-a`}[rdoc-ref:ruby/options.md@a-3A+Split+Input+Lines+into+Fields]:
   Split input lines into fields.
-- {Option -F}[rdoc-ref:ruby/options.md@F-3A+Set+Input+Field+Separator]:
+- {Option `-F`}[rdoc-ref:ruby/options.md@F-3A+Set+Input+Field+Separator]:
   \Set input field separator.
-- {Option -l}[rdoc-ref:ruby/options.md@l-3A+Set+Output+Record+Separator-3B+Chop+Lines]:
+- {Option `-l`}[rdoc-ref:ruby/options.md@l-3A+Set+Output+Record+Separator-3B+Chop+Lines]:
   \Set output record separator; chop lines.
-- {Option -n}[rdoc-ref:ruby/options.md@n-3A+Run+Program+in+gets+Loop]:
+- {Option `-n`}[rdoc-ref:ruby/options.md@n-3A+Run+Program+in+gets+Loop]:
   Run program in `gets` loop.
-- {Option -p}[rdoc-ref:ruby/options.md@p-3A+-n-2C+with+Printing]:
+- {Option `-p`}[rdoc-ref:ruby/options.md@p-3A+-n-2C+with+Printing]:
   `-n`, with printing.
 
 ### `-a`: Split Input Lines into Fields
@@ -91,15 +91,15 @@ and the default field separator  is `$;`.
 
 See also:
 
-- {Option -0}[rdoc-ref:ruby/options.md@0-3A+Set+-24-2F+-28Input+Record+Separator-29]:
+- {Option `-0`}[rdoc-ref:ruby/options.md@0-3A+Set+-24-2F+-28Input+Record+Separator-29]:
   \Set `$/` (input record separator).
-- {Option -F}[rdoc-ref:ruby/options.md@F-3A+Set+Input+Field+Separator]:
+- {Option `-F`}[rdoc-ref:ruby/options.md@F-3A+Set+Input+Field+Separator]:
   \Set input field separator.
-- {Option -l}[rdoc-ref:ruby/options.md@l-3A+Set+Output+Record+Separator-3B+Chop+Lines]:
+- {Option `-l`}[rdoc-ref:ruby/options.md@l-3A+Set+Output+Record+Separator-3B+Chop+Lines]:
   \Set output record separator; chop lines.
-- {Option -n}[rdoc-ref:ruby/options.md@n-3A+Run+Program+in+gets+Loop]:
+- {Option `-n`}[rdoc-ref:ruby/options.md@n-3A+Run+Program+in+gets+Loop]:
   Run program in `gets` loop.
-- {Option -p}[rdoc-ref:ruby/options.md@p-3A+-n-2C+with+Printing]:
+- {Option `-p`}[rdoc-ref:ruby/options.md@p-3A+-n-2C+with+Printing]:
   `-n`, with printing.
 
 ### `-c`: Check Syntax
@@ -186,9 +186,9 @@ Whitespace between the option and its argument may be omitted.
 
 See also:
 
-- {Option --external-encoding}[options_md.html#label--external-encoding-3A+Set+Default+External+Encoding]:
+- {Option `--external-encoding`}[options_md.html#label--external-encoding-3A+Set+Default+External+Encoding]:
   \Set default external encoding.
-- {Option --internal-encoding}[options_md.html#label--internal-encoding-3A+Set+Default+Internal+Encoding]:
+- {Option `--internal-encoding`}[options_md.html#label--internal-encoding-3A+Set+Default+Internal+Encoding]:
   \Set default internal encoding.
 
 Option `--encoding` is an alias for option `-E`.
@@ -221,15 +221,15 @@ The argument must immediately follow the option
 
 See also:
 
-- {Option -0}[rdoc-ref:ruby/options.md@0-3A+Set+-24-2F+-28Input+Record+Separator-29]:
+- {Option `-0`}[rdoc-ref:ruby/options.md@0-3A+Set+-24-2F+-28Input+Record+Separator-29]:
   \Set `$/` (input record separator).
-- {Option -a}[rdoc-ref:ruby/options.md@a-3A+Split+Input+Lines+into+Fields]:
+- {Option `-a`}[rdoc-ref:ruby/options.md@a-3A+Split+Input+Lines+into+Fields]:
   Split input lines into fields.
-- {Option -l}[rdoc-ref:ruby/options.md@l-3A+Set+Output+Record+Separator-3B+Chop+Lines]:
+- {Option `-l`}[rdoc-ref:ruby/options.md@l-3A+Set+Output+Record+Separator-3B+Chop+Lines]:
   \Set output record separator; chop lines.
-- {Option -n}[rdoc-ref:ruby/options.md@n-3A+Run+Program+in+gets+Loop]:
+- {Option `-n`}[rdoc-ref:ruby/options.md@n-3A+Run+Program+in+gets+Loop]:
   Run program in `gets` loop.
-- {Option -p}[rdoc-ref:ruby/options.md@p-3A+-n-2C+with+Printing]:
+- {Option `-p`}[rdoc-ref:ruby/options.md@p-3A+-n-2C+with+Printing]:
   `-n`, with printing.
 
 ### `-h`: Print Short Help Message
@@ -307,15 +307,15 @@ $ ruby -ln -e 'p $_' desiderata.txt
 
 See also:
 
-- {Option -0}[rdoc-ref:ruby/options.md@0-3A+Set+-24-2F+-28Input+Record+Separator-29]:
-  \Set `$/` (input record separator).
-- {Option -a}[rdoc-ref:ruby/options.md@a-3A+Split+Input+Lines+into+Fields]:
+- [Option `-0`](rdoc-ref:ruby/options.md@0-3A+Set+-24-2F+-28Input+Record+Separator-29]:
+  Sets the input record separator (`$/`).
+- {Option `-a`}[rdoc-ref:ruby/options.md@a-3A+Split+Input+Lines+into+Fields]:
   Split input lines into fields.
-- {Option -F}[rdoc-ref:ruby/options.md@F-3A+Set+Input+Field+Separator]:
+- {Option `-F`}[rdoc-ref:ruby/options.md@F-3A+Set+Input+Field+Separator]:
   \Set input field separator.
-- {Option -n}[rdoc-ref:ruby/options.md@n-3A+Run+Program+in+gets+Loop]:
+- {Option `-n`}[rdoc-ref:ruby/options.md@n-3A+Run+Program+in+gets+Loop]:
   Run program in `gets` loop.
-- {Option -p}[rdoc-ref:ruby/options.md@p-3A+-n-2C+with+Printing]:
+- {Option `-p`}[rdoc-ref:ruby/options.md@p-3A+-n-2C+with+Printing]:
   `-n`, with printing.
 
 ### `-n`: Run Program in `gets` Loop
@@ -341,15 +341,15 @@ be on good terms with all persons.
 
 See also:
 
-- {Option -0}[rdoc-ref:ruby/options.md@0-3A+Set+-24-2F+-28Input+Record+Separator-29]:
+- {Option `-0`}[rdoc-ref:ruby/options.md@0-3A+Set+-24-2F+-28Input+Record+Separator-29]:
   \Set `$/` (input record separator).
-- {Option -a}[rdoc-ref:ruby/options.md@a-3A+Split+Input+Lines+into+Fields]:
+- {Option `-a`}[rdoc-ref:ruby/options.md@a-3A+Split+Input+Lines+into+Fields]:
   Split input lines into fields.
-- {Option -F}[rdoc-ref:ruby/options.md@F-3A+Set+Input+Field+Separator]:
+- {Option `-F`}[rdoc-ref:ruby/options.md@F-3A+Set+Input+Field+Separator]:
   \Set input field separator.
-- {Option -l}[rdoc-ref:ruby/options.md@l-3A+Set+Output+Record+Separator-3B+Chop+Lines]:
+- {Option `-l`}[rdoc-ref:ruby/options.md@l-3A+Set+Output+Record+Separator-3B+Chop+Lines]:
   \Set output record separator; chop lines.
-- {Option -p}[rdoc-ref:ruby/options.md@p-3A+-n-2C+with+Printing]:
+- {Option `-p`}[rdoc-ref:ruby/options.md@p-3A+-n-2C+with+Printing]:
   `-n`, with printing.
 
 ### `-p`: `-n`, with Printing
@@ -370,15 +370,15 @@ be on good terms with all persons.
 
 See also:
 
-- {Option -0}[rdoc-ref:ruby/options.md@0-3A+Set+-24-2F+-28Input+Record+Separator-29]:
+- {Option `-0`}[rdoc-ref:ruby/options.md@0-3A+Set+-24-2F+-28Input+Record+Separator-29]:
   \Set `$/` (input record separator).
-- {Option -a}[rdoc-ref:ruby/options.md@a-3A+Split+Input+Lines+into+Fields]:
+- {Option `-a`}[rdoc-ref:ruby/options.md@a-3A+Split+Input+Lines+into+Fields]:
   Split input lines into fields.
-- {Option -F}[rdoc-ref:ruby/options.md@F-3A+Set+Input+Field+Separator]:
+- {Option `-F`}[rdoc-ref:ruby/options.md@F-3A+Set+Input+Field+Separator]:
   \Set input field separator.
-- {Option -l}[rdoc-ref:ruby/options.md@l-3A+Set+Output+Record+Separator-3B+Chop+Lines]:
+- {Option `-l`}[rdoc-ref:ruby/options.md@l-3A+Set+Output+Record+Separator-3B+Chop+Lines]:
   \Set output record separator; chop lines.
-- {Option -n}[rdoc-ref:ruby/options.md@n-3A+Run+Program+in+gets+Loop]:
+- {Option `-n`}[rdoc-ref:ruby/options.md@n-3A+Run+Program+in+gets+Loop]:
   Run program in `gets` loop.
 
 ### `-r`: Require Library
@@ -427,7 +427,7 @@ $ ruby -s t.rb -foo=baz -bar=bat
 ```
 
 The option may not be used with
-{option -e}[rdoc-ref:ruby/options.md@e-3A+Execute+Given+Ruby+Code]
+{option `-e`}[rdoc-ref:ruby/options.md@e-3A+Execute+Given+Ruby+Code]
 
 ### `-S`: Search Directories in `ENV['PATH']`
 
@@ -576,7 +576,7 @@ ruby - Copyright (C) 1993-2024 Yukihiro Matsumoto
 ### `--debug`: Alias for `-d`
 
 Option `--debug` is an alias for
-{option -d}[rdoc-ref:ruby/options.md@d-3A+Set+-24DEBUG+to+true].
+{option `-d`}[rdoc-ref:ruby/options.md@d-3A+Set+-24DEBUG+to+true].
 
 ### `--disable`: Disable Features
 
@@ -595,7 +595,7 @@ The supported features:
 - `frozen-string-literal`: Freeze all string literals (default: disabled).
 - `jit`: JIT compiler (default: disabled).
 
-See also {option --enable}[options_md.html#label--enable-3A+Enable+Features].
+See also {option `--enable`}[options_md.html#label--enable-3A+Enable+Features].
 
 ### `--dump`: Dump Items
 
@@ -617,7 +617,7 @@ option was given:
   Same as {option \-\-version}[options_md.html#label--version-3A+Print+Ruby+Version].
 
 For other argument values and examples,
-see {Option --dump}[option_dump_md.html].
+see {Option `--dump`}[option_dump_md.html].
 
 ### `--enable`: Enable Features
 
-- 
2.45.2

@st0012 st0012 changed the title Markdown links with inline code are parsed incorrectly Markdown links with styled text are parsed incorrectly Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants