Repository navigation
Keep the port in rdoc-image URLs - #1847
Open
Shaisolaris wants to merge 1 commit into
Open
Shaisolaris wants to merge 1 commit into
Shaisolaris wants to merge 1 commit into
Conversation
An image link whose URL has a port, such as  in Markdown or rdoc-image:http://localhost:8080/logo.png, was split at the colon before the port, so the image src became http://localhost and the rest of the URL went into the alt text. Split the URL and the alt text after the optional scheme, host and port instead of at the first colon not followed by a slash.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An image link whose URL has a port was split at the colon before the port. For example, the Markdown
rendered as
The same happens for
rdoc-image:http://localhost:8080/logo.pngand{rdoc-image:http://example.com:8080/a.jpg:alt}[...]in RDoc markup.handle_RDOCLINKsplit the text afterrdoc-image:at the first colon not followed by/. This change matches the optionalscheme://host:portpart first and then splits the URL and the alt text at the next colon. Alt text that contains colons, such as, still works as before.Tests:
test_convert_TIDYLINK_image_external_with_portandtest_convert_RDOCLINK_image_external_with_port_without_alt. Both fail on master and pass with this change.test/rdoc/markup/to_html_test.rb,to_markdown_test.rb,rdoc_markdown_test.rb,heading_test.rbandto_html_snippet_test.rbpass locally (Ruby 3.3). I did not run the full suite or RuboCop.A colon inside the query string of an image URL (for example
?t=1:2) is still ambiguous with the alt separator, and this change does not address it.