content

changeset 143:c247de348768 trunk tip

added blog2 filter (++sanity;)
author Thomas Jollans <thomas@jollans.com>
date Sat Sep 15 18:12:07 2007 +0200 (2007-09-15)
parents 92c5a5e0d15f
children
files meta/mod.content/filters.yaml
line diff
     1.1 --- a/meta/mod.content/filters.yaml	Fri Aug 24 15:36:52 2007 +0200
     1.2 +++ b/meta/mod.content/filters.yaml	Sat Sep 15 18:12:07 2007 +0200
     1.3 @@ -1,8 +1,20 @@
     1.4  xhtml:
     1.5      raw:
     1.6      - [ "", "" ]
     1.7 -    blog:
     1.8 +    blog: # this should never have been introduced as such...
     1.9      - [ '(\r\n|\r|\n)\1', '<br/>\1']
    1.10 +    blog2: # cooler blog format
    1.11 +    # use paragraphs
    1.12 +    - [ '^', '<p>' ]
    1.13 +    - [ '$', '</p>' ]
    1.14 +    # newline handling
    1.15 +    - [ '(\r\n|\r|\n)\1', '</p><p>\1']
    1.16 +    - [ '(\r\n|\r|\n)', '<br/>\1']
    1.17 +    # url handling
    1.18 +    - [ '(\s|^)(http|ftp)(://[^\s:]+)', '\1<a href="\2\3">\2\3</a>' ]
    1.19 +    - [ '(\s|^)(www\.[^\s/]+\.[a-zA-Z]{2,4}(/[^\s/]*)*)', '\1<a href="http://\2">\2</a>' ]
    1.20 +    - [ '(\s|^)(ftp\.[^\s/]+\.[a-zA-Z]{2,4}(/[^\s/]*)*)', '\1<a href="ftp://\2">\2</a>' ]
    1.21 +    - [ '(\s|^)([a-zA-Z0-9.]+@[a-zA-Z0-9.]+\.[a-zA-Z]{2,4})', '\1<a href="mailto:\2">\2</a>' ]
    1.22      bbcode:
    1.23      - [ "&", "&amp;"]
    1.24      - [ "<", "&lt;" ]