s4

changeset 485:021e7943fd99

Emphasis pattern *word*, _word_ and strong pattern **word**, __word__
author HIROSE Yuuji <yuuji@gentei.org>
date Tue, 06 Feb 2018 11:06:10 +0900
parents 66189fcd8c0c
children 44b4a45e2617
files examples/common/default/default.css s4-funcs.sh
diffstat 2 files changed, 13 insertions(+), 1 deletions(-) [+]
line diff
     1.1 --- a/examples/common/default/default.css	Fri Feb 02 10:09:49 2018 +0900
     1.2 +++ b/examples/common/default/default.css	Tue Feb 06 11:06:10 2018 +0900
     1.3 @@ -110,6 +110,8 @@
     1.4      /* text-shadow: blue 0px 1px; */
     1.5  }
     1.6  td.repl hr {margin-bottom: -1em;}
     1.7 +td.repl em {color: #a00; text-decoration: underline}
     1.8 +td.repl strong {color: white; background: #00a; padding: 0 0.5ex;}
     1.9  td.repl h2:before {content: "■"; color: #a22;}
    1.10  td.repl h3:before {content: "◆"; color: #a22;}
    1.11  td.repl h4:before {content: "○";}
     2.1 --- a/s4-funcs.sh	Fri Feb 02 10:09:49 2018 +0900
     2.2 +++ b/s4-funcs.sh	Tue Feb 06 11:06:10 2018 +0900
     2.3 @@ -468,6 +468,12 @@
     2.4    #   {{URL|width}}	- <img src="URL" width="width">
     2.5    #   {{{URL}}	}	- <iframe src="URL"></iframe>
     2.6    #   {{{URL|height}}	- <iframe src="URL" height="height"></iframe>
     2.7 +  # Other Style
     2.8 +  #   ----		- <hr> (In the beginning of line)
     2.9 +  #   *Word*		- <em>Word</em>
    2.10 +  #   _Word_		- <em>Word</em>
    2.11 +  #   **Word**		- <strong>Word</strong>
    2.12 +  #   __Word__		- <strong>Word</strong>
    2.13    _hrefptn="[-A-Za-z0-9,.:;/~_%#&+?=@!]*"
    2.14    _hrefptn="[A-Za-z0-9/~%+?=@!.][^][()<> ]*"	# URL should start with ASCII
    2.15    sed -e "s|\[\[\#\([0-9][0-9]*\)\]\]|<a href=\"?aid\1\">#\1</a>|g" \
    2.16 @@ -483,7 +489,11 @@
    2.17        -e "s,^#### *\(.*\),<h4>\1</h4>," \
    2.18        -e "s,^### *\(.*\),<h3>\1</h3>," \
    2.19        -e "s,^## *\(.*\),<h2>\1</h2>," \
    2.20 -      -e 's,^----*$,<hr>,'
    2.21 +      -e 's,^----*$,<hr>,' \
    2.22 +      -e 's,\*\*\([^* |][^*|]*[^ |]\)\*\*,<strong>\1</strong>,g' \
    2.23 +      -e 's,__\([^_ |][^_]*[^ ]\)__,<strong>\1</strong>,g' \
    2.24 +      -e 's,\*\([^* |][^*|]*[^ |]\)\*,<em>\1</em>,g' \
    2.25 +      -e 's,_\([^_ ][^_]*[^ ]\)_,<em>\1</em>,g'
    2.26  }
    2.27  minitbl() {
    2.28    sed -n '