Skip to content

Record links when parsing content #208

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

Merged
merged 6 commits into from
Jun 30, 2023
Merged

Conversation

gnprice
Copy link
Member

@gnprice gnprice commented Jun 29, 2023

The interesting parts of this are about tracking on each block inline container (notably each ParagraphNode) the set of link nodes found in its subtree. We'll need that information for #71, for reasons explained there.

Computing it involves adding a bit of complexity (that we were pretty much bound to eventually need for one reason or another), making the content-parser a stateful object.

This PR doesn't yet go on to have the widgets actually consume this information. I have a draft branch for that (corresponding to part of #204), but want to write some tests for it.

gnprice added 6 commits June 29, 2023 16:28
At this stage we don't yet *do* anything with this information,
like open the linked URL when the user touches the link (zulip#71).
That will require some more infrastructure, which we build next.
This will give us a place to put "context"-flavored data structures
that should be threaded down through the recursion.
This is about to get a bit more complicated, in a way that would
no longer lend itself to a tidy small helper like this one.
This gives us the information that the corresponding widgets will
need at build time in order to create appropriate gesture recognizers
for touching the links, as part of implementing zulip#71.
@chrisbobbe chrisbobbe merged commit 165383b into zulip:main Jun 30, 2023
@chrisbobbe
Copy link
Collaborator

Thanks, LGTM! Merged.

@gnprice gnprice deleted the pr-links-data branch June 30, 2023 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants