Skip to content

Commit 4307df6

Browse files
committed
track-changes: test with HTML snippet
Generating a full document is fragile, as every change to the HTML template will break the tests. The filter does not modify template variables, so checking just the generated contents is sufficient.
1 parent 063f649 commit 4307df6

File tree

2 files changed

+1
-31
lines changed

2 files changed

+1
-31
lines changed

track-changes/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ test: sample.md test-track-changes.sh sample.pdf
99
@pandoc -t markdown --wrap=preserve --track-changes=reject \
1010
-M trackChanges:reject --lua-filter=track-changes.lua sample.md | \
1111
$(DIFF) - expected_reject.markdown
12-
@pandoc -s -t html --wrap=preserve --track-changes=all \
12+
@pandoc -t html --wrap=preserve --track-changes=all \
1313
-M trackChanges:all --lua-filter=track-changes.lua sample.md | \
1414
$(DIFF) - expected_draft.html
1515
@pandoc -M trackChanges:all --track-changes=all --wrap=preserve \

track-changes/expected_draft.html

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,3 @@
1-
<!DOCTYPE html>
2-
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
3-
<head>
4-
<meta charset="utf-8" />
5-
<meta name="generator" content="pandoc" />
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
7-
<title>Track changes in LaTeX and HTML</title>
8-
<style>
9-
code{white-space: pre-wrap;}
10-
span.smallcaps{font-variant: small-caps;}
11-
span.underline{text-decoration: underline;}
12-
div.column{display: inline-block; vertical-align: top; width: 50%;}
13-
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
14-
ul.task-list{list-style: none;}
15-
.display.math{display: block; text-align: center; margin: 0.5rem auto;}
16-
</style>
17-
<!--[if lt IE 9]>
18-
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
19-
<![endif]-->
20-
21-
</head>
22-
<body>
23-
<header id="title-block-header">
24-
<h1 class="title">Track changes in LaTeX and HTML</h1>
25-
</header>
26-
<nav id="TOC" role="doc-toc">
27-
28-
</nav>
291
<h1 id="track-changes-in-latex-and-html">Track changes in LaTeX and HTML</h1>
302
<p>A <mark data-author="Mathias C. Walter" date="2016-05-21T22:14:00Z" data-id="1" title="I agree!"><strong>simple</strong></mark> comment from me.</p>
313
<p>This is a text with <ins data-author="MCW" date="2014-06-25T10:40:00Z">an exciting</ins> insertion.</p>
@@ -40,5 +12,3 @@ <h1 id="track-changes-in-latex-and-html">Track changes in LaTeX and HTML</h1>
4012
<h1 id="a-header-width-a-notecomment">A <em>header</em> wi<del data-author="FKA" date="2018-03-02T23:07:00Z">d</del>th <ins data-author="JFK" date="2018-03-02T23:07:00Z">a</ins> <mark data-author="FKA" date="2017-08-24T22:14:00Z" data-id="3" title="Note">comment</mark></h1>
4113
<p>Some unmodified text …</p>
4214
<p>… continued from previous page just to test page headers in supporting formats (LaTeX, DOCX, etc.).</p>
43-
</body>
44-
</html>

0 commit comments

Comments
 (0)