Started work on markdown image support
This commit is contained in:
parent
a1de20f0ec
commit
4f7836d296
4 changed files with 49 additions and 26 deletions
28
src/main.js
28
src/main.js
|
|
@ -18,15 +18,13 @@ textarea.addEventListener('input', ()=> {
|
|||
text = textarea.innerText;
|
||||
var tag_id = document.getElementById('rendered_markdown');
|
||||
tag_id.innerHTML = "<p>HI</p>"
|
||||
// invoke("parse_markdown", { document: text }).then(
|
||||
// (ret)=>{
|
||||
// var tag_id = document.getElementById('rendered_markdown');
|
||||
// // tag_id.innerHTML = assetUrl.concat(" ", ' \n <img src="'.concat("", assetUrl).concat("", '" alt="Girl in a jacket" width="500" height="600">'))
|
||||
// tag_id.innerHTML = "<p>HI</p>"
|
||||
// // tag_id.innerHTML = "<pre>".concat("", ret).concat("", "</pre>");
|
||||
tag_id.innerHTML = assetUrl.concat(" ", ' \n <img src="'.concat("", assetUrl).concat("", '" alt="Girl in a jacket" width="500" height="600">'))
|
||||
// }
|
||||
// );
|
||||
invoke("parse_markdown", { document: text }).then(
|
||||
(ret)=>{
|
||||
var tag_id = document.getElementById('rendered_markdown');
|
||||
tag_id.innerHTML = "<pre>".concat("", ret).concat("", "</pre>");
|
||||
// tag_id.innerHTML = assetUrl.concat(" ", ' \n <img src="'.concat("", assetUrl).concat("", '" alt="Girl in a jacket" width="500" height="600">'))
|
||||
}
|
||||
);
|
||||
|
||||
// });
|
||||
});
|
||||
|
|
@ -43,3 +41,15 @@ function toggle_visibility(id) {
|
|||
}
|
||||
|
||||
}
|
||||
function handleShortcut(event) {
|
||||
var markdown_editor = document.getElementById('markdown_input');
|
||||
|
||||
if (document.activeElement === markdown_editor){
|
||||
if (event.ctrlKey) {
|
||||
if (event.key === "l"){
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
document.addEventListener("keydown", handleShortcut);
|
||||
|
|
|
|||
|
|
@ -82,7 +82,13 @@ h1 {
|
|||
margin-bottom: 0.067em;
|
||||
}
|
||||
|
||||
ol li {
|
||||
margin-left: 1em;
|
||||
}
|
||||
|
||||
ul li {
|
||||
margin-left: 1em;
|
||||
}
|
||||
.sidebar_button {
|
||||
width: 100%;
|
||||
background-color: var(--main-bg-color);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue