]> git.lyx.org Git - features.git/commitdiff
Better TOC output for XHTML, per Rob and Pavel.
authorRichard Heck <rgheck@comcast.net>
Tue, 12 Apr 2011 17:33:18 +0000 (17:33 +0000)
committerRichard Heck <rgheck@comcast.net>
Tue, 12 Apr 2011 17:33:18 +0000 (17:33 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38354 a592a061-630c-0410-9148-cb99ea01b6c8

lib/layouts/stdtitle.inc
src/insets/InsetTOC.cpp

index 7081de49d0013cae4ca4f584a5bcb100a52eab38..1669614f989788373587280c6b8b07ea173ebc2e 100644 (file)
@@ -34,6 +34,11 @@ AddToHTMLPreamble
        div.lyxtoc-4 { margin: 0em 0em 0em 1em; }
        div.lyxtoc-5 { margin: 0em 0em 0em 1em; }
        div.lyxtoc-6 { margin: 0em 0em 0em 1em; }
+       a.tocentry {
+               text-decoration: none;
+               color: black;
+       }
+       a.tocentry:visited { color: black; }
        a.tocarrow { 
                font-weight: bold; 
                text-decoration: none; 
index b5159f937fda1edbcce1b7f62cae509110900b29..bac2f43699b27c9aa5dd92656ab4aabfa3bea2d6 100644 (file)
@@ -159,6 +159,10 @@ docstring InsetTOC::xhtml(XHTMLStream &, OutputParams const & op) const
                
                // Now output TOC info for this entry
                Paragraph const & par = it->dit().innerParagraph();
+
+               string const attr = "href='#" + par.magicLabel() + "' class='tocentry'";
+               xs << html::StartTag("a", attr);
+
                // First the label, if there is one
                docstring const & label = par.params().labelString();
                if (!label.empty())
@@ -168,7 +172,9 @@ docstring InsetTOC::xhtml(XHTMLStream &, OutputParams const & op) const
                ours.for_toc = true;
                Font const dummy;
                par.simpleLyXHTMLOnePar(buffer(), xs, ours, dummy);
-               xs << " ";
+
+               xs << html::EndTag("a") << " ";
+
                // Now a link to that paragraph
                string const parattr = "href='#" + par.magicLabel() + "' class='tocarrow'";
                xs << html::StartTag("a", parattr);