aboutsummaryrefslogtreecommitdiff
path: root/docs/guides/util/escape-html.md
blob: 4d88fb85766f2c5906c9287278081f545f6ef227 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
---
name: Escape an HTML string
---

The `Bun.escapeHTML()` utility can be used to escape HTML characters in a string. The following replacements are made.

- `"` becomes `"""`
- `&` becomes `"&"`
- `'` becomes `"'"`
- `<` becomes `"&lt;"`
- `>` becomes `"&gt;"`

This function is optimized for large input. Non-string types will be converted to a string before escaping.

```ts
Bun.escapeHTML("<script>alert('Hello World!')</script>");
// &lt;script&gt;alert(&#x27;Hello World!&#x27;)&lt;&#x2F;script&gt;
```

---

See [Docs > API > Utils](/docs/api/utils) for more useful utilities.
sts2'>sb-tests2 Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/packages/integrations/netlify/test/edge-functions/fixtures/prerender (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2023-05-31feat(hybrid): unflag hybrid output (#7255)Gravatar Nate Moore 29-130/+61
2023-05-31Markdoc: strip HTML comments from output (#7224)Gravatar Ben Holmes 2-1/+13
* feat: strip HTML comments from output * chore: changeset
2023-05-30Fix out-of-date example dependencies (#7248)Gravatar Ben Holmes 33-198/+211
* revert changeset patch * deps: bump astro across examples * deps: bump @astrojs packages across examples * deps: bump @astrojs/markdoc
2023-05-30[ci] release (#7190)astro@2.5.6@astrojs/webapi@2.2.0@astrojs/vue@2.2.1@astrojs/vercel@3.4.1@astrojs/sitemap@1.3.2@astrojs/react@2.2.1@astrojs/preact@2.2.1@astrojs/partytown@1.2.3@astrojs/mdx@0.19.5@astrojs/markdoc@0.3.0Gravatar Houston (Bot) 48-171/+216
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-30Content collections - fix `.json` collection errors (#7246)Gravatar Ben Holmes 4-7/+52
* fix: avoid error on collectionType === 'unknown' * fix: ignore underscores in file globs * chore: clarify [!_] * fix: mismatch error not throwing * fix: bad collectionType var * test: no error for empty collection * chore: changeset
2023-05-30[ci] formatGravatar bholmesdev 4-5/+5
2023-05-30Markdoc - remove `$entry` variable (#7244)Gravatar Ben Holmes 16-257/+217
* refactor: remove entry prop from `getRenderModule()` * refactor: remove `$entry` from markdoc * test: update entry-prop -> variables test * refactor: unify `getEntryConfigByExt` * chore: clean up shared content / data get logic * docs: update `$entry` recommendation * chore: rename entry-prop -> variables * chore: changeset * chore: missed a spot
2023-05-30Markdoc: new README for Markdoc nodes (#7225)Gravatar Ben Holmes 1-46/+85
* docs: all-new nodes documentation * edit: `.astro` ONLY Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * edit: `.` outside links, line break Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * edit: such as, not like Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * edit: more Astro less probs Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * edit: reviewers React to Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * edit: tagz Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * chore: add `default: 'article'` for document * edit: reword client-side instructions * edit: prism stylesheet got lost * fix: heading -> blockquote --------- Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2023-05-30[ci] formatGravatar MoustaphaDev 1-1/+1
2023-05-30fix: prioritize dynamic prerendered routes over dynamic server routes (#7235)Gravatar Happydev 6-19/+361
* test: add unit tests * fix: prioritize prerendered routes * chore: fix test * add comment * test: try avoiding race condition * chore: changeset * try avoiding race conditions attempt #2 * try avoiding race conditions (attempt 3) * final fix hopefuly * tet: add more tests * sort conflicting dynamic routes aplhabetically * test: fix test
2023-05-30[ci] formatGravatar matthewp 1-5/+8
2023-05-30Bug 6672 (#7062)Gravatar wulinsheng123 10-0/+138
* fix miss a head when the templaterender has a promise * fix * add some test * test files move to md directory * fix add * delect file --------- Co-authored-by: wuls <linsheng.wu@beantechs.com>