René's URL Explorer Experiment


Title: Add backward movement and search to Scanner by mvanhorn · Pull Request #466 · commonmark/commonmark-java · GitHub

Open Graph Title: Add backward movement and search to Scanner by mvanhorn · Pull Request #466 · commonmark/commonmark-java

X Title: Add backward movement and search to Scanner by mvanhorn · Pull Request #466 · commonmark/commonmark-java

Description: Why A custom inline parser that has already read an opener often needs the last closer before the next whitespace or the end of the text. Reaching that closer from the current position means scanning forward and scanning again to confirm the match is the last one, which is awkward for the caller and does extra work. What changed prev steps back one UTF-16 code unit, including across the synthetic newline between lines, and leaves the position unchanged at the start of the input. findPrev searches backward for a character or a CharMatcher, with overloads that take an inclusive lower position so the search can stop at a saved opener. The current character is included, and the end sentinel is skipped and never matches. A hit returns how many code units were moved. A miss returns -1 while staying at the start of the input or at the bound. A bound after the current position or outside the input throws IllegalArgumentException before the position changes. Testing ./mvnw -B -ntp -pl commonmark -am test -Dtest=InlineContentParserTest,ScannerTest -Dsurefire.failIfNoSpecifiedTests=false passed locally (ScannerTest 11 tests, InlineContentParserTest 3 tests, no failures). The same command passed 14 tests in a Linux container (eclipse-temurin:21-jdk). Fixes #395

Open Graph Description: Why A custom inline parser that has already read an opener often needs the last closer before the next whitespace or the end of the text. Reaching that closer from the current position means scanni...

X Description: Why A custom inline parser that has already read an opener often needs the last closer before the next whitespace or the end of the text. Reaching that closer from the current position means scanni...

Opengraph URL: https://github.com/commonmark/commonmark-java/pull/466

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:7d064ed4-03a8-ce6b-72cd-eaddb6f123ee
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE570:BC30A:423B46:59CC94:6AFBB871
html-safe-noncef2559c3c064ce36bb5e66eb9a8092fea10b4639ac168605644c6ef4294a3c408
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNTcwOkJDMzBBOjQyM0I0Njo1OUNDOTQ6NkFGQkI4NzEiLCJ2aXNpdG9yX2lkIjoiMjAwNTA5NTU3MTE0Nzk2MjQ4MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac7760d5266756e8168d70ab0bb5186f161463f1b3ff83c7cfe8fe59958beb8947
hovercard-subject-tagpull_request:4965873283
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/commonmark/commonmark-java/pull/466/files
twitter:imagehttps://avatars.githubusercontent.com/u/455140?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/455140?s=400&v=4
og:image:altWhy A custom inline parser that has already read an opener often needs the last closer before the next whitespace or the end of the text. Reaching that closer from the current position means scanni...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None2b2ef9c1578c18d8ed27027940544c958743213cf4461659f14d3ccdf51e162c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/commonmark/commonmark-java git https://github.com/commonmark/commonmark-java.git
octolytics-dimension-user_id8661225
octolytics-dimension-user_logincommonmark
octolytics-dimension-repository_id39477878
octolytics-dimension-repository_nwocommonmark/commonmark-java
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id39477878
octolytics-dimension-repository_network_root_nwocommonmark/commonmark-java
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasee4cce0e99cf61481a318ff12c2e8580153a6c7c6
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/commonmark/commonmark-java/pull/466/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcommonmark%2Fcommonmark-java%2Fpull%2F466%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcommonmark%2Fcommonmark-java%2Fpull%2F466%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=commonmark%2Fcommonmark-java
Reloadhttps://github.com/commonmark/commonmark-java/pull/466/files
Reloadhttps://github.com/commonmark/commonmark-java/pull/466/files
Reloadhttps://github.com/commonmark/commonmark-java/pull/466/files
commonmarkhttps://github.com/commonmark
commonmark-javahttps://github.com/commonmark/commonmark-java
Codehttps://github.com/commonmark/commonmark-java
Issues9 (9)https://github.com/commonmark/commonmark-java/issues
Pull requests4 (4)https://github.com/commonmark/commonmark-java/pulls
Actionshttps://github.com/commonmark/commonmark-java/actions
Wikihttps://github.com/commonmark/commonmark-java/wiki
Security and quality8 (8)https://github.com/commonmark/commonmark-java/security
Insightshttps://github.com/commonmark/commonmark-java/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fcommonmark%2Fcommonmark-java%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fcommonmark%2Fcommonmark-java%2Fissues%2Fnew%2Fchoose
robinsthttps://github.com/robinst
commonmark:mainhttps://github.com/commonmark/commonmark-java/tree/main
mvanhorn:fix/395-scanner-backward-searchhttps://github.com/mvanhorn/commonmark-java/tree/fix/395-scanner-backward-search
Conversation 10 https://github.com/commonmark/commonmark-java/pull/466
Commits 2 https://github.com/commonmark/commonmark-java/pull/466/commits
Checks 5 https://github.com/commonmark/commonmark-java/pull/466/checks
Files changed 3 https://github.com/commonmark/commonmark-java/pull/466/files
Add backward movement and search to Scanner https://github.com/commonmark/commonmark-java/pull/466/files#top
Show all changes 2 commits https://github.com/commonmark/commonmark-java/pull/466/files
5346086 Add backward movement and search to Scanner mvanhorn Oct 22, 2026 https://github.com/commonmark/commonmark-java/pull/466/commits/5346086a54970066524ab7d83bed61d0511705d4
d636048 Keep only bounded findPrev and document Scanner mvanhorn Oct 28, 2026 https://github.com/commonmark/commonmark-java/pull/466/commits/d63604862966dfbcf2c76fdf8eb4200082fd4a9d
Clear filters https://github.com/commonmark/commonmark-java/pull/466/files
Please reload this pagehttps://github.com/commonmark/commonmark-java/pull/466/files
Please reload this pagehttps://github.com/commonmark/commonmark-java/pull/466/files
Scanner.java https://github.com/commonmark/commonmark-java/pull/466/files#diff-623530a11f5870cf021c5f02d3a136d675b68c0031cf37f84deaea4c6c3ed4cb
InlineContentParserTest.java https://github.com/commonmark/commonmark-java/pull/466/files#diff-eb6608f56d4516704a54966c37c481290b3d597bc8a0c57f50b12ae207d680bf
ScannerTest.java https://github.com/commonmark/commonmark-java/pull/466/files#diff-a24196c0d0c7923fdf377f114dad3498e745842a1316db13fba6c8906aedc25d
commonmark/src/main/java/org/commonmark/parser/beta/Scanner.javahttps://github.com/commonmark/commonmark-java/pull/466/files#diff-623530a11f5870cf021c5f02d3a136d675b68c0031cf37f84deaea4c6c3ed4cb
View file https://github.com/mvanhorn/commonmark-java/blob/d63604862966dfbcf2c76fdf8eb4200082fd4a9d/commonmark/src/main/java/org/commonmark/parser/beta/Scanner.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/commonmark/commonmark-java/pull/466/{{ revealButtonHref }}
https://github.com/commonmark/commonmark-java/pull/466/files#diff-623530a11f5870cf021c5f02d3a136d675b68c0031cf37f84deaea4c6c3ed4cb
https://github.com/commonmark/commonmark-java/pull/466/files#diff-623530a11f5870cf021c5f02d3a136d675b68c0031cf37f84deaea4c6c3ed4cb
https://github.com/commonmark/commonmark-java/pull/466/files#diff-623530a11f5870cf021c5f02d3a136d675b68c0031cf37f84deaea4c6c3ed4cb
https://github.com/commonmark/commonmark-java/pull/466/files#diff-623530a11f5870cf021c5f02d3a136d675b68c0031cf37f84deaea4c6c3ed4cb
https://github.com/commonmark/commonmark-java/pull/466/files#diff-623530a11f5870cf021c5f02d3a136d675b68c0031cf37f84deaea4c6c3ed4cb
https://github.com/commonmark/commonmark-java/pull/466/files#diff-623530a11f5870cf021c5f02d3a136d675b68c0031cf37f84deaea4c6c3ed4cb
https://github.com/commonmark/commonmark-java/pull/466/files#diff-623530a11f5870cf021c5f02d3a136d675b68c0031cf37f84deaea4c6c3ed4cb
https://github.com/commonmark/commonmark-java/pull/466/files#diff-623530a11f5870cf021c5f02d3a136d675b68c0031cf37f84deaea4c6c3ed4cb
https://github.com/commonmark/commonmark-java/pull/466/files#diff-623530a11f5870cf021c5f02d3a136d675b68c0031cf37f84deaea4c6c3ed4cb
https://github.com/commonmark/commonmark-java/pull/466/files#diff-623530a11f5870cf021c5f02d3a136d675b68c0031cf37f84deaea4c6c3ed4cb
https://github.com/commonmark/commonmark-java/pull/466/files#diff-623530a11f5870cf021c5f02d3a136d675b68c0031cf37f84deaea4c6c3ed4cb
https://github.com/commonmark/commonmark-java/pull/466/files#diff-623530a11f5870cf021c5f02d3a136d675b68c0031cf37f84deaea4c6c3ed4cb
https://github.com/commonmark/commonmark-java/pull/466/files#diff-623530a11f5870cf021c5f02d3a136d675b68c0031cf37f84deaea4c6c3ed4cb
https://github.com/commonmark/commonmark-java/pull/466/files#diff-623530a11f5870cf021c5f02d3a136d675b68c0031cf37f84deaea4c6c3ed4cb
https://github.com/commonmark/commonmark-java/pull/466/files#diff-623530a11f5870cf021c5f02d3a136d675b68c0031cf37f84deaea4c6c3ed4cb
https://github.com/commonmark/commonmark-java/pull/466/files#diff-623530a11f5870cf021c5f02d3a136d675b68c0031cf37f84deaea4c6c3ed4cb
https://github.com/commonmark/commonmark-java/pull/466/files#diff-623530a11f5870cf021c5f02d3a136d675b68c0031cf37f84deaea4c6c3ed4cb
Please reload this pagehttps://github.com/commonmark/commonmark-java/pull/466/files
Please reload this pagehttps://github.com/commonmark/commonmark-java/pull/466/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.