Now we can restore the old (and better) behavior of descriptions.

The CSS for lists isn't quite right, but I'm not sure what to do.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29984 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2009-06-06 04:09:14 +00:00
parent e47d30e907
commit 9577dae301
4 changed files with 19 additions and 8 deletions

View File

@ -71,10 +71,14 @@ Style Description
LabelFont LabelFont
Series Bold Series Bold
EndFont EndFont
HTMLTag ol HTMLTag dl
HTMLItem li HTMLAttr class='description'
HTMLLabel span HTMLItem dd
HTMLLabelAttr class='desc' HTMLLabel dt
HTMLLabelFirst 1
HTMLStyle
dl.description dt { font-weight: bold; }
EndHTMLStyle
End End

View File

@ -139,6 +139,7 @@ Layout::Layout()
pass_thru = false; pass_thru = false;
toclevel = NOT_IN_TOC; toclevel = NOT_IN_TOC;
commanddepth = 0; commanddepth = 0;
htmllabelfirst_ = false;
} }

View File

@ -881,7 +881,6 @@ int InsetCollapsable::xhtml(odocstream & os, OutputParams const & runparams) con
bool const opened = html::openTag(os, il.htmltag(), il.htmlattr()); bool const opened = html::openTag(os, il.htmltag(), il.htmlattr());
if (!il.counter().empty()) { if (!il.counter().empty()) {
// FIXME Master buffer? // FIXME Master buffer?
LYXERR0(il.counter());
Counters & cntrs = buffer().params().documentClass().counters(); Counters & cntrs = buffer().params().documentClass().counters();
cntrs.step(il.counter()); cntrs.step(il.counter());
if (!il.htmllabel().empty()) if (!il.htmllabel().empty())

View File

@ -252,7 +252,10 @@ ParagraphList::const_iterator makeEnvironment(Buffer const & buf,
closeItemTag(os, *lastlay); closeItemTag(os, *lastlay);
lastlay = 0; lastlay = 0;
} }
bool const item_tag_opened = openItemTag(os, cstyle); bool const labelfirst = cstyle.htmllabelfirst();
bool item_tag_opened;
if (!labelfirst)
item_tag_opened = openItemTag(os, cstyle);
if (cstyle.labeltype == LABEL_MANUAL) { if (cstyle.labeltype == LABEL_MANUAL) {
bool const label_tag_opened = openLabelTag(os, cstyle); bool const label_tag_opened = openLabelTag(os, cstyle);
sep = par->firstWordLyXHTML(os, runparams); sep = par->firstWordLyXHTML(os, runparams);
@ -269,9 +272,14 @@ ParagraphList::const_iterator makeEnvironment(Buffer const & buf,
closeLabelTag(os, cstyle); closeLabelTag(os, cstyle);
os << '\n'; os << '\n';
} }
if (labelfirst)
item_tag_opened = openItemTag(os, cstyle);
else
os << "<span class='item'>";
par->simpleLyXHTMLOnePar(buf, os, runparams, par->simpleLyXHTMLOnePar(buf, os, runparams,
outerFont(distance(paragraphs.begin(), par), paragraphs), sep); outerFont(distance(paragraphs.begin(), par), paragraphs), sep);
if (!labelfirst)
os << "</span>";
++par; ++par;
if (item_tag_opened) { if (item_tag_opened) {
// We may not want to close the tag yet, in particular, // We may not want to close the tag yet, in particular,
@ -361,7 +369,6 @@ void xhtmlParagraphs(ParagraphList const & paragraphs,
ParagraphList::const_iterator pend = paragraphs.end(); ParagraphList::const_iterator pend = paragraphs.end();
while (par != pend) { while (par != pend) {
LYXERR0(par->id());
Layout const & style = par->layout(); Layout const & style = par->layout();
ParagraphList::const_iterator lastpar = par; ParagraphList::const_iterator lastpar = par;
ParagraphList::const_iterator send; ParagraphList::const_iterator send;