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

Fix: make sure source link is configured and open in external browser #496

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

StrongMonkey
Copy link
Contributor

#280

The default url transform in our markdown library seems to be stripping out url with file://. This break our knowledge response when giving source link reference that points to files.

@tylerslaton
Copy link
Contributor

@StrongMonkey Does this open up the file when clicked?

@StrongMonkey
Copy link
Contributor Author

yes, it will open up the file in external browser @tylerslaton

win.webContents.on('will-navigate', (event, url) => {
if (url.startsWith('file://')) {
event.preventDefault();
shell.openExternal(url);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason to not just use the default of the system like the other button? Is it because this catches all navigation events?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested and the one above doesn't work but this works. I got this from chatgpt.

@StrongMonkey StrongMonkey merged commit 6d95a22 into gptscript-ai:main Sep 11, 2024
1 check passed
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.

3 participants