Merge pull request #19 from tanabe/feature/issue-18-fix-self-xss
Fix #18
This commit is contained in:
commit
b0cb2ec687
@ -14,6 +14,7 @@
|
|||||||
<script type="text/javascript" src="js/jquery-1.6.1.min.js"></script>
|
<script type="text/javascript" src="js/jquery-1.6.1.min.js"></script>
|
||||||
<script type="text/javascript" src="js/jquery.autosize-min.js"></script>
|
<script type="text/javascript" src="js/jquery.autosize-min.js"></script>
|
||||||
<script type="text/javascript" src="js/marked.min.js"></script>
|
<script type="text/javascript" src="js/marked.min.js"></script>
|
||||||
|
<script type="text/javascript" src="js/purify.min.js"></script>
|
||||||
<script type="text/javascript" src="js/main.js"></script>
|
<script type="text/javascript" src="js/main.js"></script>
|
||||||
|
|
||||||
<title>Markdown Live Preview</title>
|
<title>Markdown Live Preview</title>
|
||||||
|
@ -9,7 +9,8 @@ $(function() {
|
|||||||
|
|
||||||
let convert = () => {
|
let convert = () => {
|
||||||
let html = marked($('#markdown').val());
|
let html = marked($('#markdown').val());
|
||||||
$('#output').html(html);
|
let sanitized = DOMPurify.sanitize(html);
|
||||||
|
$('#output').html(sanitized);
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#markdown').bind('keyup', function() {
|
$('#markdown').bind('keyup', function() {
|
||||||
|
3
public/js/purify.min.js
vendored
Normal file
3
public/js/purify.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
public/js/purify.min.js.map
Normal file
1
public/js/purify.min.js.map
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user