Fixes #305. Beautify input in single temp file for HTMLBeautifier
- Enable HTMLBeautifier tests for Travis CI
This commit is contained in:
parent
024a6c7bdc
commit
8bcf4efcfa
|
@ -30,6 +30,7 @@ before_install:
|
|||
# Ruby language support
|
||||
# - gem install ruby-beautify --verbose
|
||||
- gem install rubocop
|
||||
- gem install htmlbeautifier
|
||||
# Python language support
|
||||
- brew install python
|
||||
- pip install --upgrade autopep8
|
||||
|
|
|
@ -3,12 +3,10 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title>Shopping List for
|
||||
<%= @date.strftime('%A, %d %B %Y') %></title>
|
||||
<title>Shopping List for <%= @date.strftime('%A, %d %B %Y') %></title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Shopping List for
|
||||
<%= @date.strftime('%A, %d %B %Y') %></h1>
|
||||
<h1>Shopping List for <%= @date.strftime('%A, %d %B %Y') %></h1>
|
||||
<p>You need to buy:</p>
|
||||
<ul>
|
||||
<% for @item in @items %>
|
||||
|
|
|
@ -13,11 +13,8 @@ module.exports = class HTMLBeautifier extends Beautifier
|
|||
|
||||
beautify: (text, language, options) ->
|
||||
@run("htmlbeautifier", [
|
||||
'<'
|
||||
@tempFile("input", text)
|
||||
'>'
|
||||
outputFile = @tempFile("output")
|
||||
tempFile = @tempFile("temp", text)
|
||||
])
|
||||
.then(=>
|
||||
@readFile(outputFile)
|
||||
@readFile(tempFile)
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue