s4
changeset 941:79c7e64884c4
Now miniol can handle continuing line at the first LI.
author | HIROSE Yuuji <yuuji@gentei.org> |
---|---|
date | Wed, 22 Sep 2021 08:39:36 +0900 |
parents | 102c2b14c5d8 |
children | 5d70fa029f8d |
files | s4-funcs.sh |
diffstat | 1 files changed, 5 insertions(+), 4 deletions(-) [+] |
line diff
1.1 --- a/s4-funcs.sh Thu Sep 09 07:42:36 2021 +0900 1.2 +++ b/s4-funcs.sh Wed Sep 22 08:39:36 2021 +0900 1.3 @@ -683,7 +683,7 @@ 1.4 miniul() { 1.5 sed -e ' 1.6 /^\* / {; # 行頭 "* " 1.7 - x; s,^,<ul>,; x; # 1週目: ホールドスペース先頭に <ul> を 1.8 + x; s,^,<ul>,; x; # 1周目: ホールドスペース先頭に <ul> を 1.9 :top 1.10 s/\n//; 1.11 s/^ *//; # 2周目以降: 行頭空白削除 1.12 @@ -713,14 +713,15 @@ 1.13 miniol() { 1.14 sed -e ' 1.15 /^[1-9]\. / {; # 行頭 "N. " 1.16 - x; s,^,<ol>,; x; # 1週目: ホールドスペース先頭に <ol> を 1.17 + h;x; # 1周目: ホールドスペース先頭に <ol> を 1.18 + s,^\([1-9][0-9]*\)\. .*,<ol start="\1">,; # 初期番号付きで追加 1.19 + x; 1.20 :top 1.21 s/\n//; 1.22 s/^ *//; # 2周目以降: 行頭空白削除 1.23 H; # 置き換え結果をホールドスペースに追加 1.24 x; 1.25 - s,^<ol>\n\([1-9][0-9]*\)\. ,<ol start="\1"><li>,; # 1行目のみ 1.26 - s,[1-9][0-9]*\. ,,; # まず行頭の "N. " を消しておく 1.27 + s,[1-9][0-9]*\. ,,; # まず行頭の "N. " を消しておく 1.28 x; 1.29 s/.*//; # パターンスペースは消しておく 1.30 # ↓最終行なら残ったホールドスペース処理のため :cont へ