Skip to content

Commit

Permalink
add new test for color containment in \href
Browse files Browse the repository at this point in the history
  • Loading branch information
dginev committed Oct 24, 2024
1 parent 06ccb36 commit 283af3e
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 0 deletions.
3 changes: 3 additions & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -982,6 +982,9 @@ t/complex/figure_mixed_content.xml
t/complex/hyperchars.pdf
t/complex/hyperchars.tex
t/complex/hyperchars.xml
t/complex/hypercolor.pdf
t/complex/hypercolor.tex
t/complex/hypercolor.xml
t/complex/hypertest.pdf
t/complex/hypertest.tex
t/complex/hypertest.xml
Expand Down
Binary file added t/complex/hypercolor.pdf
Binary file not shown.
16 changes: 16 additions & 0 deletions t/complex/hypercolor.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
\documentclass{article}
\usepackage{hyperref}
\usepackage{xcolor}
\def\simple#1#2{#1 and #2}
\begin{document}
A link: \href{https://example.com}{\color{blue}here}.

\section{Color should not leak into this heading}
This text should be black.

A simple macro: \simple{\color{blue}first}{second}.

\section{Color should leak into this heading}
This text should be blue.

\end{document}
39 changes: 39 additions & 0 deletions t/complex/hypercolor.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<?latexml class="article"?>
<?latexml package="hyperref"?>
<?latexml package="xcolor"?>
<?latexml RelaxNGSchema="LaTeXML"?>
<document xmlns="http://dlmf.nist.gov/LaTeXML">
<resource src="LaTeXML.css" type="text/css"/>
<resource src="ltx-article.css" type="text/css"/>
<para xml:id="p1">
<p>A link: <ref class="ltx_href" color="#0000FF" href="https://example.com">here</ref>.</p>
</para>
<section inlist="toc" xml:id="S1">
<tags>
<tag>1</tag>
<tag role="autoref">section 1</tag>
<tag role="refnum">1</tag>
<tag role="typerefnum">§1</tag>
</tags>
<title><tag close=" ">1</tag>Color should not leak into this heading</title>
<para xml:id="S1.p1">
<p>This text should be black.</p>
</para>
<para xml:id="S1.p2">
<p>A simple macro: <text color="#0000FF">first and second.</text></p>
</para>
</section>
<section inlist="toc" xml:id="S2">
<tags>
<tag>2</tag>
<tag role="autoref">section 2</tag>
<tag role="refnum">2</tag>
<tag role="typerefnum">§2</tag>
</tags>
<title color="#0000FF"><tag close=" ">2</tag>Color should leak into this heading</title>
<para xml:id="S2.p1">
<p><text color="#0000FF">This text should be blue.</text></p>
</para>
</section>
</document>

0 comments on commit 283af3e

Please # to comment.