diff options
| Commit | b0e89cab89f93fd5c1edba5c7e0b775c1a9eff4c (patch) | |
|---|---|---|
| Author | 2024-07-21 09:39:34 +0300 | |
| Committer | 2024-07-21 09:39:34 +0300 | |
| Files | 56c3fa6994f9ef4522dfe8141e5494b8d3c24b79 /single.awk | |
| csg-b0e89cab89f93fd5c1edba5c7e0b775c1a9eff4c.tar csg-b0e89cab89f93fd5c1edba5c7e0b775c1a9eff4c.tar.gz csg-b0e89cab89f93fd5c1edba5c7e0b775c1a9eff4c.zip | ||
| Parent | c5de9e6a21c495241249962b87bca0b4b5d39248 (diff) | |
(single) Roughly implemented emphasis
1 files changed, 27 insertions, 1 deletions
| -rw-r--r-- | single.awk | 28 |
@@ -11,7 +11,7 @@ # [x] Horizontal rules # [ ] Span elements # [ ] Links -# [ ] Emphasis +# [x] Emphasis # [ ] Code # [ ] Images # [ ] Other @@ -108,6 +108,32 @@ blankline { gsub(/</, "\\<") } +# Emphasis +/__.+__/ { + while (match($0, /__/)) { + sub(/__/, "<strong>") + sub(/__/, "</strong>") + } +} +/\*\*.+\*\*/ { + while (match($0, /\*\*/)) { + sub(/\*\*/, "<strong>") + sub(/\*\*/, "</strong>") + } +} +/_[^_].+_/ { + while (match($0, /_/)) { + sub(/_/, "<em>") + sub(/_/, "</em>") + } +} +/\*[^_].+\*/ { + while (match($0, /\*/)) { + sub(/\*/, "<em>") + sub(/\*/, "</em>") + } +} + { print } END { |
