aboutsummaryrefslogtreecommitdiff
path: root/md.bqn
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2020-08-19 21:34:57 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2020-08-19 21:34:57 -0400
commitfd9c676785ce42ebb6878f30de9bf3ee1f476ac1 (patch)
tree1d8ab45de04935c6a747cf69a3416ee87b368bf8 /md.bqn
parenta6d64a40e880b13f094f4da300d4243d1aedab57 (diff)
Escape double quotes in strings when formatting
Diffstat (limited to 'md.bqn')
-rw-r--r--md.bqn4
1 files changed, 3 insertions, 1 deletions
diff --git a/md.bqn b/md.bqn
index 6f7fc6de..874aa403 100644
--- a/md.bqn
+++ b/md.bqn
@@ -558,7 +558,9 @@ Fmt ← {
((≠(0⊸<+≤)+´)⥊num)◶{
# All characters
k ← -≠ c ← ¯1↓≢𝕩
- (r Enframe 1 PadH PadV)⍟(1≠r) ≍ (c↑'"') ∾⎉k 𝕩 ∾⎉k ⌽⌾⥊c↑'"'
+ q ← '"'
+ 𝕩 ↩ (1+q=⊢)⊸/⍟(k=0) 𝕩
+ (r Enframe 1 PadH PadV)⍟(1≠r) ≍ (c↑q) ∾⎉k 𝕩 ∾⎉k ⌽⌾⥊c↑q
}‿{
# Not homogeneous, or empty
(∨´0=≢)◶FmtMixed‿FmtEmpty 𝕩