Skip to content

Commit

Permalink
genbook2: simplify html fixup
Browse files Browse the repository at this point in the history
We can handle "gt" and "lt" in a single regex. Not a big
deal for this simple case, but as we add more cases, it will
be nice not to have to repeat ourselves.
  • Loading branch information
peff committed May 6, 2016
1 parent 55f679f commit 6994929
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/tasks/book2.rake
Expand Up @@ -112,8 +112,7 @@ task :genbook2 => :environment do
end
end

html.gsub!(">", ">")
html.gsub!("<", "<")
html.gsub!(%r{&([gl]t);}, '&\1;')

if subsec = html.scan(/<h3>(.*?)<\/h3>/)
subsec.each do |sub|
Expand Down

0 comments on commit 6994929

Please sign in to comment.