I changed the Text: Italic
command to use *
instead of _
.
I prefer to use *
for both bold and italic text. Both *
and _
are part of CommonMark, but _
generally won’t work to italicize part of a word.
silverbullet.registerCommand({
name: "Text: Italic",
key: "Ctrl-i"
}, async () => {
const selection = await syscall("editor.getSelection");
const from = selection.from;
const to = selection.to;
await syscall("editor.dispatch", {
changes: [
{ from: from, to: from, insert: "*" },
{ from: to, to: to, insert: "*" },
],
});
});