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

Standardize text content handling into new textContent AS1 field for index-based spans in tags #729

Open
snarfed opened this issue May 18, 2024 · 0 comments

Comments

@snarfed
Copy link
Owner

snarfed commented May 18, 2024

Right now, our code for handling HTML vs text content is a bit of a mess. For example, extracting and converting links, mentions, hashtags, and other entities in HTML content into tags is in Source.postprocess_object (mentions), bluesky.from_as1 (links and hashtags?), and some other places too.

We should centralize all this into a new AS1 field for text content. Ideally something existing in AS1, but if not, maybe a new textContent field. content would always be HTML, everything would be in markup there. tags with startIndex/length would always reference textContent, we could reliably convert plain text whitespace (eg newlines) to <br>s, and we could get rid of content_is_html.

Background: #675, snarfed/bridgy-fed#990, etc

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

No branches or pull requests

1 participant