added: comment selection (html tags)

This commit is contained in:
quenousimporte 2023-01-30 10:16:07 +01:00
parent 32f17ba99e
commit 578e548883
1 changed files with 14 additions and 1 deletions

15
main.js
View File

@ -313,6 +313,10 @@ var commands = [
{ {
hint: "Include subnote", hint: "Include subnote",
action: includesub action: includesub
},
{
hint: "Comment selection",
action: comment
}]; }];
var snippets = [ var snippets = [
@ -376,7 +380,16 @@ function createsubnote()
+ md.value.substring(range.end); + md.value.substring(range.end);
datachanged(); datachanged();
} }
}) });
}
function comment()
{
md.value = md.value.substring(0, md.selectionStart)
+ "<!-- "
+ md.value.substring(md.selectionStart, md.selectionEnd)
+ " -->"
+ md.value.substring(md.selectionEnd);
} }
function includesub() function includesub()