Skip to content

Commit

Permalink
Remove <p> tags from <li> tags.
Browse files Browse the repository at this point in the history
They look terrible on the kindle.
  • Loading branch information
eee-c committed Aug 3, 2011
1 parent 6641024 commit fb372e0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/git-scribe/generate.rb
Expand Up @@ -99,11 +99,19 @@ def do_html
styledir = local('stylesheets')
cmd = "asciidoc -a stylesdir=#{styledir} -a theme=scribe #{BOOK_FILE}"
if ex(cmd)
remove_p_from_li('book.html')
@done['html'] == true
'book.html'
end
end

def remove_p_from_li(file)
content = File.read(file)
File.open(file, 'w') do |f|
f.write content.gsub(%r"<li>\s*<p>\s*(.+?)\s+</p>\s*</li>"m, '<li>\1</li>')
end
end

def do_site
info "GENERATING SITE"
# TODO: check if html was already done
Expand Down

0 comments on commit fb372e0

Please sign in to comment.