#lang racket/base (require racket/dict racket/function racket/match racket/string "pure-utils.rkt" "url-utils.rkt" "xexpr-utils.rkt") (provide preprocess-html-wiki update-tree-wiki) (define (preprocess-html-wiki html) (regexp-replace* #rx"(<(?:td|figcaption)[^>]*?>\n?)(?:
  • |[ \t]*?

    (.*?)

    )" html (λ (whole first-tag [contents #f]) (if (eq? (string-ref whole 1) #\f) ;; figcaption (string-append first-tag "" contents "") (string-append first-tag "