Mercurial > hgrepos > hgweb.cgi > 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 wrap: on
line diff
--- a/examples/common/default/default.css Fri Feb 02 10:09:49 2018 +0900 +++ b/examples/common/default/default.css Tue Feb 06 11:06:10 2018 +0900 @@ -110,6 +110,8 @@ /* text-shadow: blue 0px 1px; */ } td.repl hr {margin-bottom: -1em;} +td.repl em {color: #a00; text-decoration: underline} +td.repl strong {color: white; background: #00a; padding: 0 0.5ex;} td.repl h2:before {content: "■"; color: #a22;} td.repl h3:before {content: "◆"; color: #a22;} td.repl h4:before {content: "○";}
--- a/s4-funcs.sh Fri Feb 02 10:09:49 2018 +0900 +++ b/s4-funcs.sh Tue Feb 06 11:06:10 2018 +0900 @@ -468,6 +468,12 @@ # {{URL|width}} - <img src="URL" width="width"> # {{{URL}} } - <iframe src="URL"></iframe> # {{{URL|height}} - <iframe src="URL" height="height"></iframe> + # Other Style + # ---- - <hr> (In the beginning of line) + # *Word* - <em>Word</em> + # _Word_ - <em>Word</em> + # **Word** - <strong>Word</strong> + # __Word__ - <strong>Word</strong> _hrefptn="[-A-Za-z0-9,.:;/~_%#&+?=@!]*" _hrefptn="[A-Za-z0-9/~%+?=@!.][^][()<> ]*" # URL should start with ASCII sed -e "s|\[\[\#\([0-9][0-9]*\)\]\]|<a href=\"?aid\1\">#\1</a>|g" \ @@ -483,7 +489,11 @@ -e "s,^#### *\(.*\),<h4>\1</h4>," \ -e "s,^### *\(.*\),<h3>\1</h3>," \ -e "s,^## *\(.*\),<h2>\1</h2>," \ - -e 's,^----*$,<hr>,' + -e 's,^----*$,<hr>,' \ + -e 's,\*\*\([^* |][^*|]*[^ |]\)\*\*,<strong>\1</strong>,g' \ + -e 's,__\([^_ |][^_]*[^ ]\)__,<strong>\1</strong>,g' \ + -e 's,\*\([^* |][^*|]*[^ |]\)\*,<em>\1</em>,g' \ + -e 's,_\([^_ ][^_]*[^ ]\)_,<em>\1</em>,g' } minitbl() { sed -n '