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

Refactor markdown parsing of Image and ExplicitLink #1323

Merged
merged 1 commit into from
Mar 23, 2025

Conversation

tompng
Copy link
Member

@tompng tompng commented Mar 23, 2025

Create intermediate rule ExplicitLinkWithLabel that returns {label:, link:}, so that Image rule does not need to re-parse rdoc link format again.

# Before
"[text](url)"  "{text}(url)"
"![text](url)"  Image("{text}(url)") (parse with regexp) "rdoc-image:url:text"

# After
"[text](url)"  ExplicitLink({ label: 'text', link: 'url' })  "{text}(url)"
"![text](url)"  Image({ label: 'text', link: 'url' })  "rdoc-image:url:text"

#1322

…xplicitLink(return rdoc link format string)

Create intermediate rule ExplicitLinkWithLabel that returns `{label:, link:}`, so that Image rule does not need to re-parse rdoc link format again.
@tompng tompng merged commit 8e4324d into ruby:master Mar 23, 2025
30 checks passed
@ioquatix
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants