# 아이디어: 가져온 HTML에서 태그가 없는 URL을 항상 링크로 변환하는 옵션

**URL:** https://meta.discourse.org/t/idea-option-to-always-linkify-untagged-urls-in-imported-html/252590
**Category:** Feature
**Created:** [1월 23, 2023, 1:30오후 UTC](https://meta.discourse.org/t/idea-option-to-always-linkify-untagged-urls-in-imported-html/252590 "2023-01-23T13:30:20Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![rahim123](https://avatars.discourse-cdn.com/v4/letter/r/df705f/32.png) [@rahim123](https://meta.discourse.org/u/rahim123)
#### Post date: [1월 23, 2023, 1:30오후 UTC](https://meta.discourse.org/t/idea-option-to-always-linkify-untagged-urls-in-imported-html/252590/1 "2023-01-23T13:30:20Z")

</div>

안녕하세요, 대규모 Drupal 포럼을 Discourse로 가져오는 작업을 진행 중입니다. Drupal을 비롯한 대부분의 포럼/CMS 플랫폼은 단순히 [https://example.com을](https://example.xn--com-of0o) 입력하기만 하면 게시글에 HTML 링크를 자동으로 생성해 줍니다. Discourse도 마찬가지입니다. 다만 Discourse는 게시글이 마크다운으로 작성된 경우에만 이를 수행하며, HTML 요소 내부(가져온 게시글이든 사용자가 다른 곳에서 HTML을 붙여넣든)에서는 적용하지 않습니다. 다른 포럼 플랫폼에서 가져온 HTML의 경우, 원본 게시글 본문에 링크로 태그되지 않은 URL이 많은데, 포럼 엔진은 렌더링된 게시글에서 URL을 감지하여 자동으로 링크로 변환해 줍니다. 하지만 Discourse에서는 다음과 같은 HTML 단락의 URL은 링크가 되지 않습니다:

* * *

`<p>Take a look at http://example.com for that.</p>`

Take a look at http://example.com for that.

* * *

가져오기 스크립트에서 정규식을 사용해 원시 URL을 감지하여 마크다운 링크로 변환하는 방법이 있거나, 단순히 `<p>` 태그를 줄바꿈으로 교체하면 Discourse가 올바르게 렌더링할 것입니다. 하지만 이는 상당히 어수선한 해결책이며, 정규식 처리 과정에서 의도치 않게 링크가 생성되거나 게시글 전체가 삭제되는 특수한 케이스가 발생할까 봐 제 정규식 실력이 믿어지지 않습니다. HTML 코드 내부의 원시 URL을 감지하여 자동으로 링크로 변환해 주는 Discourse 옵션이 있다면 매우 유용할 것입니다.

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [1월 23, 2023, 1:54오후 UTC](https://meta.discourse.org/t/idea-option-to-always-linkify-untagged-urls-in-imported-html/252590/2 "2023-01-23T13:54:33Z")

</div>

`enable rich text paste` 설정이 도움이 될 수 있을까요?

---

<div class="post-metadata">

### Author: ![rahim123](https://avatars.discourse-cdn.com/v4/letter/r/df705f/32.png) [@rahim123](https://meta.discourse.org/u/rahim123)
#### Post date: [1월 23, 2023, 1:59오후 UTC](https://meta.discourse.org/t/idea-option-to-always-linkify-untagged-urls-in-imported-html/252590/3 "2023-01-23T13:59:17Z")

</div>

그 옵션을 언급해 주셔서 감사합니다. 이전 엔진이 이미 URL을 자동으로 링크한 경우, 렌더링된 HTML을 붙여 넣을 때 해당 옵션이 작동할 수 있습니다. 그러나 링크되지 않은 URL이 포함된 원시 HTML 코드에는 적용되지 않습니다. 또한 다른 포럼 엔진에서 가져온 게시물에는 그 옵션이 영향을 주지 않습니다.

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [1월 23, 2023, 2:03오후 UTC](https://meta.discourse.org/t/idea-option-to-always-linkify-untagged-urls-in-imported-html/252590/4 "2023-01-23T14:03:04Z")

</div>

네, 그 말도 꽤 논리적으로 들리네요,
