void;
@@ -79,6 +80,10 @@ export function InitGit({ path, name, empty, ignored, disabled, onInit }: {
}
}
+ const folder = `'${path.replaceAll("'", `'\\''`)}'`;
+ const commands = `cd ${folder} && ${
+ empty ? "" : "git init && "
+ }git add -A && git commit -m "Initial commit"`;
const lanes = empty
? `Channels work in lanes, which are Git worktrees, and ${name} has no commit yet.`
: "Channels work in lanes, which are Git worktrees.";
@@ -92,14 +97,19 @@ export function InitGit({ path, name, empty, ignored, disabled, onInit }: {
{ignored
? (
-
- {lanes} {name} already has a{" "}
- .gitignore, so Ace won't commit under its rules. {empty ? "Commit" : (
- <>
- Run git init and commit
- >
- )} its files yourself, then channels can start here.
-
+ <>
+
+ {lanes} {name} already has a{" "}
+ .gitignore, so Ace won't commit under its rules. {empty ? "Commit" : (
+ <>
+ Run git init and commit
+ >
+ )} its files yourself, such as in a terminal, then channels can start here.
+
+
+
+
+ >
)
: (
<>
diff --git a/packages/ui/src/components/rich-text/commands.ts b/packages/ui/src/components/rich-text/commands.ts
index c5c6fd85..316740bb 100644
--- a/packages/ui/src/components/rich-text/commands.ts
+++ b/packages/ui/src/components/rich-text/commands.ts
@@ -217,7 +217,24 @@ function codeBlockRule() {
});
}
-/** Input rules for the Markdown list and inline code markers people type, as in Slack or Notion. */
+/**
+ * `**bold**` or `~~strike~~` as its closing marker's last character is typed, which the rule
+ * replaces; as in Markdown, the text can't start or end with a space.
+ */
+function pairRule(marker: "*" | "~", mark: typeof schema.marks.strong) {
+ let m = `\\${marker}`;
+ let pattern = new RegExp(`(?:^|[^${m}])(${m}${m}([^${m}\\s](?:[^${m}]*[^${m}\\s])?)${m}${m})$`);
+ return new InputRule(pattern, (state, match, start, end) => {
+ let from = start + match[0]!.length - match[1]!.length;
+ return state.tr
+ .delete(end - 1, end)
+ .delete(from, from + 2)
+ .addMark(from, end - 3, mark.create())
+ .removeStoredMark(mark);
+ }, { inCodeMark: false });
+}
+
+/** Input rules for the Markdown markers people type, as in Slack or Notion. */
function markdownRules() {
return [
wrappingInputRule(/^\s*([-+*])\s$/, schema.nodes.bullet_list),
@@ -236,6 +253,8 @@ function markdownRules() {
.addMark(from, end - 1, code.create())
.removeStoredMark(code);
}, { inCodeMark: false }),
+ pairRule("*", schema.marks.strong),
+ pairRule("~", schema.marks.strike),
];
}