Skip to content

Commit

Permalink
Merge pull request jbt#9 from dennyschwender/master
Browse files Browse the repository at this point in the history
PR jbt#9 adds regex to generate file name from Document title.
  • Loading branch information
aero31aero committed Dec 6, 2016
2 parents 04d50f4 + 00d88af commit bf2b064
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions index.css
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@
margin-left: -25%;
padding-left: 0%;
left:0;
border-left: 0 !important;
}

@media screen and (max-width: 1024px) {
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,12 @@ document.addEventListener('drop', function(e) {

//Print the document named as the document title encoded to avoid strange chars and spaces
function saveAsMarkdown() {
save(editor.getValue(), encodeURIComponent(document.title).replace(/%20/g,'')+".md");
save(editor.getValue(), document.title.replace(/[`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/\s]/gi, '')+".md");
}

//Print the document named as the document title encoded to avoid strange chars and spaces
function saveAsHtml() {
save(document.getElementById('out').innerHTML, encodeURIComponent(document.title).replace(/%20/g,'')+".html");
save(document.getElementById('out').innerHTML, document.title.replace(/[`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/\s]/gi, '')+".html");
}

document.getElementById('saveas-markdown').addEventListener('click', function() {
Expand Down

0 comments on commit bf2b064

Please sign in to comment.