about summary refs log tree commit diff stats
path: root/prototypes
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-06-06 15:53:15 -0700
committerKartik Agaram <vc@akkartik.com>2020-06-06 15:53:15 -0700
commitd7394beca661cb55767a434ced4997807abe9290 (patch)
tree1741506a0a0a2916fd898a0b38fee276a64d57b6 /prototypes
parentfb778c1d86df966a159427459a7d9315ae0c63a3 (diff)
downloadmu-d7394beca661cb55767a434ced4997807abe9290.tar.gz
6497
Diffstat (limited to 'prototypes')
-rw-r--r--prototypes/browse/29/main.mu48
1 files changed, 29 insertions, 19 deletions
diff --git a/prototypes/browse/29/main.mu b/prototypes/browse/29/main.mu
index b12ddc34..747de544 100644
--- a/prototypes/browse/29/main.mu
+++ b/prototypes/browse/29/main.mu
@@ -100,25 +100,35 @@ $render-normal:flush-buffered-newline: {
         }
         ## end soft newline support
 
-        # if (c == '*') switch to bold
-        compare c, 0x2a  # '*'
-        {
-          break-if-!=
-          start-bold
-            render-until-asterisk fs, state
-          normal-text
-          break $render-normal:loop-body
-        }
-        # if (c == '_') switch to bold
-        compare c, 0x5f  # '_'
-        {
-          break-if-!=
-          start-color 0xec, 7  # 236 = darkish gray
-          start-bold
-            render-until-underscore fs, state
-          reset-formatting
-          start-color 0xec, 7  # 236 = darkish gray
-          break $render-normal:loop-body
+$render-normal:whitespace-separated-regions: {
+          # if previous-char wasn't whitespace, skip this block
+          {
+            compare previous-char, 0x20  # space
+            break-if-=
+            compare previous-char, 0xa  # newline
+            break-if-=
+            break $render-normal:whitespace-separated-regions
+          }
+          # if (c == '*') switch to bold
+          compare c, 0x2a  # '*'
+          {
+            break-if-!=
+            start-bold
+              render-until-asterisk fs, state
+            normal-text
+            break $render-normal:loop-body
+          }
+          # if (c == '_') switch to bold
+          compare c, 0x5f  # '_'
+          {
+            break-if-!=
+            start-color 0xec, 7  # 236 = darkish gray
+            start-bold
+              render-until-underscore fs, state
+            reset-formatting
+            start-color 0xec, 7  # 236 = darkish gray
+            break $render-normal:loop-body
+          }
         }
         #
         add-char state, c