mirror of
https://github.com/playmean/obsidian-event-highlight-plugin.git
synced 2026-07-22 05:44:13 +00:00
feat: new code block type
This commit is contained in:
parent
38a46ab54d
commit
7611eace7a
1 changed files with 7 additions and 7 deletions
14
main.ts
14
main.ts
|
|
@ -12,7 +12,7 @@ declare interface State {
|
|||
}
|
||||
|
||||
export default class EventHighlightPlugin extends Plugin {
|
||||
private attributeStateName = 'data-datey-state';
|
||||
private attributeStateName = 'data-event-highlight-state';
|
||||
|
||||
private loadState(el: Element): State {
|
||||
const stateString = el.getAttribute(this.attributeStateName);
|
||||
|
|
@ -105,11 +105,11 @@ export default class EventHighlightPlugin extends Plugin {
|
|||
const thisWeek = !isUpcoming && !isActual && workStamp.diff(now, 'days') < 7;
|
||||
|
||||
const nextDayFormat = // fragile, but works
|
||||
(
|
||||
moment.localeData() as unknown as {
|
||||
_calendar: Record<string, string>;
|
||||
}
|
||||
)._calendar.nextDay;
|
||||
(
|
||||
moment.localeData() as unknown as {
|
||||
_calendar: Record<string, string>;
|
||||
}
|
||||
)._calendar.nextDay;
|
||||
|
||||
if (thisWeek) {
|
||||
return workStamp
|
||||
|
|
@ -219,7 +219,7 @@ export default class EventHighlightPlugin extends Plugin {
|
|||
}
|
||||
|
||||
async onload() {
|
||||
this.registerMarkdownCodeBlockProcessor('datey', (source, el, ctx) => {
|
||||
this.registerMarkdownCodeBlockProcessor('event-highlight', (source, el, ctx) => {
|
||||
this.renderElement(el, source.trim());
|
||||
|
||||
el.addEventListener('click', () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue