Merge d87c3b7d61fb61cd5d0b1f2742257a7a1b749c33 into 9fdcd0859183ab34a306cef2c2d284b9c9442e3b
This commit is contained in:
commit
78615d5b82
@ -4,6 +4,15 @@ var haste_document = function() {
|
||||
this.locked = false;
|
||||
};
|
||||
|
||||
// Escapes HTML tag characters
|
||||
haste_document.prototype.htmlEscape = function(s) {
|
||||
return s
|
||||
.replace(/&/g, '&')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/</g, '<')
|
||||
.replace(/"/g, '"');
|
||||
};
|
||||
|
||||
// Get this document from the server and lock it here
|
||||
haste_document.prototype.load = function(key, callback, lang) {
|
||||
var _this = this;
|
||||
@ -17,7 +26,7 @@ haste_document.prototype.load = function(key, callback, lang) {
|
||||
try {
|
||||
var high;
|
||||
if (lang === 'txt') {
|
||||
high = { value: res.data };
|
||||
high = { value: _this.htmlEscape(res.data) };
|
||||
}
|
||||
else if (lang) {
|
||||
high = hljs.highlight(lang, res.data);
|
||||
|
2
static/application.min.js
vendored
2
static/application.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user