Merge commit '49695c62c9bfe1e35f6e5a45a9f8b39f1da71b8e' into releases

This commit is contained in:
RedocBot 2017-11-16 13:26:18 +00:00 committed by Travis CI User
commit 7984b56eb2
3 changed files with 27 additions and 2 deletions

View File

@ -1,3 +1,21 @@
<a name="1.19.3"></a>
## [1.19.3](https://github.com/Rebilly/ReDoc/compare/v1.19.2...v1.19.3) (2017-11-16)
### Bug Fixes
* html characters not escaped in code blocks (fixes [#378](https://github.com/Rebilly/ReDoc/issues/378)) ([fef9ec4](https://github.com/Rebilly/ReDoc/commit/fef9ec4))
<a name="1.19.2"></a>
## [1.19.2](https://github.com/Rebilly/ReDoc/compare/v1.19.1...v1.19.2) (2017-11-10)
### Bug Fixes
* response samples doesn't show only text/plain (fixes [#371](https://github.com/Rebilly/ReDoc/issues/371)) ([00aea06](https://github.com/Rebilly/ReDoc/commit/00aea06))
<a name="1.19.1"></a> <a name="1.19.1"></a>
# [1.19.1](https://github.com/Rebilly/ReDoc/compare/v1.19.0...v1.19.1) (2017-10-02) # [1.19.1](https://github.com/Rebilly/ReDoc/compare/v1.19.0...v1.19.1) (2017-10-02)

View File

@ -5,6 +5,13 @@ import * as slugify from 'slugify';
import * as Remarkable from 'remarkable'; import * as Remarkable from 'remarkable';
import { StringMap } from './'; import { StringMap } from './';
function HTMLescape(html: string): string {
return document.createElement('div')
.appendChild(document.createTextNode(html))
.parentElement
.innerHTML;
}
declare var Prism: any; declare var Prism: any;
const md = new Remarkable({ const md = new Remarkable({
html: true, html: true,
@ -15,7 +22,7 @@ const md = new Remarkable({
if (lang === 'json') lang = 'js'; if (lang === 'json') lang = 'js';
let grammar = Prism.languages[lang]; let grammar = Prism.languages[lang];
// fallback to click // fallback to click
if (!grammar) return str; if (!grammar) return HTMLescape(str);
return Prism.highlight(str, grammar); return Prism.highlight(str, grammar);
} }
}); });

View File

@ -1,7 +1,7 @@
{ {
"name": "redoc", "name": "redoc",
"description": "Swagger-generated API Reference Documentation", "description": "Swagger-generated API Reference Documentation",
"version": "1.19.2", "version": "1.19.3",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git://github.com/Rebilly/ReDoc" "url": "git://github.com/Rebilly/ReDoc"