Skip to content

Commit

Permalink
Fix failure to import html snippet from Zhihu
Browse files Browse the repository at this point in the history
  • Loading branch information
da-liii committed Sep 24, 2024
1 parent 5991e9b commit e61bfee
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions progs/convert/data/xmltm.scm
Original file line number Diff line number Diff line change
Expand Up @@ -117,18 +117,19 @@
(define (ns-import-name env use-default? name)
(receive (ns-id ncname) (sxml-split-name name)
(let ((ns-uri (cond (ns-id (environment-ref* env (string->symbol ns-id)))
(use-default? (environment-ref env *default*))
(else ""))))
(use-default? (environment-ref env *default*))
(else ""))))
(string-append
;; FIXME: user namespace prefix list should be extensible
(cond ((== ns-uri xmlns-uri-xhtml) "h:")
((== ns-uri xmlns-uri-mathml) "m:")
((== ns-uri xmlns-uri-gallina) "g:")
((== ns-uri xmlns-uri-coqml) "c:")
((== ns-uri xmlns-uri-xml) "x:")
((string-null? ns-uri) "")
(else (string-append ns-uri ":")))
ncname))))
;; FIXME: user namespace prefix list should be extensible
(cond ((== ns-uri xmlns-uri-xhtml) "h:")
((== ns-uri xmlns-uri-mathml) "m:")
((== ns-uri xmlns-uri-gallina) "g:")
((== ns-uri xmlns-uri-coqml) "c:")
((== ns-uri xmlns-uri-xml) "x:")
((string-null? ns-uri) "")
((not (string? ns-uri)) "")
(else (string-append ns-uri ":")))
ncname))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; htmltm environment
Expand Down

0 comments on commit e61bfee

Please sign in to comment.