Skip to content

Instantly share code, notes, and snippets.

Created April 22, 2015 08:53
Show Gist options
  • Save anonymous/b1c756780c2f34518585 to your computer and use it in GitHub Desktop.
Save anonymous/b1c756780c2f34518585 to your computer and use it in GitHub Desktop.
require 'nokogiri'
test = Nokogiri::HTML('
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
priority: Sofort
<br>
das ist nur ein test<br>
<br>
blub<br>
<br>
schwups<br>
<br>
bla<br>
<br>
</body>
</html>
').text
test.gsub!(/^\s+/, '')
test.gsub!(/\s+$/, '')
puts test
root@wiki:/srv/data/redmineKautBullinger/test/html# ruby html.rb
priority: Sofort
das ist nur ein test
blub
schwups
bla
root@wiki:/srv/data/redmineKautBullinger/test/html#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment