[Bug] Gists with link in title break style - gist.github.com

Hi, this is to report a styling bug occurring when a gist has a link(s) in the title:

Seems to be because it’s not stripping links from the title inside the link itself, so the nested <a> messes with the element tree rendered from the HTML.

Sorry if the category isn’t quite right, couldn’t work out where it should go.

1 Like

Is that an undesired effect resulting from a paste operation? If this is the case, the reason might be that your copying a rich-content link which is not rendered as plain-text.

Usually, pasting via CtrlShiftV (instead of just CtrlV) ensures that rich-text is pasted as plain-text, e.g. stripping an HTML link of its anchor tags. But this behavior can differ depending on context, especially in the browser.

Usually GH doesn’t render formatting in titles (e.g. in Issues, PRs, etc.) but I don’t remember how this works in Gists.

It’s a simple text field?

It looks like, at least in terms of the HTML source, but from your previous screenshot (where links are rendered in blue) it also seems like the links in the Gist title are being detected somehow — can you actually click on them from within the title?

I’m not sure what the implications of the above statement are, and where the “stripping” is supposed/expected to occur. Are you’re copying and pasting some text from an HTML page, where the text contains links which you expect to be left out when pasting into the title field?

I.e. if you’re editing the title as plaintext, or pasting it as plain text, there shouldn’t be any <a> tags in it. If there are, it’s either because they are carried over from a paste operation involving rich text, or because the GH page is interpreting and rendering links in the title text.

The second screenshot if from the input control, right? i.e. when you’re creating the Gist title.

The second screenshot seems to be from the actual Gist — which then indicates that raw links are being rendered in the title as HTML anchors.

I’m not sure what the expected behavior is in this case. I know that Markdown is not rendered in titles (e.g. in a Lorem `ipsum` dolor title, the ipsum part won’t be rendered as inline code). But maybe raw links are treated differently, because of the URL protocols being auto-detected.

You can easily debug this issue yourself by creating a gist with a full URL in the title. https://gist.github.com/

1 Like

Duplicate issue: Bug on gist.github.com: Gist description not correctly truncated if it contains an URL
The first report was 12 months ago, and the bug still persists.

1 Like