summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorhukl <contact@smyck.org>2009-03-05 23:06:22 +0100
committerhukl <contact@smyck.org>2009-03-05 23:06:22 +0100
commita18af410830f9afbc963ec9e0252c29cda53a9da (patch)
tree9691451f66b61342273c975a733210ac1615f490 /lib
parent0b25143176eaf35b6760a64f673aca38883a350f (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.rake21
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!(/&auml;/, "ä")
69 tmp_body.gsub!(/&ouml;/, "ö")
70 tmp_body.gsub!(/&uuml;/, "ü")
71 tmp_body.gsub!(/&Auml;/, "ä")
72 tmp_body.gsub!(/&Ouml;/, "ö")
73 tmp_body.gsub!(/&Uuml;/, "ü")
74 tmp_body.gsub!(/&szlig;/, "ß")
75 tmp_body.gsub!(/&nbsp;/, " ")
76 tmp_body.gsub!(/&ndash;/, "–")
77 page.body = tmp_body
78 page.save
79 end
80 end
81 end
61end \ No newline at end of file 82end \ No newline at end of file