Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dolgarev/meteor-escapehtml

Expose internal method Blaze._escape
https://github.com/dolgarev/meteor-escapehtml

meteor meteor-package meteorjs

Last synced: 9 days ago
JSON representation

Expose internal method Blaze._escape

Awesome Lists containing this project

README

        

# meteor-escapeHtml

Expose internal method `Blaze._escape` as `Blaze.escapeHtml`

```js
Blaze.escapeHtml('alert(123)') // => result is "<script>alert(123)</script>"
Blaze.escapeHtml(1) // => result is error "Uncaught TypeError: x.replace is not a function"
Blaze.escapeHtml(1, 'n/a') // => result is "n/a"

Blaze.escapeHtmlString('alert(123)') // => result is "<script>alert(123)</script>"
Blaze.escapeHtmlString(1) // => result is "1"
Blaze.escapeHtmlString(1, 'n/a') // => result is "<b>n/a</b>"
```