Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 15
- Log:
Attempt to update Typo to a Typo SVN HEAD release from around the
time the prototype installation was set up on the RISC OS Open Limited
web site. Timestamps place this at 04-Jul so a revision from 05-Jul or
earlier was pulled and copied over the 2.6.0 tarball stable code.
- Author:
- adh
- Date:
- Sat Jul 22 23:27:35 +0100 2006
- Size:
- 948 Bytes
1 | class String |
2 | # Returns a-string-with-dashes when passed 'a string with dashes'. |
3 | # All special chars are stripped in the process |
4 | def to_url |
5 | return if self.nil? |
6 | |
7 | self.downcase.tr("\"'", '').gsub(/\W/, ' ').strip.tr_s(' ', '-').tr(' ', '-').sub(/^$/, "-") |
8 | end |
9 | |
10 | # A quick and dirty fix to add 'nofollow' to any urls in a string. |
11 | # Decidedly unsafe, but will have to do for now. |
12 | def nofollowify |
13 | self.gsub(/<\s*a\s*(.+?)>/i, '<a \1 rel="nofollow">') |
14 | end |
15 | |
16 | # Strips any html markup from a string |
17 | TYPO_TAG_KEY = TYPO_ATTRIBUTE_KEY = /[\w:_-]+/ |
18 | TYPO_ATTRIBUTE_VALUE = /(?:[A-Za-z0-9]+|(?:'[^']*?'|"[^"]*?"))/ |
19 | TYPO_ATTRIBUTE = /(?:#{TYPO_ATTRIBUTE_KEY}(?:\s*=\s*#{TYPO_ATTRIBUTE_VALUE})?)/ |
20 | TYPO_ATTRIBUTES = /(?:#{TYPO_ATTRIBUTE}(?:\s+#{TYPO_ATTRIBUTE})*)/ |
21 | TAG = %r{<[!/?\[]?(?:#{TYPO_TAG_KEY}|--)(?:\s+#{TYPO_ATTRIBUTES})?\s*(?:[!/?\]]+|--)?>} |
22 | def strip_html |
23 | self.gsub(TAG, '').gsub(/\s+/, ' ').strip |
24 | end |
25 | |
26 | end |