This commit is contained in:
Zef Hemel
2023-01-22 18:53:14 +01:00
parent 5ad804da1c
commit 53bf098579
18 changed files with 226 additions and 140 deletions
+2 -5
View File
@@ -1,10 +1,7 @@
import {
editor,
space,
} from "$sb/silverbullet-syscall/mod.ts";
import { editor, space } from "$sb/silverbullet-syscall/mod.ts";
export async function extractToPage() {
const newName = await editor.prompt(`New page title:`, 'new page');
const newName = await editor.prompt(`New page title:`, "new page");
if (!newName) {
return;
}
+9 -8
View File
@@ -25,14 +25,14 @@ export async function listifySelection() {
//if very first of doc, just add a bullet and end
if (selection.to == 0 && selection.from == 0) {
await editor.insertAtCursor("* ")
return
await editor.insertAtCursor("* ");
return;
}
let from = selection.from;
if (text[from] == "\n") {
//end of line, need to find previous line break
from--
from--;
}
while (from >= 0 && text[from] !== "\n") {
from--;
@@ -53,11 +53,12 @@ export async function numberListifySelection() {
from++;
text = text.slice(from, selection.to);
let counter = 1;
text = `1. ${text.replaceAll(/\n(?!\n)/g, () => {
counter++;
return `\n${counter}. `;
})
}`;
text = `1. ${
text.replaceAll(/\n(?!\n)/g, () => {
counter++;
return `\n${counter}. `;
})
}`;
await editor.replaceRange(from, selection.to, text);
}
+80 -20
View File
@@ -2630,14 +2630,20 @@
["🧑🏻‍🤝‍🧑🏿", "people_holding_hands_light_skin_tone_dark_skin_tone"],
["🧑🏼‍🤝‍🧑🏻", "people_holding_hands_medium_light_skin_tone_light_skin_tone"],
["🧑🏼‍🤝‍🧑🏼", "people_holding_hands_medium_light_skin_tone"],
["🧑🏼‍🤝‍🧑🏽", "people_holding_hands_medium_light_skin_tone_medium_skin_tone"],
[
"🧑🏼‍🤝‍🧑🏽",
"people_holding_hands_medium_light_skin_tone_medium_skin_tone"
],
[
"🧑🏼‍🤝‍🧑🏾",
"people_holding_hands_medium_light_skin_tone_medium_dark_skin_tone"
],
["🧑🏼‍🤝‍🧑🏿", "people_holding_hands_medium_light_skin_tone_dark_skin_tone"],
["🧑🏽‍🤝‍🧑🏻", "people_holding_hands_medium_skin_tone_light_skin_tone"],
["🧑🏽‍🤝‍🧑🏼", "people_holding_hands_medium_skin_tone_medium_light_skin_tone"],
[
"🧑🏽‍🤝‍🧑🏼",
"people_holding_hands_medium_skin_tone_medium_light_skin_tone"
],
["🧑🏽‍🤝‍🧑🏽", "people_holding_hands_medium_skin_tone"],
["🧑🏽‍🤝‍🧑🏾", "people_holding_hands_medium_skin_tone_medium_dark_skin_tone"],
["🧑🏽‍🤝‍🧑🏿", "people_holding_hands_medium_skin_tone_dark_skin_tone"],
@@ -2692,7 +2698,10 @@
"👩🏻‍🤝‍👨🏼",
"woman_and_man_holding_hands_light_skin_tone_medium_light_skin_tone"
],
["👩🏻‍🤝‍👨🏽", "woman_and_man_holding_hands_light_skin_tone_medium_skin_tone"],
[
"👩🏻‍🤝‍👨🏽",
"woman_and_man_holding_hands_light_skin_tone_medium_skin_tone"
],
[
"👩🏻‍🤝‍👨🏾",
"woman_and_man_holding_hands_light_skin_tone_medium_dark_skin_tone"
@@ -2715,7 +2724,10 @@
"👩🏼‍🤝‍👨🏿",
"woman_and_man_holding_hands_medium_light_skin_tone_dark_skin_tone"
],
["👩🏽‍🤝‍👨🏻", "woman_and_man_holding_hands_medium_skin_tone_light_skin_tone"],
[
"👩🏽‍🤝‍👨🏻",
"woman_and_man_holding_hands_medium_skin_tone_light_skin_tone"
],
[
"👩🏽‍🤝‍👨🏼",
"woman_and_man_holding_hands_medium_skin_tone_medium_light_skin_tone"
@@ -2763,7 +2775,10 @@
["👨🏼‍🤝‍👨🏻", "men_holding_hands_medium_light_skin_tone_light_skin_tone"],
["👬🏼", "men_holding_hands_medium_light_skin_tone"],
["👨🏼‍🤝‍👨🏽", "men_holding_hands_medium_light_skin_tone_medium_skin_tone"],
["👨🏼‍🤝‍👨🏾", "men_holding_hands_medium_light_skin_tone_medium_dark_skin_tone"],
[
"👨🏼‍🤝‍👨🏾",
"men_holding_hands_medium_light_skin_tone_medium_dark_skin_tone"
],
["👨🏼‍🤝‍👨🏿", "men_holding_hands_medium_light_skin_tone_dark_skin_tone"],
["👨🏽‍🤝‍👨🏻", "men_holding_hands_medium_skin_tone_light_skin_tone"],
["👨🏽‍🤝‍👨🏼", "men_holding_hands_medium_skin_tone_medium_light_skin_tone"],
@@ -2771,7 +2786,10 @@
["👨🏽‍🤝‍👨🏾", "men_holding_hands_medium_skin_tone_medium_dark_skin_tone"],
["👨🏽‍🤝‍👨🏿", "men_holding_hands_medium_skin_tone_dark_skin_tone"],
["👨🏾‍🤝‍👨🏻", "men_holding_hands_medium_dark_skin_tone_light_skin_tone"],
["👨🏾‍🤝‍👨🏼", "men_holding_hands_medium_dark_skin_tone_medium_light_skin_tone"],
[
"👨🏾‍🤝‍👨🏼",
"men_holding_hands_medium_dark_skin_tone_medium_light_skin_tone"
],
["👨🏾‍🤝‍👨🏽", "men_holding_hands_medium_dark_skin_tone_medium_skin_tone"],
["👬🏾", "men_holding_hands_medium_dark_skin_tone"],
["👨🏾‍🤝‍👨🏿", "men_holding_hands_medium_dark_skin_tone_dark_skin_tone"],
@@ -2856,8 +2874,14 @@
["👩🏼‍❤‍💋‍👨🏼", "kiss_woman_man_medium_light_skin_tone"],
["👩🏼‍❤️‍💋‍👨🏽", "kiss_woman_man_medium_light_skin_tone_medium_skin_tone"],
["👩🏼‍❤‍💋‍👨🏽", "kiss_woman_man_medium_light_skin_tone_medium_skin_tone"],
["👩🏼‍❤️‍💋‍👨🏾", "kiss_woman_man_medium_light_skin_tone_medium_dark_skin_tone"],
["👩🏼‍❤‍💋‍👨🏾", "kiss_woman_man_medium_light_skin_tone_medium_dark_skin_tone"],
[
"👩🏼‍❤‍💋‍👨🏾",
"kiss_woman_man_medium_light_skin_tone_medium_dark_skin_tone"
],
[
"👩🏼‍❤‍💋‍👨🏾",
"kiss_woman_man_medium_light_skin_tone_medium_dark_skin_tone"
],
["👩🏼‍❤️‍💋‍👨🏿", "kiss_woman_man_medium_light_skin_tone_dark_skin_tone"],
["👩🏼‍❤‍💋‍👨🏿", "kiss_woman_man_medium_light_skin_tone_dark_skin_tone"],
["👩🏽‍❤️‍💋‍👨🏻", "kiss_woman_man_medium_skin_tone_light_skin_tone"],
@@ -2872,8 +2896,14 @@
["👩🏽‍❤‍💋‍👨🏿", "kiss_woman_man_medium_skin_tone_dark_skin_tone"],
["👩🏾‍❤️‍💋‍👨🏻", "kiss_woman_man_medium_dark_skin_tone_light_skin_tone"],
["👩🏾‍❤‍💋‍👨🏻", "kiss_woman_man_medium_dark_skin_tone_light_skin_tone"],
["👩🏾‍❤️‍💋‍👨🏼", "kiss_woman_man_medium_dark_skin_tone_medium_light_skin_tone"],
["👩🏾‍❤‍💋‍👨🏼", "kiss_woman_man_medium_dark_skin_tone_medium_light_skin_tone"],
[
"👩🏾‍❤‍💋‍👨🏼",
"kiss_woman_man_medium_dark_skin_tone_medium_light_skin_tone"
],
[
"👩🏾‍❤‍💋‍👨🏼",
"kiss_woman_man_medium_dark_skin_tone_medium_light_skin_tone"
],
["👩🏾‍❤️‍💋‍👨🏽", "kiss_woman_man_medium_dark_skin_tone_medium_skin_tone"],
["👩🏾‍❤‍💋‍👨🏽", "kiss_woman_man_medium_dark_skin_tone_medium_skin_tone"],
["👩🏾‍❤️‍💋‍👨🏾", "kiss_woman_man_medium_dark_skin_tone"],
@@ -3040,7 +3070,10 @@
"🧑🏻‍❤️‍🧑🏿",
"couple_with_heart_person_person_light_skin_tone_dark_skin_tone"
],
["🧑🏻‍❤‍🧑🏿", "couple_with_heart_person_person_light_skin_tone_dark_skin_tone"],
[
"🧑🏻‍❤‍🧑🏿",
"couple_with_heart_person_person_light_skin_tone_dark_skin_tone"
],
[
"🧑🏼‍❤️‍🧑🏻",
"couple_with_heart_person_person_medium_light_skin_tone_light_skin_tone"
@@ -3141,7 +3174,10 @@
"🧑🏿‍❤️‍🧑🏻",
"couple_with_heart_person_person_dark_skin_tone_light_skin_tone"
],
["🧑🏿‍❤‍🧑🏻", "couple_with_heart_person_person_dark_skin_tone_light_skin_tone"],
[
"🧑🏿‍❤‍🧑🏻",
"couple_with_heart_person_person_dark_skin_tone_light_skin_tone"
],
[
"🧑🏿‍❤️‍🧑🏼",
"couple_with_heart_person_person_dark_skin_tone_medium_light_skin_tone"
@@ -3412,7 +3448,10 @@
"👨🏾‍❤️‍👨🏿",
"couple_with_heart_man_man_medium_dark_skin_tone_dark_skin_tone"
],
["👨🏾‍❤‍👨🏿", "couple_with_heart_man_man_medium_dark_skin_tone_dark_skin_tone"],
[
"👨🏾‍❤‍👨🏿",
"couple_with_heart_man_man_medium_dark_skin_tone_dark_skin_tone"
],
["👨🏿‍❤️‍👨🏻", "couple_with_heart_man_man_dark_skin_tone_light_skin_tone"],
["👨🏿‍❤‍👨🏻", "couple_with_heart_man_man_dark_skin_tone_light_skin_tone"],
[
@@ -3429,7 +3468,10 @@
"👨🏿‍❤️‍👨🏾",
"couple_with_heart_man_man_dark_skin_tone_medium_dark_skin_tone"
],
["👨🏿‍❤‍👨🏾", "couple_with_heart_man_man_dark_skin_tone_medium_dark_skin_tone"],
[
"👨🏿‍❤‍👨🏾",
"couple_with_heart_man_man_dark_skin_tone_medium_dark_skin_tone"
],
["👨🏿‍❤️‍👨🏿", "couple_with_heart_man_man_dark_skin_tone"],
["👨🏿‍❤‍👨🏿", "couple_with_heart_man_man_dark_skin_tone"],
["👩‍❤️‍👩", "couple_with_heart_woman_woman"],
@@ -3448,7 +3490,10 @@
"👩🏻‍❤️‍👩🏽",
"couple_with_heart_woman_woman_light_skin_tone_medium_skin_tone"
],
["👩🏻‍❤‍👩🏽", "couple_with_heart_woman_woman_light_skin_tone_medium_skin_tone"],
[
"👩🏻‍❤‍👩🏽",
"couple_with_heart_woman_woman_light_skin_tone_medium_skin_tone"
],
[
"👩🏻‍❤️‍👩🏾",
"couple_with_heart_woman_woman_light_skin_tone_medium_dark_skin_tone"
@@ -3497,7 +3542,10 @@
"👩🏽‍❤️‍👩🏻",
"couple_with_heart_woman_woman_medium_skin_tone_light_skin_tone"
],
["👩🏽‍❤‍👩🏻", "couple_with_heart_woman_woman_medium_skin_tone_light_skin_tone"],
[
"👩🏽‍❤‍👩🏻",
"couple_with_heart_woman_woman_medium_skin_tone_light_skin_tone"
],
[
"👩🏽‍❤️‍👩🏼",
"couple_with_heart_woman_woman_medium_skin_tone_medium_light_skin_tone"
@@ -3516,8 +3564,14 @@
"👩🏽‍❤‍👩🏾",
"couple_with_heart_woman_woman_medium_skin_tone_medium_dark_skin_tone"
],
["👩🏽‍❤️‍👩🏿", "couple_with_heart_woman_woman_medium_skin_tone_dark_skin_tone"],
["👩🏽‍❤‍👩🏿", "couple_with_heart_woman_woman_medium_skin_tone_dark_skin_tone"],
[
"👩🏽‍❤‍👩🏿",
"couple_with_heart_woman_woman_medium_skin_tone_dark_skin_tone"
],
[
"👩🏽‍❤‍👩🏿",
"couple_with_heart_woman_woman_medium_skin_tone_dark_skin_tone"
],
[
"👩🏾‍❤️‍👩🏻",
"couple_with_heart_woman_woman_medium_dark_skin_tone_light_skin_tone"
@@ -3562,8 +3616,14 @@
"👩🏿‍❤‍👩🏼",
"couple_with_heart_woman_woman_dark_skin_tone_medium_light_skin_tone"
],
["👩🏿‍❤️‍👩🏽", "couple_with_heart_woman_woman_dark_skin_tone_medium_skin_tone"],
["👩🏿‍❤‍👩🏽", "couple_with_heart_woman_woman_dark_skin_tone_medium_skin_tone"],
[
"👩🏿‍❤‍👩🏽",
"couple_with_heart_woman_woman_dark_skin_tone_medium_skin_tone"
],
[
"👩🏿‍❤‍👩🏽",
"couple_with_heart_woman_woman_dark_skin_tone_medium_skin_tone"
],
[
"👩🏿‍❤️‍👩🏾",
"couple_with_heart_woman_woman_dark_skin_tone_medium_dark_skin_tone"
+1 -1
View File
@@ -9,7 +9,7 @@ document.getElementById("root").addEventListener("click", (e) => {
syscall(
"event.dispatch",
"preview:click",
JSON.stringify(["pos", dataSet["pos"]])
JSON.stringify(["pos", dataSet["pos"]]),
).catch((e) => console.log("Error", e));
}
});
+25 -27
View File
@@ -1,22 +1,24 @@
---
name: Sup
---
# Hello world
This is **bold** and _italic_, or *italic*. And a **_mix_**. And ==highlight==!
This is one line
and this another.
# Hello world
This is **bold** and _italic_, or _italic_. And a **_mix_**. And ==highlight==!
This is one line and this another.
Lists:
* This
* Is a
* list
* And here we go nested
- This
- Is a
- list
- And here we go nested
1. This is a numbered
2. Two
* And different
* Bla
* More bla
- And different
- Bla
- More bla
And:
@@ -42,22 +44,18 @@ And like this:
And a blockquote:
> Sup yo
> Empty line
> Sup yo Empty line\
> Second part
<!-- this is a comment -->
And more custom stuff
[[Page link]]
And more custom stuff [[Page link]]
{[Command button]}
* [ ] #next Task
* [x] #next Task 2
* [ ] Task with dealine 📅 2022-05-06 fef
- [ ] #next Task
- [x] #next Task 2
- [ ] Task with dealine 📅 2022-05-06 fef
https://community.mattermost.com
@@ -67,20 +65,20 @@ $anchor
## Tables
|type |actor_login|created_at |payload_ref |
|---------|--------|--------------------|----------------------|
|PushEvent|avb|2022-10-27T08:27:48Z|refs/heads/master |
|PushEvent|avb|2022-10-27T04:31:27Z|refs/heads/jitterSched|
| type | actor_login | created_at | payload_ref |
| --------- | ----------- | -------------------- | ---------------------- |
| PushEvent | avb | 2022-10-27T08:27:48Z | refs/heads/master |
| PushEvent | avb | 2022-10-27T04:31:27Z | refs/heads/jitterSched |
Here is something
---
A new thing.
A new thing.
![alt text](https:/
## Weird stuff
* [{{#if done}}x{{else}} {{/if}}] [[{{page}}@{{pos}}]] {{name}} {{#if deadline}}📅 {{deadline}}{{/if}} {{#each tags}}{{.}} {{/each}}
- [{{#if done}}x{{else}} {{/if}}] [[{{page}}@{{pos}}]] {{name}} {{#if
deadline}}📅 {{deadline}}{{/if}} {{#each tags}}{{.}} {{/each}}
+1 -1
View File
@@ -116,7 +116,7 @@ async function toggleTaskMarker(node: ParseTree, moveToPos: number) {
const ref = wikiLink.children![0].text!;
if (ref.includes("@")) {
const [page, pos] = ref.split("@");
let text = (await space.readPage(page));
let text = await space.readPage(page);
const referenceMdTree = await markdown.parseMarkdown(text);
// Adding +1 to immediately hit the task marker