summaryrefslogtreecommitdiff
path: root/support/html2latex/HTML/t
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/html2latex/HTML/t
Initial commit
Diffstat (limited to 'support/html2latex/HTML/t')
-rw-r--r--support/html2latex/HTML/t/foreigns.correct7
-rw-r--r--support/html2latex/HTML/t/foreigns.html1
-rwxr-xr-xsupport/html2latex/HTML/t/foreigns.t20
-rw-r--r--support/html2latex/HTML/t/tags.correct116
-rw-r--r--support/html2latex/HTML/t/tags.gifbin0 -> 2537 bytes
-rw-r--r--support/html2latex/HTML/t/tags.html123
-rw-r--r--support/html2latex/HTML/t/tags.pngbin0 -> 2481 bytes
-rwxr-xr-xsupport/html2latex/HTML/t/tags.t19
8 files changed, 286 insertions, 0 deletions
diff --git a/support/html2latex/HTML/t/foreigns.correct b/support/html2latex/HTML/t/foreigns.correct
new file mode 100644
index 0000000000..d670eb5ee1
--- /dev/null
+++ b/support/html2latex/HTML/t/foreigns.correct
@@ -0,0 +1,7 @@
+\documentclass[10pt]{article}
+\usepackage{fullpage, graphicx, url}
+\setlength{\parskip}{1ex}
+\setlength{\parindent}{0ex}
+\begin{document}
+!`¢{\pounds}¤{Y\hspace*{-1.4ex}--}$|${\S}\"{}{\copyright}$^{\underline{a}}$<<$\neg$$-$®$^-$$^{\circ}$$\pm$$^2$$^3$$^\prime$$\mu${\P}$\cdot$,$^1$$^{\underline{\circ}}$>>$\frac{1}{4}$$\frac{1}{2}$$\frac{3}{4}$?`\`A\'A\^A\~A\"A{\AA}{\AE}\c{C}\`E\'E\^E\"E\`I\'I\^I\"I{D\hspace*{-1.7ex}-\hspace{.9ex}}\~N\`O\'O\^O\~O\"O$\chi${\O}\`U\'U\^U\"U\'YP"s\`a\'a\^a\~a\"a\r{a}{\ae}\c{c}\`e\'e\^e\"e\`{\i}\'{\i}\^{\i}\"{\i}\v{o}\~n\`o\'o\^o\~o\"o$\div${\o}\`u\'u\^u\"u\'yp\"y
+\end{document}
diff --git a/support/html2latex/HTML/t/foreigns.html b/support/html2latex/HTML/t/foreigns.html
new file mode 100644
index 0000000000..e57e7b4655
--- /dev/null
+++ b/support/html2latex/HTML/t/foreigns.html
@@ -0,0 +1 @@
+¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ \ No newline at end of file
diff --git a/support/html2latex/HTML/t/foreigns.t b/support/html2latex/HTML/t/foreigns.t
new file mode 100755
index 0000000000..3be49e97e9
--- /dev/null
+++ b/support/html2latex/HTML/t/foreigns.t
@@ -0,0 +1,20 @@
+#!/usr/bin/perl -w
+use Latex;
+use strict;
+
+my @files = qw(t/foreigns);
+my $parser = new HTML::Latex;
+
+print '1..',scalar @files,"\n";
+
+foreach my $file (@files){
+ $parser->set_log("/dev/null");
+
+ my ($htmlfile,$latexfile) = $parser->html2latex("$file.html") or die "Couldn't process $file.html";
+
+ print "not " if (!(-f $latexfile) || `diff $latexfile $file.correct`);
+ print "ok\n";
+}
+
+unlink <*.tex>;
+
diff --git a/support/html2latex/HTML/t/tags.correct b/support/html2latex/HTML/t/tags.correct
new file mode 100644
index 0000000000..5101e8c44e
--- /dev/null
+++ b/support/html2latex/HTML/t/tags.correct
@@ -0,0 +1,116 @@
+\documentclass[10pt]{article}
+\usepackage{fullpage, graphicx, url}
+\setlength{\parskip}{1ex}
+\setlength{\parindent}{0ex}
+\title{Test \#1}
+\begin{document}
+ Table without border
+
+\begin{tabular}{cc}
+Ampersand &\& \\
+Left Angle &$<$ \\
+Right Angle &$>$ \\
+Dollar Sign &\$\$\$\$ \\
+Forward Slash &/ \\
+Percent &\% \\
+Left Brace &\{ \\
+Back Slash &$\backslash$ \\
+Right Brace &\} \\
+Underscore &\_ \\
+Funny &$\backslash$\$
+
+\end{tabular}
+
+ Nested table with border
+
+\begin{tabular}{|l|r|}
+\hline
+align left &align right \\
+ \hline
+....................................... &....................................... \\
+ \hline
+align center &
+
+\begin{tabular}{|c|c|}
+\hline
+1 &2 \\
+ \hline
+3 &4 \\
+ \hline
+
+\end{tabular}
+
+ \\
+ \hline
+
+\end{tabular}
+
+\begin{description}
+\item[Defenition of Recursion ]See Recursion
+
+\end{description}
+\section*{Header 1}
+\subsection*{Header 2}
+\subsubsection*{Header 3}
+\textbf{Header 4}
+\textbf{Header 5}
+\textbf{Header 6}
+ A small ordered list. \begin{enumerate}
+\item \textbf{Bold}
+
+\item \emph{Italics}
+
+\item \textbf{Strong}
+
+\item \emph{Emph}
+
+
+\end{enumerate}
+ A small unordered list. \begin{itemize}
+\item !@\#\$\%\^{}\&*()\{\}
+\item Nested list \begin{itemize}
+\item !@\#\$\%\^{}\&*()\{\}
+\item bill@bobb.com
+
+\end{itemize}
+
+
+\end{itemize}
+\emph{This is italisized}
+\\
+\emph{This is italisized}
+\\
+ This is not.\\
+\textbf{This is bold.}
+\\
+\textbf{This is bold}
+\\
+ This is not.\\
+ \$words\{cow\} = ``moo''; \# this is code\\
+ This is not.\\
+\begin{quote}
+This is a block quote
+\end{quote}
+ This is not.\\
+\begin{center}
+This is centered text
+\end{center}
+\\
+ This is not.\\
+ This is not a comment\\
+\begin{center}
+\includegraphics[scale=1]{./tags.png} \\
+this is an image that does not work\\
+ Both the pictures are centered.
+\end{center}
+
+
+ This is a paragraph.
+
+
+ This is a new paragraph.
+
+
+ This is a new new paragraph.
+
+\end{document}
diff --git a/support/html2latex/HTML/t/tags.gif b/support/html2latex/HTML/t/tags.gif
new file mode 100644
index 0000000000..432afb2d02
--- /dev/null
+++ b/support/html2latex/HTML/t/tags.gif
Binary files differ
diff --git a/support/html2latex/HTML/t/tags.html b/support/html2latex/HTML/t/tags.html
new file mode 100644
index 0000000000..fbc305285f
--- /dev/null
+++ b/support/html2latex/HTML/t/tags.html
@@ -0,0 +1,123 @@
+<HTML>
+<TITLE>Test #1</TITLE>
+Table without border
+<TABLE>
+<TR>
+ <TD>Ampersand</TD><TD>&amp;</TD>
+</TR>
+<TR>
+ <TD>Left Angle</TD><TD>&lt;</TD>
+</TR>
+<TR>
+ <TD>Right Angle</TD><TD>&gt;</TD>
+</TR>
+<TR>
+ <TD>Dollar Sign</TD><TD>$$$$</TD>
+</TR>
+<TR>
+ <TD>Forward Slash</TD><TD>/</TD>
+</TR>
+<TR>
+ <TD>Percent</TD><TD>%</TD>
+</TR>
+<TR>
+ <TD>Left Brace</TD><TD>{</TD>
+</TR>
+<TR>
+ <TD>Back Slash</TD><TD>\</TD>
+</TR>
+<TR>
+ <TD>Right Brace</TD><TD>}</TD>
+</TR>
+<TR>
+ <TD>Underscore</TD><TD>_</TD>
+</TR>
+<TR>
+ <TD>Funny</TD><TD>\$</TD>
+</TR>
+</TABLE>
+Nested table with border
+<TABLE border="1">
+<TR>
+ <TD align="left">align left</TD>
+ <TD align="right">align right</TD>
+</TR>
+<TR>
+<TD>.......................................</TD>
+<TD>.......................................</TD>
+</TR>
+<TR>
+ <TD align="center">align center</TD>
+ <TD align="center">
+ <TABLE border="2">
+ <TR>
+ <TD>1</TD>
+ <TD>2</TD>
+ </TR>
+ <TR>
+ <TD>3</TD>
+ <TD>4</TD>
+ </TR>
+ </TABLE>
+ </TD>
+</TR>
+</TABLE>
+<DL>
+<DT>Defenition of Recursion
+<DD>See Recursion
+</DL>
+<H1>Header 1</H1>
+<H2>Header 2</H2>
+<H3>Header 3</H3>
+<H4>Header 4</H4>
+<H5>Header 5</H5>
+<H6>Header 6</H6>
+
+ A small ordered list.
+<OL>
+<LI> <B>Bold</B>
+<LI> <I>Italics</I>
+<LI> <STRONG>Strong</STRONG>
+<LI> <EM>Emph</EM>
+</OL>
+
+ A small unordered list.
+<UL>
+<LI> !@#$%^&*(){}
+<LI>
+ Nested list
+ <UL>
+ <LI> !@#$%^&*(){}
+ <LI> bill@bobb.com
+ </UL>
+</UL>
+
+<EM>This is italisized</EM><BR>
+<I>This is italisized</I><BR>
+This is not.<BR>
+<STRONG>This is bold.</STRONG><BR>
+<B>This is bold</B><BR>
+This is not.<BR>
+<CODE> $words{cow} = "moo"; # this is code</CODE><BR>
+This is not.<BR>
+<!-- This is a comment at the end of your document -->
+<BLOCKQUOTE>This is a block quote</BLOCKQUOTE>
+This is not.<BR>
+<CENTER>This is centered text</CENTER><BR>
+This is not.<BR>
+This is not a comment<BR>
+<CENTER>
+<IMG src="tags.gif" alt="this is an image that works"><BR>
+<IMG src="cow.jpg" alt="this is an image that does not work"><BR>
+Both the pictures are centered.
+</CENTER>
+<P>This is a paragraph.<P>This is a new paragraph.<P>This is a new new paragraph.
+</HTML>
+
+
+
+
+
+
+
+
diff --git a/support/html2latex/HTML/t/tags.png b/support/html2latex/HTML/t/tags.png
new file mode 100644
index 0000000000..01bdf65e2b
--- /dev/null
+++ b/support/html2latex/HTML/t/tags.png
Binary files differ
diff --git a/support/html2latex/HTML/t/tags.t b/support/html2latex/HTML/t/tags.t
new file mode 100755
index 0000000000..648e3da0e8
--- /dev/null
+++ b/support/html2latex/HTML/t/tags.t
@@ -0,0 +1,19 @@
+#!/usr/bin/perl -w
+use Latex;
+use strict;
+
+my @files = qw(t/tags);
+my $parser = new HTML::Latex;
+
+print '1..',scalar @files,"\n";
+
+foreach my $file (@files){
+ $parser->set_log("/dev/null");
+
+ my ($htmlfile,$latexfile) = $parser->html2latex("$file.html") or die "Couldn't process $file.html";
+
+ print "not " if (!(-f $latexfile) || `diff $latexfile $file.correct`);
+ print "ok\n";
+}
+
+unlink <*.tex>;