<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Templates on Shiryu NAKANO</title><link>https://shiryu-nakano.github.io/templates/</link><description>Recent content in Templates on Shiryu NAKANO</description><generator>Hugo</generator><language>ja</language><atom:link href="https://shiryu-nakano.github.io/templates/index.xml" rel="self" type="application/rss+xml"/><item><title/><link>https://shiryu-nakano.github.io/templates/toggle-task/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://shiryu-nakano.github.io/templates/toggle-task/</guid><description>&lt;p&gt;&amp;lt;%*
const editor = app.workspace.activeEditor?.editor;
if (!editor) return;&lt;/p&gt;
&lt;p&gt;const cursor = editor.getCursor();
const line = editor.getLine(cursor.line);&lt;/p&gt;
&lt;p&gt;// パターン1: - [ ] テキスト → チェックする
const unchecked = line.match(/^(\s*[-*+]\s+)[ ]\s+(.+)$/);
if (unchecked) {
const [, prefix, text] = unchecked;
const ts = window.moment().format(&amp;ldquo;YYYY-MM-DD HH:mm&amp;rdquo;);
editor.setLine(cursor.line, &lt;code&gt;${prefix}[X] ~~*${text}*~~ [${ts}]&lt;/code&gt;);
return;
}&lt;/p&gt;
&lt;p&gt;// パターン2: - [X] &lt;del&gt;&lt;em&gt;テキスト&lt;/em&gt;&lt;/del&gt; [日時] → アンチェックして元に戻す
const checked = line.match(/^(\s*[-&lt;em&gt;+]\s+)[[Xx]]\s+&lt;del&gt;*(.+?)*&lt;/del&gt;\s&lt;/em&gt;[\d{4}-\d{2}-\d{2} \d{2}:\d{2}]\s*$/);
if (checked) {
const [, prefix, text] = checked;
editor.setLine(cursor.line, &lt;code&gt;${prefix}[ ] ${text}&lt;/code&gt;);
return;
}&lt;/p&gt;</description></item></channel></rss>