Disabling the automatic "prettification" of links?

AI-generated summary

n1bff is looking to disable the automatic “prettification” of links in their self-hosted Discourse server. This feature automatically converts URLs into links with the page’s title as text. n1bff prefers this feature off, as it is not enabled on meta.discourse.org.

Arkshine suggests disabling the enable inline onebox on all domains setting to turn off this feature. However, supermathie notes that this setting should already be working on meta.discourse.org, but it is not. supermathie experiments with URLs and finds inconsistent behavior with inline oneboxing.

n1bff confirms that disabling the enable inline onebox on all domains setting solves the issue, but also experiences the same inconsistent behavior as supermathie.

I installed Discourse the other day on a self-hosted server.

When I copy an URL like https://www.ietf.org/ into a post, Discourse automatically turns into a link with the page’s “title” as text, e.g. like IETF | Internet Engineering Task Force.

This does not happen on meta.discourse.org and I prefer it off.

How can I disable this feature?

I think the enable inline onebox on all domains setting is what you’re looking for. :thinking:

Keep in mind if you want to reflect the change on existing messages, you will need to rebuild them!

That’s correct… though it should be working here, we didn’t disable it

e.g. https://www.ietf.org/ and https://www.discourse.org/ and https://meta.discourse.org/ and The Long Earth - Wikipedia

or https://www.ietf.org and https://www.discourse.org and https://meta.discourse.org

[1] pry(main)> InlineOneboxer.lookup 'https://www.ietf.org/'
=> {:url=>"https://www.ietf.org/", :title=>"IETF | Internet Engineering Task Force"}

[2] pry(main)> InlineOneboxer.lookup 'https://www.discourse.org/'
=> {:url=>"https://www.discourse.org/",
 :title=>"Discourse is the place to build civilized communities | Discourse - Civilized Discussion"}

[3] pry(main)> InlineOneboxer.lookup 'https://en.wikipedia.org/wiki/The_Long_Earth'
=> {:url=>"https://en.wikipedia.org/wiki/The_Long_Earth", :title=>"The Long Earth - Wikipedia"}

EDIT: some experimentation shows that only URLs with a non-blank path component are inline-oneboxed

e.g. https://www.discourse.org vs. https://www.discourse.org/ vs. https://www.discourse.org/buy vs. https://www.discourse.org/buy/

e.g. https://www.discourse.org vs. https://www.discourse.org/ vs. https://www.discourse.org/buy vs. https://www.discourse.org/buy/

EDIT: that’s not how it behaved on try :person_shrugging:t3:

Ah, thanks! I read “onebox” but ignored “inline” in the settings, thinking that was about the fancy big preview boxes.

I get the same weird behaviour as @supermathie though.