| #lang racket |
| (require racket/string sxml) |
| (define (remove-markup xml-port) |
| (let* ((parser |
| (ssax:make-parser NEW-LEVEL-SEED remove-markup-nls |
| FINISH-ELEMENT remove-markup-fe |
| CHAR-DATA-HANDLER remove-markup-cdh)) |
| (strings (parser xml-port null))) |
| (string-join (reverse strings) ""))) |
| (define (remove-markup-nls gi attributes namespaces expected-content |
| seed) |
| seed) |
| (define (remove-markup-fe gi attributes namespaces parent-seed seed) |
| seed) |
| (define (remove-markup-cdh string-1 string-2 seed) |
| (let ((seed (cons string-1 seed))) |
| (if (non-empty-string? string-2) |
| (cons string-2 seed) |
| seed))) |
| (remove-markup |
| (open-input-string |
| "<foo>Hell<bar>o, world!</bar></foo>")) |
It (kinda) works for me. You should make sure that debugging is enabled in the language setting (it should display something like “Language: racket, with debugging [custom]” in the REPL). Then, click “Debug” and then click “Step” for a couple of times (seven to be precise). The little green triangular arrow should then appear at
--
You received this message because you are subscribed to the Google Groups "Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to racket-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/CAJ98PDxXRHuH47tUBSUe1PLeywAY0fRN1Y4w6kn8mubLUt0HWw%40mail.gmail.com.
It (kinda) works for me. You should make sure that debugging is enabled in the language setting (it should display something like “Language: racket, with debugging [custom]” in the REPL). Then, click “Debug” and then click “Step” for a couple of times (seven to be precise). The little green triangular arrow should then appear at
(remove-markup (open-input-string "<foo>Hell<bar>o, world!</bar></foo>"))