1197
1197
(preprocess-aux x (+ end 2) xl context topics-fal base-pkg kpa state acc)))
1199
1199
((when (and (< (+ n 2) xl)
1200
(or (eql (char x (+ n 2)) #\[)
1201
(eql (char x (+ n 2)) #\$))))
1202
;; @([...]) directive -- turns into <math> block
1203
;; @($...$) directive -- turns into a <mathfrag> block
1204
(b* ((fragp (eql (char x (+ n 2)) #\$))
1205
(end (str::strpos-fast (if fragp "$)" "])")
1207
2 ;; length of string we're looking for
1210
(prog2$ (and (xdoc-verbose-p)
1212
(cw "; xdoc error in ~x0: no closing $) found for @($ ...~%" context)
1213
(cw "; xdoc error in ~x0: no closing ]) found for @([ ...~%" context)))
1215
(sub (subseq x (+ n 3) end))
1216
(acc (str::revappend-chars (if fragp "<mathfrag>" "<math>") acc))
1217
;; Unlike @('...') we don't want to try to automatically insert hyperlinks, as
1218
;; that would very likely totally screw up katex.
1219
(acc (simple-html-encode-str sub 0 (length sub) acc))
1220
(acc (str::revappend-chars (if fragp "</mathfrag>" "</math>") acc)))
1221
(preprocess-aux x (+ end 2) xl context topics-fal base-pkg kpa state acc)))
1223
((when (and (< (+ n 2) xl)
1200
1224
(eql (char x (+ n 2)) #\`)))
1201
1225
;; @(`...`) directive -- Lisp evaluation of the form.
1202
1226
(b* ((end (str::strpos-fast "`)" x (+ n 2) 2 xl))