]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/help/syntax/syntax.factor
help.syntax: only allow help.markup $words
[factor.git] / basis / help / syntax / syntax.factor
index ba658aa3fb692f75e246e7a66234312744d0527a..b45bfd3ee7904d070d9e67e4e4195902feb42d61 100644 (file)
@@ -17,7 +17,7 @@ DEFER: HELP{
     ?scan-token dup {
         [ "{" = [ \ HELP{ ] [ f ] if ]
         [ "syntax" lookup-word ]
-        [ "help.markup" lookup-word ]
+        [ { [ "$" head? ] [ "help.markup" lookup-word ] } 1&& ]
         [ dup ?last ":{[(/\"" member-eq? [ search ] [ drop f ] if ]
     } 1|| {
         { [ dup not ] [ drop ] }
@@ -91,7 +91,7 @@ DEFER: HELP{
 
 : trim-whitespace ( seq -- seq' )
     dup rest-slice dup whitespace
-    [ '[ _ bound tail ] map! ] unless-zero drop
+    [ '[ _ index-or-length tail ] map! ] unless-zero drop
     0 over [ [ blank? ] trim-head ] change-nth ;
 
 : code-lines ( str -- seq )