The discussion revolves around creating a custom link button for Discourse that uses a custom URL scheme (inet://) and allows users to easily insert links with the highlighted text as both the link title and the actual link.
jays10 has set up a custom URL scheme and created a button using an applySurround script, but wants to automate the process of using the highlighted text for both the link title and the link itself.
merefield suggests overriding the onebox logic to work with the custom protocol, which jays10 considers as an alternative solution. merefield clarifies that creating a onebox plugin for inet:// links could allow for automatic formatting of the links, similar to how https:// links are handled.
jays10 understands the suggestion and merefield elaborates on how modifying the oneboxing subsystem could enable nice linked titles, using og tags, similar to how Discourse handles https:// links.
We are setting up our new discourse internal environment and I was able to setup a custom URL scheme to link to an internal resource on the network, I wanted to add an easy button when making a new post which I was able to do but I want to be able to use the highlighted text for the link title as well as for the actual link itself. Right now I am just using an apply surround to insert what we need into a link but we have to manually change the link title, see the code below.
user enters 123456 > that applies this around the highlighted text [id_here](INET://123456)
I did look through the code but I could not find anything that would help me accomplish what we are looking to do. Is there anyway to use the highlighted text in the link title as well?
The protocol works fine, I can use inet:// as needed but I was just looking for an easy way for user to insert the custom URL into a post. In the previous form (phpbb) we made a custom bbcode for the link that worked however I was looking for an easier solution with discourse.
My suggestion was that rather than doing something so low level in the composer, “simply” modify the oneboxing subsystem so it formats inet:// links just like https:// links.