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

New features: page titles, and minor URL bar changes #89

Merged
merged 3 commits into from
Dec 27, 2020

Conversation

mikejzx
Copy link
Contributor

@mikejzx mikejzx commented Dec 27, 2020

Page titles are now supported on Gemini and HTML pages (closes #56), and they are also shown in the window title.

Titles in Gemini documents are extracted in the GeminiRenderer's render function. If the line is a markdown header #, the string is copied into a string that is (optionally) passed to the function. This prevents having to re-read the entire document from start to finish just for the title.

The HTML title is extracted from the HTML document's <title> tag inside a <head> tag. I figured that only searching in the head would be the best option, as according to this, valid title tags should only appear there. Thus I felt that it'd be less efficient to search past the <head> tags. The algorithm I've used to get the title should be fairly solid and is capable of ignoring malformed title tags.

Finally I added a subtle feature - when clicking the URL bar, all of the text is selected. I've modelled it after the behaviour typical of popular web browsers - i.e the user is still able to select text intuitively without the feature getting in the way.

@ikskuh
Copy link
Owner

ikskuh commented Dec 27, 2020

Cool, thanks!

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.

idea: show page titles in tabs
2 participants