@ -6,6 +6,7 @@ import './publicpath.js';
import './polyfills.js' ;
import Vue from 'vue' ;
import { htmlEscape } from 'escape-goat' ;
import 'jquery.are-you-sure' ;
import './vendor/semanticdropdown.js' ;
import { svg } from './utils.js' ;
@ -25,10 +26,6 @@ import {createCodeEditor} from './features/codeeditor.js';
const { AppSubUrl , StaticUrlPrefix , csrf } = window . config ;
function htmlEncode ( text ) {
return jQuery ( '<div />' ) . text ( text ) . html ( ) ;
}
let previewFileModes ;
const commentMDEditors = { } ;
@ -532,12 +529,12 @@ function initCommentForm() {
switch ( input _id ) {
case '#milestone_id' :
$list . find ( '.selected' ) . html ( ` <a class="item" href= ${ $ ( this ) . data ( 'href' ) } > ${
htmlE ncod e( $ ( this ) . text ( ) ) } < / a > ` ) ;
htmlE scap e( $ ( this ) . text ( ) ) } < / a > ` ) ;
break ;
case '#assignee_id' :
$list . find ( '.selected' ) . html ( ` <a class="item" href= ${ $ ( this ) . data ( 'href' ) } > ` +
` <img class="ui avatar image" src= ${ $ ( this ) . data ( 'avatar' ) } > ${
htmlE ncod e( $ ( this ) . text ( ) ) } < / a > ` ) ;
htmlE scap e( $ ( this ) . text ( ) ) } < / a > ` ) ;
}
$ ( ` .ui ${ select _id } .list .no-select ` ) . addClass ( 'hide' ) ;
$ ( input _id ) . val ( $ ( this ) . data ( 'id' ) ) ;
@ -1942,7 +1939,7 @@ function searchUsers() {
$ . each ( response . data , ( _i , item ) => {
let title = item . login ;
if ( item . full _name && item . full _name . length > 0 ) {
title += ` ( ${ htmlE ncod e( item . full _name ) } ) ` ;
title += ` ( ${ htmlE scap e( item . full _name ) } ) ` ;
}
items . push ( {
title ,
@ -2223,7 +2220,7 @@ function initTemplateSearch() {
// Parse the response from the api to work with our dropdown
$ . each ( response . data , ( _r , repo ) => {
filteredResponse . results . push ( {
name : htmlE ncod e( repo . full _name ) ,
name : htmlE scap e( repo . full _name ) ,
value : repo . id
} ) ;
} ) ;
@ -3500,8 +3497,8 @@ function initIssueList() {
return ;
}
filteredResponse . results . push ( {
name : ` # ${ issue . number } ${ htmlE ncod e( issue . title )
} < div class = "text small dont-break-out" > $ { htmlE ncod e( issue . repository . full _name ) } < / d i v > ` ,
name : ` # ${ issue . number } ${ htmlE scap e( issue . title )
} < div class = "text small dont-break-out" > $ { htmlE scap e( issue . repository . full _name ) } < / d i v > ` ,
value : issue . id
} ) ;
} ) ;