Changeset 14907 in project


Ignore:
Timestamp:
06/06/09 16:12:39 (11 years ago)
Author:
azul
Message:

Adding svnwiki-xml-escape.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/3/svnwiki-extensions/trunk/svnwiki-extensions-support-base.scm

    r14033 r14907  
    2323                 svnwiki-list-parents
    2424                 svnwiki-create-add-parents
    25                  svnwiki-path-canonical))
    26 
    27 (use posix format-modular embedded-test srfi-1)
     25                 svnwiki-path-canonical
     26                 svnwiki-xml-escape))
     27
     28(use posix format-modular embedded-test srfi-1 srfi-40 stream-ext)
    2829
    2930(define *svnwiki-extensions* (make-hash-table))
     
    339340          (string-split (if (string? path) path (stream->string path)) "/")))
    340341      "/")))
     342
     343(define (svnwiki-xml-escape string)
     344  (stream->string
     345    (stream-fold-right-delay
     346      (lambda (c rest)
     347        (case c
     348          ((#\') (->stream-char "'" rest))
     349          (else (stream-cons c rest))))
     350      stream-null
     351      (string->stream string))))
     352
     353(test-group svnwiki-xml-escape
     354  (test (svnwiki-xml-escape "Alejo's Test") "Alejo's Test"))
Note: See TracChangeset for help on using the changeset viewer.