diff options
| author | hukl <contact@smyck.org> | 2009-03-05 23:06:22 +0100 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2009-03-05 23:06:22 +0100 |
| commit | a18af410830f9afbc963ec9e0252c29cda53a9da (patch) | |
| tree | 9691451f66b61342273c975a733210ac1615f490 /lib | |
| parent | 0b25143176eaf35b6760a64f673aca38883a350f (diff) | |
get rid of the stupid entities. its the 21st century baby. unicode is widely available already! except for windows
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/tasks/development_init.rake | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/tasks/development_init.rake b/lib/tasks/development_init.rake index 22553fc..d3c8aff 100644 --- a/lib/tasks/development_init.rake +++ b/lib/tasks/development_init.rake | |||
| @@ -58,4 +58,25 @@ namespace :cccms do | |||
| 58 | 58 | ||
| 59 | n.publish_draft! | 59 | n.publish_draft! |
| 60 | end | 60 | end |
| 61 | |||
| 62 | desc "Convert Entities to real charactes" | ||
| 63 | task :convert_entities => :environment do |t| | ||
| 64 | Page.all.each do |page| | ||
| 65 | if page.body | ||
| 66 | puts ">> #{page.id} -- #{page.node.unique_name if page.node}" | ||
| 67 | tmp_body = page.body.dup | ||
| 68 | tmp_body.gsub!(/ä/, "ä") | ||
| 69 | tmp_body.gsub!(/ö/, "ö") | ||
| 70 | tmp_body.gsub!(/ü/, "ü") | ||
| 71 | tmp_body.gsub!(/Ä/, "ä") | ||
| 72 | tmp_body.gsub!(/Ö/, "ö") | ||
| 73 | tmp_body.gsub!(/Ü/, "ü") | ||
| 74 | tmp_body.gsub!(/ß/, "ß") | ||
| 75 | tmp_body.gsub!(/ /, " ") | ||
| 76 | tmp_body.gsub!(/–/, "–") | ||
| 77 | page.body = tmp_body | ||
| 78 | page.save | ||
| 79 | end | ||
| 80 | end | ||
| 81 | end | ||
| 61 | end \ No newline at end of file | 82 | end \ No newline at end of file |
