Skip to content

Commit 6b5fcdf

Browse files
save file
1 parent da3281c commit 6b5fcdf

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

utils/editors/markdown-editor/html/output-md/v2.0/output-md-v2.0.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,13 @@
477477

478478
async function github_markdown(txt){
479479

480+
var headers = {};
480481
var body = txt;
481-
var res = await fetch('https://api.github.com/markdown/raw',{method:'post',body});
482+
var token = localStorage['github-token'];
483+
if(token){
484+
headers.authorization:`Bearer ${token}`
485+
}
486+
var res = await fetch('https://api.github.com/markdown/raw',{headers,method:'post',body});
482487
var txt = await res.text();
483488
return txt;
484489

0 commit comments

Comments
 (0)