Prevent hyperlink

How can I prevent a www.example.com URL from becoming a hyperlink, without (ab)using another formatting feature such as inline code formatting?

I notice I can quote: “www.example.com”, but I’d like to avoid that. Is it possible to somehow escape the auto-link change as I create/edit a post?

Backslashes?
www\.example\.com
www.example.com

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

Why in the world would you do any of that when you can simply use a proper code span with the ` key?

www.example.com

See Markdown Reference

Because it’s not code?

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. :wink:

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.

Yeah bypassing linkify is not easy:

https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.js

and

https://github.com/markdown-it/linkify-it

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. :nerd_face:

(and I promise to not suggest a Discourse GSoC project to add support for www\.example\.com)

우리 포럼의 주요 목적은 Alarm.com이라는 회사에 대해 이야기하는 것이기 때문에, 회원들이 게시글에 Alarm.com을 자주 언급합니다. 아마도 전체 토론 주제의 50% 정도에서 그렇게 될 것입니다. 결과적으로 Alarm.com으로의 링크가 의도치 않게 매우 많이 생성될 것입니다.

linkify 기능을 완전히 비활성화해 보았지만, 그렇게 하면 사람들이 URL을 한 줄로만 입력하여 onebox를 생성할 수 없게 되어 더 큰 문제가 발생합니다.

이 문제를 피하면서도 전체 URL은 linkify할 수 있도록 linkify fuzzy 기능을 비활성화할 수 있는 방법이 있으면 좋겠습니다. 가능한가요?

추가로 말씀드리자면… Sam이 제안한 대로 vendor/assets/javascripts/markdown-it.js의 defaultOptions에서 fuzzyLink를 false로 변경하면 제 문제가 해결되는 것 같습니다. 하지만 이렇게 하면 매번 업데이트할 때마다 해당 변경 사항을 수동으로 다시 적용해야 하므로 큰 부담이 됩니다.

그런데 더 간단한 해결책을 찾았습니다. markdown linkify tlds 설정은 퍼지 링크(fuzzy linking)가 URL로 간주하는 최상위 도메인(TLD) 목록입니다. 이 목록에서 모든 실제 TLD를 제거하고, 게시글에 절대 등장하지 않을 가짜 TLD 하나만 추가하면 fuzzyLink를 사실상 비활성화할 수 있습니다. 목록에 TLD가 하나 이상 있어야 하며, 그렇지 않으면 마침표(.)로 끝나는 모든 것이 링크로 처리되는 것으로 보입니다.

따라서 코드 변경 없이, 설정에서 실제 TLD를 제거하고 가짜 TLD를 추가함으로써 fuzzyLink를 비활성화할 수 있습니다.

Auto linkify words을 억제하기 위한 또 다른 우회 방법입니다.

텍스트 중간에 <span></span>을 추가하세요.


세부 사항

저희 사이트는 Auto linkify words 컴포넌트 테마에 SWI-Prolog가 추가되어 있습니다.

SWI-Prolog가 링크로 변환되는 것, 예를 들어 SWI-Prolog, 그리고 코드 섹션으로 표시되는 것, 예를 들어 SWI-Prolog를 방지하기 위해 텍스트 중간에 <span></span>을 추가하면, 예를 들어 SWI<span></span>-Prolog, Auto linkify words에 의해 텍스트가 인식되지 않습니다. 또한 <span></span>은 브라우저에서 표시되지 않는 것으로 렌더링되므로, 특정 사례, 예를 들어 SWI-Prolog에 대해 필요한 대로 작동합니다.

링크화된 도메인 중간에 태그를 삽입하는 대신 <span></span> 태그로 감싸서 사용할 수 있습니다. 이는 점(.)이 포함된 회사명이나 기타 고유명사, 예를 들어 itch.io 같은 경우를 다룰 때 유용합니다.

예를 들어 마크다운 편집기에 단순히 itch.io라고 입력하면 링크로 변환됩니다: itch.io

하지만 대신 <span>itch.io</span>라고 입력하면 링크로 변환되지 않습니다: itch.io

itch<span></span>.io처럼 링크 중간에 <span></span>을 삽입할 필요는 없지만, 이렇게 하는 것도 작동합니다: itch.io

(@precessor 또는 모더레이터가 현재 선택된 답변 대신 이 답변을 ":white_check_mark: 해결책"으로 변경해 주시면 좋겠습니다. 이전 해결책은 2016년에는 작동했지만, 지금은 더 이상 작동하지 않습니다.)

오늘 저에게 효과가 있었던 방법은 이것뿐이었습니다.

Itch.io


Itch`.`io

프리포맷팅은 툴바에 있으며 더 빠르게 사용할 수 있습니다 :wink:

다만, 그렇게 하면 형식이 바뀌게 되는데, 형식을 바꾸지 않는 옵션 대신 왜 그렇게 하려 하시나요?

형식은 중요하지 않습니다. 중요한 것은 당신이 얻는 결과뿐입니다. 그리고 여기의 목적은 하이퍼링크를 방지하는 것이므로, 제 해결책이 여전히 가장 쉽고 빠릅니다 :wink: