# 6.4.1 HTML Strip

&#x20; 입력된 텍스트가 HTML 인 경우 HTML 태그들을 제거하여 일반 텍스트로 만듭니다. `<>`로 된 태그를 제거할 뿐 아니라 `&nbsp;` 같은 HTML 문법 용어들도 해석합니다. 입력 값은 `html_strip` 입니다.

&#x20; 다음은 HTML Strip 캐릭터 필터를 이용해서 `<p>I&apos;m so <b>happy</b>!</p>` 문장을 처리 한 결과입니다.

{% tabs %}
{% tab title="request" %}
{% code title="char\_filter 를 이용해서 html 문장 처리" %}

```javascript
POST _analyze
{
  "tokenizer": "keyword",
  "char_filter": [
    "html_strip"
  ],
  "text": "<p>I&apos;m so <b>happy</b>!</p>"
}
```

{% endcode %}
{% endtab %}

{% tab title="response" %}
{% code title="char\_filter 를 이용해서 html 문장 처리 결과" %}

```javascript
{
  "tokens" : [
    {
      "token" : """

I'm so happy!

""",
      "start_offset" : 0,
      "end_offset" : 32,
      "type" : "word",
      "position" : 0
    }
  ]
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

&#x20; 모든 태그들이 제거되고 해석되어 **"I'm so happy!"** 라는 문장으로 변경 된 것을 확인할 수 있습니다.

{% hint style="warning" %}
애널라이저는 항상 최소 1개의 토크나이저를 필요로 하기 때문에 캐릭터 필터만 적용하면 오류가 발생합니다. 위 예제에서는 **keyword** 토크나이저를 같이 사용했습니다.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://esbook.kimjmin.net/06-text-analysis/6.4-character-filter/6.4.1-html-strip.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
