Hello. I'm trying to create HTML api it means server responds HTML tag. Now, I tested simple case. This is my code.

スクリーンショット 2022-11-22 15 20 25

I intend to get only p tag.

スクリーンショット 2022-11-22 15 19 48

but as you can see, HTML has other basic tags.

how do I remove them?

Comment From: dongsuo

Have you tried c.String?

Comment From: chihiro-yabuta

thank you for your reply, @dongsuo but it is simple case, actually I want to get SVG tag. if I use string or writer, I got wrapped pre tag

スクリーンショット 2022-11-22 16 29 38

if I attach html, I could get but html is not pure svg.

branch

スクリーンショット 2022-11-22 16 35 07

so I can't get api through url directly.

actually, I want to get api

<img src={url} />

like this.

Comment From: dongsuo

I think the pre tag is added by Chrome. Try check the response in cURL or postman, or network tab of Chrome Devtools? Also I don't know what your purpose is, but I advice you use JSON struct to wrap your html string like this:

{
  "html_snippet":  "<img src={url} />"
}

**Comment From: chihiro-yabuta**

<img width="1260" alt="スクリーンショット 2022-11-22 17 34 20" src="https://user-images.githubusercontent.com/114799344/203264949-55664bc7-e499-4cb0-ba02-477efe653a43.png">

but safari renders as well.

I want to get **SVG**, not string.
and img is example.
I mean I want to be enable to distribute SVG image from url.

so now, I need to attach html tag and I wrote like this