I noticed this solution does not work any longer. It was the first thing I tried before googling and finding this post. I’ll keep looking for a solution. Surprisingly, even www.example.com is converted into a hyperlink if on the same line as a regular link.
Looks like I’ll be using www<span>.</span>example<span>.</span>com
www.example.com
Preformatted text has other meanings. I reject the premise in the first post, it reads like “how can I avoid hitting myself if I really like hitting myself?”
I just want to be able to type out a domain name as text (without formatting/styling) and have enough OCD not only go to length of using <span>.</span>, but also to spend time finding out why \. doesn’t work as expected and post about it.
Fortunately, not everyone is cursed with my level of OCD.
Zero width Unicode spacers would also work but anyone who copies and pastes that URL is in for a surprise.. and not the good kind! Dunno if @sam has any other ideas but the request is really odd.
We had a similar request with complaints about m.sc being autolinked.
I do wonder if we should side with @Vitaly here and disable linkify fuzzy out of the box. Cause https://cnn.com will continue to work even if linkify fuzzy is disabled. So all you do is lose out on www.cnn.com
I think we should probably amend the test here to have a simpler bypass for fuzzy, just not sure what it would be
Well, using ` does turn the text into a <code></code> section instead of <pre></pre> which is preformatted text.
@notriddle Technically speaking there is a difference, but there really is no reason why <code></code> can’t be acceptable – URL’s are a form of “code” afterall.
Well said. The few cases where it has come up for me are when I’m trying to point someone to one url instead of another – i.e., when I’m trying to de-emphasize a URL. For example:
A: Just use smile.amazon.com instead of amazon.com and select OpenMRS, Inc. as your charity.
B: Just use smile.amazon.com instead of amazon.com and select OpenMRS, Inc. as your charity.
B is certainly a reasonable workaround; personally I prefer A. But, this is such an embarrassingly small issue, I can’t justify anyone (including myself) spending time on it. I’ve got amazon<span>.</span>com as a workaround for the 1-2 times I’ll ever need this again, so I’m happy… clearly afflicted with too much focus on meaningless details… but happy.
The awesome folks working on Discourse have more important things to do. I recommend focusing on other ways to continue making Discourse the most awesome forum software in the world and let this thread fade away. I’m sure I’ll re-discover this thread in a few years when this comes up again, so won’t need to post about it ever again.
(and I promise to not suggest a Discourse GSoC project to add support for www\.example\.com)
Lo scopo principale del nostro forum è discutere di un’azienda chiamata Alarm.com, quindi gli utenti scrivono “Alarm.com” nei post continuamente, probabilmente in circa il 50% dei topic. Finiremo per collegarci involontariamente a Alarm.com moltissime volte.
Ho provato a disabilitare completamente la creazione automatica dei link, ma questo causa un problema maggiore: gli utenti non possono più inserire un URL su una riga da soli per ottenere un onebox.
Sarebbe fantastico avere un modo per disabilitare la creazione automatica dei link “fuzzy” per evitare questo problema, mantenendo comunque la possibilità di creare link per URL completi. È possibile?
Aggiornamento… Sembra che se modificate le defaultOptions in vendor/assets/javascripts/markdown-it.js impostando fuzzyLink su false, come suggerito da Sam, si risolva il mio problema. Tuttavia, farlo crea un grosso mal di testa perché non vogliamo dover rifare manualmente questa modifica ogni volta che aggiorniamo.
Poi ho trovato una soluzione più semplice. L’impostazione markdown linkify tlds è un elenco di domini di primo livello che vengono considerati URL tramite il collegamento fuzzy. Se rimuovete tutti questi TLD e ne aggiungete solo uno fittizio che non apparirebbe mai realmente in un post, si disattiva efficacemente fuzzyLink. È necessario avere almeno un TLD nell’elenco, altrimenti, a quanto pare, qualsiasi cosa che termini con un . verrà trattata come un link.
Quindi non serve apportare modifiche al codice: possiamo disattivare fuzzyLink rimuovendo i TLD reali dall’impostazione e aggiungendone uno fittizio.
Il nostro sito ha SWI-Prolog aggiunto al componente tema Auto linkify words.
Per evitare che SWI-Prolog venga convertito in un link, ad esempio SWI-Prolog, e allo stesso tempo non venga visualizzato come una sezione di codice, ad esempio SWI-Prolog, aggiungere <span></span> nel mezzo del testo, ad esempio SWI<span></span>-Prolog, fa sì che il testo non venga riconosciuto da Auto linkify words e, poiché <span></span> viene renderizzato in qualcosa che non appare nel browser, funziona come richiesto per il caso specifico, ad esempio SWI-Prolog.
Puoi usare <span></span> per racchiudere il dominio linkificato, invece di inserirlo a metà. Questo è utile quando si parlano di aziende e altri nomi propri con punti nel nome, come itch.io.
Ad esempio, se digiti semplicemente itch.io nell’editor Markdown, verrà linkificato: itch.io
Ma puoi invece digitare <span>itch.io</span>, e così non verrà linkificato: itch.io
Non è necessario inserire <span></span> a metà del link, come in questo caso: itch<span></span>.io, ma funziona anche così: itch.io
(Sarebbe bello se @precessor o un moderatore potessero cambiare la spunta “ Soluzione” in questa risposta invece della soluzione attualmente selezionata; la vecchia soluzione funzionava nel 2016, ma non funziona più oggi.)
Perché il formato non è importante. Importa solo ciò che ottieni. E lo scopo qui è prevenire il collegamento ipertestuale, e la mia soluzione è ancora la più semplice. E la più veloce