Merge pull request #1194 from huhani/develop

하이퍼링크 href값이 javascript나 mailto로 시작될 경우 target=_blank 속성을 추가하지 않게 수정
This commit is contained in:
Kijin Sung 2019-08-31 17:20:06 +09:00 committed by GitHub
commit 7de8ecc0ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -92,10 +92,15 @@
});
xe.registerPlugin(new AutoLink());
$(document).on('click', '.xe_content a', function() {
if (!$(this).attr("target")) {
$(this).attr("target", "_blank");
var $this = $(this);
var href = $this.attr('href');
if(!href || /^(?:javascript|mailto):/.test(href)) {
return;
}
if (!$this.attr("target")) {
$this.attr("target", "_blank");
}
});