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)
O principal objetivo do nosso fórum é discutir uma empresa chamada Alarm.com, então as pessoas escrevem ‘Alarm.com’ nos posts o tempo todo, provavelmente em cerca de 50% dos tópicos. Acabaremos vinculando inadvertidamente ao Alarm.com com muita frequência.
Tentei desativar o linkify completamente, mas isso causa um problema maior, pois as pessoas não conseguem mais colocar uma URL em uma linha separada para obter um onebox.
Adoraríamos ter uma maneira de desativar o linkify fuzzy para evitar esse problema, mas ainda assim poder linkificar URLs completas. É possível?
Continuando… Parece que, se você alterar o defaultOptions em vendor/assets/javascripts/markdown-it.js para que fuzzyLink seja false, como Sam sugeriu, isso resolve meu problema. Mas fazer isso cria um grande problema, pois não queremos ter que refazer essa alteração manualmente toda vez que atualizarmos.
Então, encontrei uma solução mais simples. A configuração markdown linkify tlds é uma lista de domínios de nível superior que são assumidos como URLs por meio de linkagem difusa. Se você remover todos esses TLDs e adicionar apenas um TLD falso que nunca apareceria em um post, isso desativa efetivamente o fuzzyLink. Você precisa de pelo menos um TLD na lista, ou, aparentemente, qualquer coisa que termine com um . será tratada como um link.
Portanto, não é necessário alterar o código; podemos desativar o fuzzyLink removendo os TLDs reais da configuração e adicionando um falso.
Nosso site tem SWI-Prolog adicionado ao componente de tema Auto linkify words.
Para evitar que SWI-Prolog seja convertido em um link, como SWI-Prolog, e também não seja exibido como uma seção de código, como SWI-Prolog, adicionar <span></span> no meio do texto, por exemplo, SWI<span></span>-Prolog, faz com que o texto não seja reconhecido pelo Auto linkify words. Como <span></span> é renderizado de forma invisível no navegador, isso funciona conforme necessário para o caso específico, ou seja, SWI-Prolog.
Você pode usar <span></span> para envolver o domínio linkificado, em vez de inseri-lo no meio. Isso é útil ao falar sobre empresas e outros nomes próprios que contêm pontos em seus nomes, como itch.io.
Por exemplo, se você apenas digitar itch.io no editor Markdown, ele será linkificado: itch.io
Mas você pode digitar <span>itch.io</span>, e assim ele não será linkificado: itch.io
Você não precisa inserir <span></span> no meio do link, como em itch<span></span>.io, mas isso também funciona: itch.io
(Seria bom se @precessor ou um moderador pudesse alterar a marcação “ Solução” para esta resposta, em vez da solução atualmente selecionada; a solução antiga funcionava em 2016, mas não funciona mais hoje.)
Porque o formato não é importante. Apenas o que você obtém é. E o propósito aqui é prevenir a criação de links, e minha solução ainda é a mais fácil. E a mais rápida