Skip to content

Commit

Permalink
Remove <head> from test
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-fox committed Jul 27, 2019
1 parent 13fdd14 commit 4acc4b8
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
26 changes: 25 additions & 1 deletion test/html-local-file/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,30 @@
</description>
<target name="unit-test">
<exec-html5/>
<compare-output suffix=".html" result="out/html/swagger.html"/>
<get-body from="swagger.html"/>
<compare-output suffix=".html"/>
</target>



<macrodef name="get-body">
<attribute default="${output.dir}/html" name="dir"/>
<attribute name="from"/>
<attribute default="${output.dir}/fragment.html" name="to"/>
<sequential>
<local name="htmlSource"/>
<local name="fragment"/>
<loadfile failonerror="true" property="htmlSource" srcfile="@{dir}/@{from}"/>
<script language="javascript">//
<![CDATA[
var input = project.getProperty("htmlSource");
var start = input.indexOf("<body");
var end = input.indexOf("</body>") + 7;
project.setProperty("fragment", input.substring(start, end) );
// ]]></script>

<!-- strip out comments and save comments only to a separate file -->
<echo file="@{to}" message="${fragment}"/>
</sequential>
</macrodef>
</project>
6 changes: 2 additions & 4 deletions test/html-local-file/expected.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<!DOCTYPE html
SYSTEM "about:legacy-compat">
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="UTF-8"><meta name="copyright" content="(C) Copyright 2019"><meta name="DC.rights.owner" content="(C) Copyright 2019"><meta name="DC.type" content="topic"><meta name="DC.format" content="HTML5"><meta name="DC.identifier" content="swagger-petstore"><link rel="stylesheet" type="text/css" href="commonltr.css"><title>Swagger Petstore</title><link rel="stylesheet" type="text/css" href="prism.css"></head><body id="swagger-petstore"><main role="main"><article role="article" aria-labelledby="ariaid-title1">
<body id="swagger-petstore"><main role="main"><article role="article" aria-labelledby="ariaid-title1">
<h1 class="title topictitle1" id="ariaid-title1">Swagger Petstore</h1>
<div class="body">
</div>
Expand Down Expand Up @@ -2026,4 +2024,4 @@ <h3 class="title topictitle3" id="ariaid-title139">api_key</h3>

</article>

</article></main></body></html>
</article></main></body>

0 comments on commit 4acc4b8

Please sign in to comment.