feat/wp-extract-contract/main #33
@@ -90,7 +90,9 @@ export function listSection(sections, name) {
|
|||||||
|
|
||||||
for (const { line, inFence } of eachLine(sections.get(name))) {
|
for (const { line, inFence } of eachLine(sections.get(name))) {
|
||||||
if (inFence) continue;
|
if (inFence) continue;
|
||||||
const item = line.match(/^\s*(?:[-*+]|\d+\.)\s+(.*)$/);
|
// [\s\S] 而非 . :CRLF 的 body 逐行切開後行尾有 \r,而 . 不吃 \r,
|
||||||
|
// 用 . 會讓整行比不中,清單靜靜變成空的。後面的 trim 再把 \r 修掉。
|
||||||
|
const item = line.match(/^\s*(?:[-*+]|\d+\.)\s+([\s\S]*)$/);
|
||||||
if (!item) continue;
|
if (!item) continue;
|
||||||
|
|
||||||
const text = item[1].replace(/^\[[ xX]\]\s*/, '').trim();
|
const text = item[1].replace(/^\[[ xX]\]\s*/, '').trim();
|
||||||
|
|||||||
Reference in New Issue
Block a user