Spaces:
Running
Running
字下げボタン追加
Browse files- index.html +5 -8
index.html
CHANGED
|
@@ -455,17 +455,14 @@
|
|
| 455 |
continue;
|
| 456 |
}
|
| 457 |
|
| 458 |
-
//
|
| 459 |
const startsWithBracket = /^[「『(\((【〔[{]/.test(line);
|
|
|
|
| 460 |
|
| 461 |
-
//
|
| 462 |
-
|
| 463 |
-
// 感嘆符の組み合わせ(!?、!!、?!など)も考慮
|
| 464 |
-
const isNewParagraph = (i === 0) ||
|
| 465 |
-
(processedLines[i - 1] === '') ||
|
| 466 |
-
/[。?!♡♥❤]([!?!?♡♥❤])*$/.test(processedLines[i - 1]);
|
| 467 |
|
| 468 |
-
if (isNewParagraph && !startsWithBracket) {
|
| 469 |
// 段落の最初の行には全角スペース1文字分の字下げを追加
|
| 470 |
processedLines.push(' ' + line);
|
| 471 |
} else {
|
|
|
|
| 455 |
continue;
|
| 456 |
}
|
| 457 |
|
| 458 |
+
// 括弧類やMarkdown見出しで始まる行は字下げしない
|
| 459 |
const startsWithBracket = /^[「『(\((【〔[{]/.test(line);
|
| 460 |
+
const startsWithMarkdownHeader = /^#+/.test(line);
|
| 461 |
|
| 462 |
+
// 段落の開始を判定(常にtrue)
|
| 463 |
+
const isNewParagraph = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 464 |
|
| 465 |
+
if (isNewParagraph && !startsWithBracket && !startsWithMarkdownHeader) {
|
| 466 |
// 段落の最初の行には全角スペース1文字分の字下げを追加
|
| 467 |
processedLines.push(' ' + line);
|
| 468 |
} else {
|