From 1f41b6c138ace107bd01c09d92dbf32133b1682c Mon Sep 17 00:00:00 2001 From: Autumn! Date: Thu, 7 Jul 2022 14:41:46 +0100 Subject: [PATCH] doc-format no longer detects other modes within code blocks --- src/boot/boot.janet | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/boot/boot.janet b/src/boot/boot.janet index ae6415c5..23ddb04e 100644 --- a/src/boot/boot.janet +++ b/src/boot/boot.janet @@ -3141,16 +3141,18 @@ (def b (get line i)) (cond (or (= b (chr "\n")) (= b (chr " "))) (endtoken) - (= b (chr `\`)) (do - (++ token-length) - (buffer/push token (get line (++ i)))) - (= b (chr "_")) (delim :underline) (= b (chr "`")) (delim :code) - (= b (chr "*")) - (if (= (chr "*") (get line (+ i 1))) - (do (++ i) - (delim :bold)) - (delim :italics)) + (not (modes :code)) (cond + (= b (chr `\`)) (do + (++ token-length) + (buffer/push token (get line (++ i)))) + (= b (chr "_")) (delim :underline) + (= b (chr "*")) + (if (= (chr "*") (get line (+ i 1))) + (do (++ i) + (delim :bold)) + (delim :italics)) + (do (++ token-length) (buffer/push token b))) (do (++ token-length) (buffer/push token b)))) (endtoken) (tuple/slice tokens))