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

Youtube preview overrides markdown link titles #16100

Open
xendk opened this issue Aug 11, 2020 · 15 comments
Open

Youtube preview overrides markdown link titles #16100

xendk opened this issue Aug 11, 2020 · 15 comments

Comments

@xendk
Copy link

@xendk xendk commented Aug 11, 2020

image

Doesn't seem to happen for previews of sites.

@zulipbot
Copy link
Member

@zulipbot zulipbot commented Aug 12, 2020

Hello @zulip/server-markdown members, this issue was labeled with the "area: markdown" label, so you may want to check it out!

@stupendoussuperpowers
Copy link

@stupendoussuperpowers stupendoussuperpowers commented Aug 14, 2020

I'd like to work on this. Can someone guide me as to where I can get started?

@Gittenburg
Copy link
Collaborator

@Gittenburg Gittenburg commented Aug 14, 2020

Check out the Zulip developer documentation.

The relevant code seems to be:

if extracted_data:
if youtube is not None:
title = self.youtube_title(extracted_data)

@timabbott
Copy link
Member

@timabbott timabbott commented Aug 14, 2020

@aero31aero can likely help investigate.

@aero31aero
Copy link
Member

@aero31aero aero31aero commented Aug 15, 2020

As @Gittenburg said, the bug is in L1233 above. The easiest fix here would be something like:

# replace title of link if 
def maybe_replace_link_title(found_url, title):
    (url, text) = found_url.result
    if text == url:
        found_url.family.child.text = title

This same bug should be present with vimeo links too.

For easier manual testing, just comment this check:

            if not self.md.url_embed_preview_enabled:
                continue
@aero31aero
Copy link
Member

@aero31aero aero31aero commented Aug 15, 2020

Slightly long term, do we really want to modify the original link text and not add the title to the preview like we do for our Twitter previews?

@Gittenburg
Copy link
Collaborator

@Gittenburg Gittenburg commented Aug 15, 2020

Yeah I think having the title above the preview would be better.

@akshatdalton
Copy link
Collaborator

@akshatdalton akshatdalton commented Aug 19, 2020

@zulipbot claim

@zulipbot
Copy link
Member

@zulipbot zulipbot commented Aug 19, 2020

Welcome to Zulip, @akshatdalton! We just sent you an invite to collaborate on this repository at https://github.com/zulip/zulip/invitations. Please accept this invite in order to claim this issue and begin a fun, rewarding experience contributing to Zulip!

Here's some tips to get you off to a good start:

As you work on this issue, you'll also want to refer to the Zulip code contribution guide, as well as the rest of the developer documentation on that site.

See you on the other side (that is, the pull request side)!

@Ezio-Sarthak
Copy link

@Ezio-Sarthak Ezio-Sarthak commented Aug 25, 2020

I'd like to work on this. Could someone guide me to get started?

@akshatdalton
Copy link
Collaborator

@akshatdalton akshatdalton commented Aug 26, 2020

@zulipbot claim

@dynamoh
Copy link

@dynamoh dynamoh commented Aug 28, 2020

@zulipbot claim

@zulipbot
Copy link
Member

@zulipbot zulipbot commented Aug 28, 2020

Hello @dynamoh, it looks like someone has already claimed this issue! Since we believe multiple assignments to the same issue may cause some confusion, we encourage you to search for other unclaimed issues to work on. However, you can always reclaim this issue if no one is working on it.

We look forward to your valuable contributions!

@KarenEfereyan
Copy link

@KarenEfereyan KarenEfereyan commented Aug 28, 2020

I see that this is already being worked on. Is there a slack channel I can join?

@timabbott
Copy link
Member

@timabbott timabbott commented Sep 1, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
10 participants
You can’t perform that action at this time.