mirror of
https://github.com/wth461694678/text-block-timer.git
synced 2026-07-22 05:46:04 +00:00
fix regex parser
This commit is contained in:
parent
a8dbaafc4e
commit
1fce93378a
1 changed files with 2 additions and 2 deletions
4
main.js
4
main.js
|
|
@ -14,7 +14,7 @@ class TimerRenderer {
|
|||
.substr(11, 8);
|
||||
const colorStyle =
|
||||
timerData.Status === 'Running' ? 'style="color: #10b981;"' : '';
|
||||
return `<span class="timer-btn" timerId="${timerData.timerId}" Status="${timerData.Status}" AccumulatedTime="${timerData.AccumulatedTime}" currentStartTimeStamp="${timerData.currentStartTimeStamp}" lineId="${timerData.lineId}" ${colorStyle}> 【⏳${formatted} 】 </span>`;
|
||||
return `<span class="timer-btn" timerId="${timerData.timerId}" Status="${timerData.Status}" AccumulatedTime="${timerData.AccumulatedTime}" currentStartTimeStamp="${timerData.currentStartTimeStamp}" lineId="${timerData.lineId}" ${colorStyle}>【⏳${formatted} 】 </span>`;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -273,7 +273,7 @@ class TimerPlugin extends obsidian.Plugin {
|
|||
|
||||
// Check for markdown checkbox or list patterns after indentation
|
||||
const afterIndent = lineText.slice(indentLen);
|
||||
const checkboxMatch = /^([+\-*]\s\[[ x]\]|\s*[-+*]\s)/.exec(afterIndent);
|
||||
const checkboxMatch = /^([+\-*]\s\[[^\]]\]\s+|\s*[-+*]\s+)/.exec(afterIndent);
|
||||
const checkboxLen = checkboxMatch ? checkboxMatch[1].length : 0;
|
||||
|
||||
before = after = indentLen + checkboxLen;
|
||||
|
|
|
|||
Loading…
Reference in a new issue