René's URL Explorer Experiment


Title: fix: parse_inline drops links at position 0 and marks() loses href by ASRagab · Pull Request #36 · ma2za/python-substack · GitHub

Open Graph Title: fix: parse_inline drops links at position 0 and marks() loses href by ASRagab · Pull Request #36 · ma2za/python-substack

X Title: fix: parse_inline drops links at position 0 and marks() loses href by ASRagab · Pull Request #36 · ma2za/python-substack

Description: Summary Two bugs in inline link handling that cause all links created via from_markdown() to have null hrefs, and links at the start of a line to be silently dropped. Bug 1: Links at position 0 are dropped parse_inline() skips links that start at position 0 in the text. The image-exclusion check: if match.start() > 0 and text[match.start()-1:match.start()+1] != "![": Short-circuits to False when match.start() == 0, causing the link to be skipped entirely. Fix: Check match.start() == 0 or text[match.start() - 1] != "!" instead. Repro: parse_inline('[GPT](https://openai.com/)') # Before: [{'content': '[GPT](https://openai.com/)'}] # raw text, not a link # After: [{'content': 'GPT', 'marks': [{'type': 'link', 'attrs': {'href': 'https://openai.com/'}}]}] Bug 2: All link hrefs are null parse_inline() returns marks with the structure {'type': 'link', 'attrs': {'href': url}}, but marks() reads from mark.get('href') at the top level — missing the nested attrs entirely. Fix: Fall back to mark.get('attrs', {}).get('href') when top-level href is not present. This preserves backward compatibility with the top-level format shown in the README examples. Repro: post = Post('Test', '', user_id=1) post.from_markdown('Visit [Example](https://example.com)') body = json.loads(post.get_draft()['draft_body']) # Before: href is null for all links # After: href is 'https://example.com' Tests Added tests/substack/test_post.py with 6 tests covering: Links at position 0 Multiple links on same line Image exclusion (not parsed as link) Links in middle of text href from attrs (from_markdown path) href from top-level (manual add path) All tests pass. Pre-commit hooks (black, isort, trailing-whitespace, end-of-file-fixer) all pass.

Open Graph Description: Summary Two bugs in inline link handling that cause all links created via from_markdown() to have null hrefs, and links at the start of a line to be silently dropped. Bug 1: Links at position 0 are...

X Description: Summary Two bugs in inline link handling that cause all links created via from_markdown() to have null hrefs, and links at the start of a line to be silently dropped. Bug 1: Links at position 0 are...

Opengraph URL: https://github.com/ma2za/python-substack/pull/36

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:9ecec3a8-2935-16ad-59f7-6e1547305066
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id940C:102A8A:4FE3687:6F723D2:6A50FA67
html-safe-noncedcc2764fed99d20883bc41179d6f5ce600ac60853916d43bdebb4fb0c2233179
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NDBDOjEwMkE4QTo0RkUzNjg3OjZGNzIzRDI6NkE1MEZBNjciLCJ2aXNpdG9yX2lkIjoiNjAyNjM0Mzg2NjkyMzI4NTA5NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac5c2a6114989a28c33c38181ee2d442083271f4bafc1a09586f85aa8a7466e07a
hovercard-subject-tagpull_request:3346950208
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/ma2za/python-substack/pull/36/files
twitter:imagehttps://avatars.githubusercontent.com/u/1041016?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1041016?s=400&v=4
og:image:altSummary Two bugs in inline link handling that cause all links created via from_markdown() to have null hrefs, and links at the start of a line to be silently dropped. Bug 1: Links at position 0 are...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None5266e58c17a510c403505cc811606465e90a881d2007ee7df1c4800d5c659838
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/ma2za/python-substack git https://github.com/ma2za/python-substack.git
octolytics-dimension-user_id59370937
octolytics-dimension-user_loginma2za
octolytics-dimension-repository_id507708304
octolytics-dimension-repository_nwoma2za/python-substack
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id507708304
octolytics-dimension-repository_network_root_nwoma2za/python-substack
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
release8d836581d020676cc0ef4a83cd2fe17e4af02c3d
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/ma2za/python-substack/pull/36/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fma2za%2Fpython-substack%2Fpull%2F36%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
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
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://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
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fma2za%2Fpython-substack%2Fpull%2F36%2Ffiles
Sign up https://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=ma2za%2Fpython-substack
Reloadhttps://github.com/ma2za/python-substack/pull/36/files
Reloadhttps://github.com/ma2za/python-substack/pull/36/files
Reloadhttps://github.com/ma2za/python-substack/pull/36/files
ma2za https://github.com/ma2za
python-substackhttps://github.com/ma2za/python-substack
Please reload this pagehttps://github.com/ma2za/python-substack/pull/36/files
Notifications https://github.com/login?return_to=%2Fma2za%2Fpython-substack
Fork 28 https://github.com/login?return_to=%2Fma2za%2Fpython-substack
Star 154 https://github.com/login?return_to=%2Fma2za%2Fpython-substack
Code https://github.com/ma2za/python-substack
Issues 2 https://github.com/ma2za/python-substack/issues
Pull requests 1 https://github.com/ma2za/python-substack/pulls
Actions https://github.com/ma2za/python-substack/actions
Security and quality 0 https://github.com/ma2za/python-substack/security
Insights https://github.com/ma2za/python-substack/pulse
Code https://github.com/ma2za/python-substack
Issues https://github.com/ma2za/python-substack/issues
Pull requests https://github.com/ma2za/python-substack/pulls
Actions https://github.com/ma2za/python-substack/actions
Security and quality https://github.com/ma2za/python-substack/security
Insights https://github.com/ma2za/python-substack/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fma2za%2Fpython-substack%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fma2za%2Fpython-substack%2Fissues%2Fnew%2Fchoose
ma2zahttps://github.com/ma2za
ma2za:mainhttps://github.com/ma2za/python-substack/tree/main
ASRagab:fix/parse-inline-link-bugshttps://github.com/ASRagab/python-substack/tree/fix/parse-inline-link-bugs
Conversation 2 https://github.com/ma2za/python-substack/pull/36
Commits 4 https://github.com/ma2za/python-substack/pull/36/commits
Checks 0 https://github.com/ma2za/python-substack/pull/36/checks
Files changed https://github.com/ma2za/python-substack/pull/36/files
Please reload this pagehttps://github.com/ma2za/python-substack/pull/36/files
fix: parse_inline drops links at position 0 and marks() loses href https://github.com/ma2za/python-substack/pull/36/files#top
Show all changes 4 commits https://github.com/ma2za/python-substack/pull/36/files
5477c3d fix: parse_inline drops links at position 0 and marks() loses href Mar 3, 2026 https://github.com/ma2za/python-substack/pull/36/commits/5477c3d602a990a972abdc2539d9fe246672c6cd
9b7efef chore: verify pre-commit formatting Mar 3, 2026 https://github.com/ma2za/python-substack/pull/36/commits/9b7efef6af30a452f9752b718f0ea602dc3e5f87
bb44ee5 fix: keep links at pos 0; preserve link href (no reformat) Mar 3, 2026 https://github.com/ma2za/python-substack/pull/36/commits/bb44ee54efeff08b5e1afbd03a21a55be16fc8a5
44cd8f3 Merge remote-tracking branch 'upstream/main' into fix/parse-inline-li… Mar 3, 2026 https://github.com/ma2za/python-substack/pull/36/commits/44cd8f3d2ea2b98ca9dc6c69d1854952a33e4875
Clear filters https://github.com/ma2za/python-substack/pull/36/files
Please reload this pagehttps://github.com/ma2za/python-substack/pull/36/files
Please reload this pagehttps://github.com/ma2za/python-substack/pull/36/files
post.py https://github.com/ma2za/python-substack/pull/36/files#diff-d4ed7a496b59e5060beb6639b0bd81357c89241ff0688820660a7c42efd524c3
test_post.py https://github.com/ma2za/python-substack/pull/36/files#diff-91edba69ff592809079f70f36e60f3ed708648b359da2f5f4e4340ce7b1cb00b
substack/post.pyhttps://github.com/ma2za/python-substack/pull/36/files#diff-d4ed7a496b59e5060beb6639b0bd81357c89241ff0688820660a7c42efd524c3
View file https://github.com/ASRagab/python-substack/blob/44cd8f3d2ea2b98ca9dc6c69d1854952a33e4875/substack/post.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/ma2za/python-substack/pull/36/{{ revealButtonHref }}
https://github.com/ma2za/python-substack/pull/36/files#diff-d4ed7a496b59e5060beb6639b0bd81357c89241ff0688820660a7c42efd524c3
https://github.com/ma2za/python-substack/pull/36/files#diff-d4ed7a496b59e5060beb6639b0bd81357c89241ff0688820660a7c42efd524c3
https://github.com/ma2za/python-substack/pull/36/files#diff-d4ed7a496b59e5060beb6639b0bd81357c89241ff0688820660a7c42efd524c3
https://github.com/ma2za/python-substack/pull/36/files#diff-d4ed7a496b59e5060beb6639b0bd81357c89241ff0688820660a7c42efd524c3
https://github.com/ma2za/python-substack/pull/36/files#diff-d4ed7a496b59e5060beb6639b0bd81357c89241ff0688820660a7c42efd524c3
https://github.com/ma2za/python-substack/pull/36/files#diff-d4ed7a496b59e5060beb6639b0bd81357c89241ff0688820660a7c42efd524c3
https://github.com/ma2za/python-substack/pull/36/files#diff-d4ed7a496b59e5060beb6639b0bd81357c89241ff0688820660a7c42efd524c3
tests/substack/test_post.pyhttps://github.com/ma2za/python-substack/pull/36/files#diff-91edba69ff592809079f70f36e60f3ed708648b359da2f5f4e4340ce7b1cb00b
View file https://github.com/ASRagab/python-substack/blob/44cd8f3d2ea2b98ca9dc6c69d1854952a33e4875/tests/substack/test_post.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/ma2za/python-substack/pull/36/{{ revealButtonHref }}
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.