Copy marked text in URL format popup

AI-generated summary

In a discussion about improving the hyperlink insertion UX in Discourse, Matthias_Schuster noted that unlike GitHub, Discourse’s link popup forces users to re-enter highlighted text as the display title. codinghorror agreed and assigned the task to vinothkannans as low priority. jomaxro clarified that while the feature technically works (linking highlighted text even if the title is blank), the UX could be improved by auto-filling the title field with the selected text. vinothkannans implemented the change, and jomaxro confirmed the improvement with appreciation. codinghorror then suggested trimming leading/trailing whitespace from the auto-filled text, which vinothkannans promptly completed. The feature now auto-populates the link title field with trimmed selected text, enhancing usability.

When I choose to add a link on a text, I simply mark the specific text (in Github), press the link button and I get a nice, preformatted syntax, which lets me simply copy in the URL.

In Discourse, a pop-up appears which lets me write the already written text again.

My proposal is: Let the pop-up automatically use the marked text as “displayed text” :slight_smile:

5 Likes

Oh yes we should be doing this, can you add it to your list @vinothkannans low priority?

3 Likes

FYI this is purely a UX issue. Currently, if you highlight text, click Hyperlink in the toolbar and add a URL, it does add the link to the selected text despite the “optional title” field being left blank.

Ideally the highlighted text should be added to the “optional title” field - but it does at least work.

4 Likes

Okay. Added to my list :+1:

3 Likes

It is done. Now the selected text will be displayed in the title field.

4 Likes

Looks good! Thanks Vinoth :tada:

2 Likes

One tweak, you should trim any leading or trailing spaces from the text used for the selected text.

3 Likes

Done. Now the trimmed selected text will be used in popup.

1 Like

This topic was automatically closed after 25 hours. New replies are no longer allowed.