Thanks to visit codestin.com
Credit goes to github.com

Skip to content

POC restore linkification features #7668

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

POC restore linkification features #7668

wants to merge 1 commit into from

Conversation

fregante
Copy link
Member

@fregante fregante commented Aug 11, 2024

Opening this PR to track the work on:

Findings:

  • ✅ I found a way to parse and visually linkify code
  • ❌ there's no way to bring only the linkified code to a higher z-index; The whole "file" lives in a position: relative. My previous :hover demo no longer works
  • 👍 There's a way to match a click on the textarea to a specific element under it: https://gist.github.com/kiliman/5d7a3826bc16f5967978336d026805a3

Next steps for the POC

  • Integrate click handler as shown in the gist
  • Add full-file parser helpers
    • linkify via indexes rather than keyword (fullSourceText.slice(30, 35)) because keywords may appear multiply times on the same line
    • run parser(s) on raw text but alter the syntax-highlighted DOM (e.g. fullSourceText.replace(urlRegex, () => linkifier on indexes found))

Wishlist

  • Investigate CSS anchor usage to provide hover state and/or a real link above the text area. This is a superior option to the click handler, but Firefox and Safari are left behind as usual

Test URL

'http://github.com/',

Related

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

Successfully merging this pull request may close these issues.

1 participant