diff --git a/decode.rkt b/decode.rkt index 8186e73..c242b4c 100644 --- a/decode.rkt +++ b/decode.rkt @@ -55,6 +55,10 @@ '(p "\n" "foo" "\n\n" "bar" (em "\n\n\n")))) +(define block-names block-tags) +(define (register-block-name tag) + (set! block-names (cons tag block-names))) + ;; is the named-xexpr a block element (as opposed to inline) (define/contract (block-xexpr? x) (any/c . -> . boolean?) @@ -63,7 +67,7 @@ ;; todo: make sure this is what I want. ;; this is, however, more consistent with browser behavior ;; (browsers assume that tags are inline by default) - ((named-xexpr? x) . and . (->boolean ((named-xexpr-name x) . in . block-tags)))) + ((named-xexpr? x) . and . (->boolean ((named-xexpr-name x) . in . block-names)))) (module+ test (check-true (block-xexpr? '(p "foo"))) diff --git a/tests/pollen-lang-test.p b/tests/pollen-lang-test.p index c1fbdec..23c514b 100644 --- a/tests/pollen-lang-test.p +++ b/tests/pollen-lang-test.p @@ -2,7 +2,7 @@ ◊meta["metakey" "metavalue"] -Hello world +◊boqi{Hello world} ◊em{Love} diff --git a/tests/requires/include-me.rkt b/tests/requires/include-me.rkt index ff36178..5678b75 100644 --- a/tests/requires/include-me.rkt +++ b/tests/requires/include-me.rkt @@ -6,6 +6,8 @@ (module+ test (require rackunit)) +(register-block-name 'boqi) + ;; todo: contracts & unit tests (define/contract (meta-proc meta) (meta-xexpr? . -> . named-xexpr?)