Mercurial > hgrepos > hgweb.cgi > s4
changeset 941:79c7e64884c4 draft
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 wrap: on
line diff
--- a/s4-funcs.sh Thu Sep 09 07:42:36 2021 +0900 +++ b/s4-funcs.sh Wed Sep 22 08:39:36 2021 +0900 @@ -683,7 +683,7 @@ miniul() { sed -e ' /^\* / {; # 行頭 "* " - x; s,^,<ul>,; x; # 1週目: ホールドスペース先頭に <ul> を + x; s,^,<ul>,; x; # 1周目: ホールドスペース先頭に <ul> を :top s/\n//; s/^ *//; # 2周目以降: 行頭空白削除 @@ -713,14 +713,15 @@ miniol() { sed -e ' /^[1-9]\. / {; # 行頭 "N. " - x; s,^,<ol>,; x; # 1週目: ホールドスペース先頭に <ol> を + h;x; # 1周目: ホールドスペース先頭に <ol> を + s,^\([1-9][0-9]*\)\. .*,<ol start="\1">,; # 初期番号付きで追加 + x; :top s/\n//; s/^ *//; # 2周目以降: 行頭空白削除 H; # 置き換え結果をホールドスペースに追加 x; - s,^<ol>\n\([1-9][0-9]*\)\. ,<ol start="\1"><li>,; # 1行目のみ - s,[1-9][0-9]*\. ,,; # まず行頭の "N. " を消しておく + s,[1-9][0-9]*\. ,,; # まず行頭の "N. " を消しておく x; s/.*//; # パターンスペースは消しておく # ↓最終行なら残ったホールドスペース処理のため :cont へ