Skip to content

Commit

Permalink
Revert: Use theme colors
Browse files Browse the repository at this point in the history
  • Loading branch information
mgmeyers committed Feb 15, 2023
1 parent e556926 commit b9d8663
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "obsidian-list-callouts",
"name": "List Callouts",
"version": "1.1.3",
"version": "1.1.4",
"minAppVersion": "1.1.1",
"description": "Create simple callouts in lists.",
"author": "mgmeyers",
Expand Down
28 changes: 17 additions & 11 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,31 @@ import { buildPostProcessor } from "./postProcessor";

const DEFAULT_SETTINGS: ListCalloutsSettings = [
{
color: "var(--color-yellow-rgb)",
color: "255, 214, 0",
char: "&",
},
{
color: "var(--color-orange-rgb)",
color: "255, 145, 0",
char: "?",
},
{
color: "var(--color-red-rgb)",
color: "255, 23, 68",
char: "!",
},
{
color: "var(--color-purple-rgb)",
color: "124, 77, 255",
char: "~",
},
{
color: "var(--color-blue-rgb)",
color: "0, 184, 212",
char: "@",
},
{
color: "var(--color-green-rgb)",
color: "0, 200, 83",
char: "$",
},
{
color: "var(--callout-quote)",
color: "158, 158, 158",
char: "%",
},
];
Expand Down Expand Up @@ -87,7 +87,9 @@ export default class ListCalloutsPlugin extends Plugin {
return {
...callout,
re: new RegExp(
`(^\\s*[-*+](?: \\[.\\])? |^\\s*\\d+[\\.\\)](?: \\[.\\])? )${escapeStringRegexp(callout.char)} `
`(^\\s*[-*+](?: \\[.\\])? |^\\s*\\d+[\\.\\)](?: \\[.\\])? )${escapeStringRegexp(
callout.char
)} `
),
};
});
Expand All @@ -103,9 +105,13 @@ export default class ListCalloutsPlugin extends Plugin {
}

async loadSettings() {
const loadedSettings = await this.loadData() as Callout[];
const customCallouts = loadedSettings?.filter(callout => callout.custom === true);
const modifiedBuiltins = loadedSettings?.filter(callout => callout.custom !== true);
const loadedSettings = (await this.loadData()) as Callout[];
const customCallouts = loadedSettings?.filter(
(callout) => callout.custom === true
);
const modifiedBuiltins = loadedSettings?.filter(
(callout) => callout.custom !== true
);

this.settings = DEFAULT_SETTINGS.map((s, i) => {
return Object.assign({}, s, modifiedBuiltins ? modifiedBuiltins[i] : {});
Expand Down

0 comments on commit b9d8663

Please sign in to comment.