patch for strict markdown

main
Matthew Butterick 5 years ago
parent cceec34df9
commit 28b58f8c62

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -1,7 +1,5 @@
#lang quadwriter/markdown
```
excl-middl→¬¬-elim : {A : Set} A ¬ A (¬ ¬ A A)
excl-middl→¬¬-elim (inj₁ a) = λ ¬¬a a
excl-middl→¬¬-elim (inj₂ ¬a) = λ ¬¬a ⊥-elim (¬¬a ¬a)
foo
```

@ -8,14 +8,6 @@
#%app #%top #%datum #%top-interaction require
(all-from-out "tags.rkt"))
(define rsquo "")
(define rdquo "")
(define lsquo "")
(define ldquo "")
(define hellip "")
(define ndash "")
(define mdash "")
(define (doc-proc exprs)
(define strs (match exprs
[(? null?) '(" ")] ; single nonbreaking space, so something prints
@ -32,8 +24,7 @@
(module reader racket/base
(require racket/port markdown "lang-helper.rkt")
(provide read-syntax get-info)
(define read-syntax
(make-read-syntax 'quadwriter/markdown
(define read-syntax (make-read-syntax 'quadwriter/markdown
(λ (path-string p) (xexpr->parse-tree
(parameterize ([current-strict-markdown? #true])
(parameterize ([current-strict-markdown? #t])
(parse-markdown (port->string p))))))))

@ -16,16 +16,19 @@
(qexpr attrs exprs))
(define-tag-function (p attrs exprs)
(match exprs
[(cons (? txexpr? tx) _)
#:when (equal? (attr-ref tx :font-family #false) "code")
;; wrap code blocks in `pre` to distinguish them from inline
(apply pre attrs exprs)]
;; no font-family so that it adopts whatever the surrounding family is
(qexpr (append (list->attrs
[_ (qexpr (append (list->attrs
:keep-first-lines "2"
:keep-last-lines "3"
:font-size-adjust "100%"
:hyphenate "true"
:display (symbol->string (gensym)))
attrs) exprs))
(define div p)
attrs) exprs)]))
(define-tag-function (img attrs exprs)
(qexpr (list->attrs
@ -86,6 +89,7 @@
(list->attrs
:font-italic "true"
:font-size-adjust "100%") attrs) exprs))
(define i em)
(define-syntax-rule (attr-list . attrs) 'attrs)

Loading…
Cancel
Save