diff options
author | Marc Fonvieille <blackend@FreeBSD.org> | 2004-12-17 09:46:08 +0000 |
---|---|---|
committer | Marc Fonvieille <blackend@FreeBSD.org> | 2004-12-17 09:46:08 +0000 |
commit | e189cd5d77db20bf07018c88ac5565aa39145a13 (patch) | |
tree | 2770fb7a750d7a5380cf7f86d8effd6da63f1c4e /share/sgml/freebsd.dsl | |
parent | 59e334b2ac836062aaf04cf0b8486b81258921ad (diff) | |
download | doc-e189cd5d77db20bf07018c88ac5565aa39145a13.tar.gz doc-e189cd5d77db20bf07018c88ac5565aa39145a13.zip |
Enhance email element: do not render with "mailto:" when nolink role
attribute is used or when the email address matches
@example.{com|net|org}
Discussed with: murray, nik and hrs
Notes
Notes:
svn path=/head/; revision=23249
Diffstat (limited to 'share/sgml/freebsd.dsl')
-rw-r--r-- | share/sgml/freebsd.dsl | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/share/sgml/freebsd.dsl b/share/sgml/freebsd.dsl index eb4a46d656..f4a0dbacd7 100644 --- a/share/sgml/freebsd.dsl +++ b/share/sgml/freebsd.dsl @@ -243,6 +243,24 @@ (create-link (list (list "HREF" href)) ($mono-seq$)))) (else ($mono-seq$))))) + ;; Do not render email with mailto: when nolink role attribute + ;; is used or when the email address matches + ;; @example.{com|net|org} + (element email + (let* ((class (attribute-string (normalize "role")))) + (cond + ((or (equal? class "nolink") (string=? + (substring (data (current-node)) + (- (string-length (data (current-node))) 11) + (- (string-length (data (current-node))) 4)) "example")) + ($code-seq$ + (make sequence + (literal "<") + (process-children) + (literal ">")))) + (else + (next-match))))) + ;; Ensure that we start with no preferred mediaobject notations, ;; so that in the text-only case we don't choose any of the ;; possible images, and fallback to the most appropriate |