Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 13
- Log:
Initial import of Typo 2.6.0 sources from a downloaded Tarball.
Typo is a Ruby On Rails based blog engine.
- Author:
- adh
- Date:
- Sat Jul 22 22:25:02 +0100 2006
- Size:
- 957 Bytes
1 | def nofollowify(text) |
2 | text.gsub(/<\s*a\s*(.+?)>/i, '<a \1 rel="nofollow">') |
3 | end |
4 | |
5 | def strip_html(text) |
6 | attribute_key = /[\w:_-]+/ |
7 | attribute_value = /(?:[A-Za-z0-9]+|(?:'[^']*?'|"[^"]*?"))/ |
8 | attribute = /(?:#{attribute_key}(?:\s*=\s*#{attribute_value})?)/ |
9 | attributes = /(?:#{attribute}(?:\s+#{attribute})*)/ |
10 | tag_key = attribute_key |
11 | tag = %r{<[!/?\[]?(?:#{tag_key}|--)(?:\s+#{attributes})?\s*(?:[!/?\]]+|--)?>} |
12 | text.gsub(tag, '').gsub(/\s+/, ' ').strip |
13 | end |
14 | |
15 | class String |
16 | # Converts a post title to its-title-using-dashes |
17 | # All special chars are stripped in the process |
18 | def to_url |
19 | return if self.nil? |
20 | |
21 | result = self.downcase |
22 | |
23 | # replace quotes by nothing |
24 | result.gsub!(/['"]/, '') |
25 | |
26 | # strip all non word chars |
27 | result.gsub!(/\W/, ' ') |
28 | |
29 | # replace all white space sections with a dash |
30 | result.gsub!(/\ +/, '-') |
31 | |
32 | # trim dashes |
33 | result.gsub!(/(-)$/, '') |
34 | result.gsub!(/^(-)/, '') |
35 | |
36 | result |
37 | end |
38 | end |