Commit 4865a129d5e747c50789ff36627e03e433c8edf5
- Diff rendering mode:
- inline
- side by side
coefficient.rb
(1 / 1)
|   | |||
| 88 | 88 | new.gsub!(/(^|\s)#(?:(?!39;)([A-Za-z0-9_\-]+|\.(?!\z|\s)))/, '\1#<a href="http://identi.ca/tag/\2">\2</a>') | |
| 89 | 89 | ||
| 90 | 90 | # group regexp in laconica is /(?:^|\s)!([A-Za-z0-9]{1,64}) | |
| 91 | new.gsub!(/(?:!(\S+))/, '!<a href="http://identi.ca/group/ | ||
| 91 | new.gsub!(/(?:!([A-Za-z0-9]+))/, '!<a href="http://identi.ca/group/ | ||
| 92 | 92 | ||
| 93 | 93 | return new | |
| 94 | 94 | end |
tests/unit.rb
(7 / 0)
|   | |||
| 142 | 142 | end | |
| 143 | 143 | end | |
| 144 | 144 | ||
| 145 | ['.', ',', '#', '?'].each do |char| | ||
| 146 | should "correctly parse group names ending in #{char}" do | ||
| 147 | assert_equal %Q(leading !<a href="http://identi.ca/group/group">group</a>#{char} end), | ||
| 148 | identicaify("leading !group#{char} end") | ||
| 149 | end | ||
| 150 | end | ||
| 151 | |||
| 145 | 152 | should "not turn ' into a link" do | |
| 146 | 153 | assert_equal %q(' #<a href="http://identi.ca/tag/stuff">stuff</a>), | |
| 147 | 154 | identicaify("' #stuff") |

