2 * \file output_xhtml.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * This code is based upon output_docbook.cpp
10 * Full author contact details are available in file CREDITS.
15 #include "output_xhtml.h"
18 #include "buffer_funcs.h"
19 #include "BufferParams.h"
23 #include "OutputParams.h"
24 #include "Paragraph.h"
25 #include "ParagraphList.h"
26 #include "ParagraphParameters.h"
29 #include "TextClass.h"
31 #include "support/convert.h"
32 #include "support/debug.h"
33 #include "support/lassert.h"
34 #include "support/lstrings.h"
35 #include "support/textutils.h"
40 using namespace lyx::support;
46 docstring escapeChar(char_type c, XHTMLStream::EscapeSettings e)
50 case XHTMLStream::ESCAPE_NONE:
53 case XHTMLStream::ESCAPE_ALL:
57 } else if (c == '>') {
62 case XHTMLStream::ESCAPE_AND:
73 // escape what needs escaping
74 docstring htmlize(docstring const & str, XHTMLStream::EscapeSettings e)
77 docstring::const_iterator it = str.begin();
78 docstring::const_iterator en = str.end();
79 for (; it != en; ++it)
80 d << escapeChar(*it, e);
85 string escapeChar(char c, XHTMLStream::EscapeSettings e)
89 case XHTMLStream::ESCAPE_NONE:
92 case XHTMLStream::ESCAPE_ALL:
96 } else if (c == '>') {
101 case XHTMLStream::ESCAPE_AND:
112 // escape what needs escaping
113 string htmlize(string const & str, XHTMLStream::EscapeSettings e)
116 string::const_iterator it = str.begin();
117 string::const_iterator en = str.end();
118 for (; it != en; ++it)
119 d << escapeChar(*it, e);
124 string cleanAttr(string const & str)
127 string::const_iterator it = str.begin();
128 string::const_iterator en = str.end();
129 for (; it != en; ++it)
130 newname += isAlnumASCII(*it) ? *it : '_';
135 docstring cleanAttr(docstring const & str)
138 docstring::const_iterator it = str.begin();
139 docstring::const_iterator en = str.end();
140 for (; it != en; ++it) {
141 char_type const c = *it;
142 newname += isAlnumASCII(c) ? c : char_type('_');
148 bool isFontTag(string const & s)
151 return s == "em" || s == "strong" || s == "i" || s == "b";
155 docstring StartTag::asTag() const
157 string output = "<" + tag_;
159 output += " " + html::htmlize(attr_, XHTMLStream::ESCAPE_NONE);
161 return from_utf8(output);
165 docstring StartTag::asEndTag() const
167 string output = "</" + tag_ + ">";
168 return from_utf8(output);
172 docstring EndTag::asEndTag() const
174 string output = "</" + tag_ + ">";
175 return from_utf8(output);
179 docstring CompTag::asTag() const
181 string output = "<" + tag_;
183 output += " " + html::htmlize(attr_, XHTMLStream::ESCAPE_NONE);
185 return from_utf8(output);
192 ////////////////////////////////////////////////////////////////
196 ////////////////////////////////////////////////////////////////
198 XHTMLStream::XHTMLStream(odocstream & os)
199 : os_(os), escape_(ESCAPE_ALL)
204 void XHTMLStream::dumpTagStack(string const & msg) const
206 writeError(msg + ": Tag Stack");
207 TagStack::const_reverse_iterator it = tag_stack_.rbegin();
208 TagStack::const_reverse_iterator en = tag_stack_.rend();
209 for (; it != en; ++it) {
210 writeError(it->tag_);
212 writeError("Pending Tags");
213 it = pending_tags_.rbegin();
214 en = pending_tags_.rend();
215 for (; it != en; ++it) {
216 writeError(it->tag_);
218 writeError("End Tag Stack");
223 void XHTMLStream::writeError(std::string const & s) const
226 os_ << from_utf8("<!-- Output Error: " + s + " -->\n");
231 // an illegal tag for internal use
232 static string const parsep_tag = "&LyX_parsep_tag&";
236 bool XHTMLStream::closeFontTags()
238 if (isTagPending(parsep_tag))
239 // we haven't had any content
242 // this may be a useless check, since we ought at least to have
243 // the parsep_tag. but it can't hurt too much to be careful.
244 if (tag_stack_.empty())
247 // first, we close any open font tags we can close
248 html::StartTag curtag = tag_stack_.back();
249 while (html::isFontTag(curtag.tag_)) {
250 os_ << curtag.asEndTag();
251 tag_stack_.pop_back();
252 if (tag_stack_.empty())
253 // this probably shouldn't happen, since then the
254 // font tags weren't in any other tag. but that
255 // problem will likely be caught elsewhere.
257 curtag = tag_stack_.back();
260 if (curtag.tag_ == parsep_tag)
263 // so we've hit a non-font tag.
264 writeError("Tags still open in closeFontTags(). Probably not a problem,\n"
265 "but you might want to check these tags:");
266 TagStack::const_reverse_iterator it = tag_stack_.rbegin();
267 TagStack::const_reverse_iterator const en = tag_stack_.rend();
268 for (; it != en; ++it) {
269 string const tagname = it->tag_;
270 if (tagname == parsep_tag)
272 writeError(it->tag_);
278 void XHTMLStream::startParagraph(bool keep_empty)
280 pending_tags_.push_back(html::StartTag(parsep_tag));
286 void XHTMLStream::endParagraph()
288 if (isTagPending(parsep_tag)) {
289 // this case is normal. it just means we didn't have content,
290 // so the parsep_tag never got moved onto the tag stack.
291 while (!pending_tags_.empty()) {
292 // clear all pending tags up to and including the parsep tag.
293 // note that we work from the back, because we want to get rid
294 // of everything that hasn't been used.
295 html::StartTag const cur_tag = pending_tags_.back();
296 string const & tag = cur_tag.tag_;
297 pending_tags_.pop_back();
298 if (tag == parsep_tag)
304 if (!isTagOpen(parsep_tag)) {
305 writeError("No paragraph separation tag found in endParagraph().");
309 // this case is also normal, if the parsep tag is the last one
310 // on the stack. otherwise, it's an error.
311 while (!tag_stack_.empty()) {
312 html::StartTag const cur_tag = tag_stack_.back();
313 string const & tag = cur_tag.tag_;
314 tag_stack_.pop_back();
315 if (tag == parsep_tag)
317 writeError("Tag `" + tag + "' still open at end of paragraph. Closing.");
318 os_ << cur_tag.asEndTag();
323 void XHTMLStream::clearTagDeque()
325 while (!pending_tags_.empty()) {
326 html::StartTag const & tag = pending_tags_.front();
327 if (tag.tag_ != parsep_tag)
330 tag_stack_.push_back(tag);
331 pending_tags_.pop_front();
336 XHTMLStream & XHTMLStream::operator<<(docstring const & d)
339 os_ << html::htmlize(d, escape_);
340 escape_ = ESCAPE_ALL;
345 XHTMLStream & XHTMLStream::operator<<(const char * s)
348 docstring const d = from_ascii(s);
349 os_ << html::htmlize(d, escape_);
350 escape_ = ESCAPE_ALL;
355 XHTMLStream & XHTMLStream::operator<<(char_type c)
358 os_ << html::escapeChar(c, escape_);
359 escape_ = ESCAPE_ALL;
364 XHTMLStream & XHTMLStream::operator<<(char c)
367 string const d = html::escapeChar(c, escape_);
368 escape_ = ESCAPE_ALL;
373 XHTMLStream & XHTMLStream::operator<<(int i)
377 escape_ = ESCAPE_ALL;
382 XHTMLStream & XHTMLStream::operator<<(EscapeSettings e)
389 XHTMLStream & XHTMLStream::operator<<(html::StartTag const & tag)
391 if (tag.tag_.empty())
393 pending_tags_.push_back(tag);
400 XHTMLStream & XHTMLStream::operator<<(html::CompTag const & tag)
402 if (tag.tag_.empty())
412 XHTMLStream & XHTMLStream::operator<<(html::CR const &)
415 os_ << from_ascii("\n");
420 bool XHTMLStream::isTagOpen(string const & stag) const
422 TagStack::const_iterator sit = tag_stack_.begin();
423 TagStack::const_iterator const sen = tag_stack_.end();
424 for (; sit != sen; ++sit)
425 if (sit->tag_ == stag)
431 bool XHTMLStream::isTagPending(string const & stag) const
433 TagStack::const_iterator sit = pending_tags_.begin();
434 TagStack::const_iterator const sen = pending_tags_.end();
435 for (; sit != sen; ++sit)
436 if (sit->tag_ == stag)
442 // this is complicated, because we want to make sure that
443 // everything is properly nested. the code ought to make
444 // sure of that, but we won't assert (yet) if we run into
445 // a problem. we'll just output error messages and try our
446 // best to make things work.
447 XHTMLStream & XHTMLStream::operator<<(html::EndTag const & etag)
449 if (etag.tag_.empty())
452 // make sure there are tags to be closed
453 if (tag_stack_.empty()) {
454 writeError("Tried to close `" + etag.tag_
455 + "' when no tags were open!");
459 // first make sure we're not closing an empty tag
460 if (!pending_tags_.empty()) {
461 html::StartTag const & stag = pending_tags_.back();
462 if (etag.tag_ == stag.tag_) {
463 // we have <tag></tag>, so we discard it and remove it
464 // from the pending_tags_.
465 pending_tags_.pop_back();
468 // there is a pending tag that isn't the one we are trying
470 // is this tag itself pending?
471 // non-const iterators because we may call erase().
472 TagStack::iterator dit = pending_tags_.begin();
473 TagStack::iterator const den = pending_tags_.end();
474 for (; dit != den; ++dit) {
475 if (dit->tag_ == etag.tag_) {
476 // it was pending, so we just erase it
477 writeError("Tried to close pending tag `" + etag.tag_
478 + "' when other tags were pending. Last pending tag is `"
479 + pending_tags_.back().tag_ + "'. Tag discarded.");
480 pending_tags_.erase(dit);
484 // so etag isn't itself pending. is it even open?
485 if (!isTagOpen(etag.tag_)) {
486 writeError("Tried to close `" + etag.tag_
487 + "' when tag was not open. Tag discarded.");
490 // ok, so etag is open.
491 // our strategy will be as below: we will do what we need to
492 // do to close this tag.
493 string estr = "Closing tag `" + etag.tag_
494 + "' when other tags are pending. Discarded pending tags:\n";
495 for (dit = pending_tags_.begin(); dit != den; ++dit)
496 estr += dit->tag_ + "\n";
498 // clear the pending tags...
499 pending_tags_.clear();
500 // ...and then just fall through.
503 // is the tag we are closing the last one we opened?
504 if (etag.tag_ == tag_stack_.back().tag_) {
506 os_ << etag.asEndTag();
507 // ...and forget about it
508 tag_stack_.pop_back();
512 // we are trying to close a tag other than the one last opened.
513 // let's first see if this particular tag is still open somehow.
514 if (!isTagOpen(etag.tag_)) {
515 writeError("Tried to close `" + etag.tag_
516 + "' when tag was not open. Tag discarded.");
520 // so the tag was opened, but other tags have been opened since
521 // and not yet closed.
522 // if it's a font tag, though...
523 if (html::isFontTag(etag.tag_)) {
524 // it won't be a problem if the other tags open since this one
525 // are also font tags.
526 TagStack::const_reverse_iterator rit = tag_stack_.rbegin();
527 TagStack::const_reverse_iterator ren = tag_stack_.rend();
528 for (; rit != ren; ++rit) {
529 if (rit->tag_ == etag.tag_)
531 if (!html::isFontTag(rit->tag_)) {
532 // we'll just leave it and, presumably, have to close it later.
533 writeError("Unable to close font tag `" + etag.tag_
534 + "' due to open non-font tag `" + rit->tag_ + "'.");
540 // <em>this is <strong>bold
541 // and are being asked to closed em. we want:
542 // <em>this is <strong>bold</strong></em><strong>
543 // first, we close the intervening tags...
544 html::StartTag curtag = tag_stack_.back();
545 // ...remembering them in a stack.
547 while (curtag.tag_ != etag.tag_) {
548 os_ << curtag.asEndTag();
549 fontstack.push_back(curtag);
550 tag_stack_.pop_back();
551 curtag = tag_stack_.back();
553 // now close our tag...
554 os_ << etag.asEndTag();
555 tag_stack_.pop_back();
557 // ...and restore the other tags.
558 rit = fontstack.rbegin();
559 ren = fontstack.rend();
560 for (; rit != ren; ++rit)
561 pending_tags_.push_back(*rit);
565 // it wasn't a font tag.
566 // so other tags were opened before this one and not properly closed.
567 // so we'll close them, too. that may cause other issues later, but it
568 // at least guarantees proper nesting.
569 writeError("Closing tag `" + etag.tag_
570 + "' when other tags are open, namely:");
571 html::StartTag curtag = tag_stack_.back();
572 while (curtag.tag_ != etag.tag_) {
573 writeError(curtag.tag_);
574 if (curtag.tag_ != parsep_tag)
575 os_ << curtag.asEndTag();
576 tag_stack_.pop_back();
577 curtag = tag_stack_.back();
579 // curtag is now the one we actually want.
580 os_ << curtag.asEndTag();
581 tag_stack_.pop_back();
586 // End code for XHTMLStream
590 // convenience functions
592 inline void openTag(XHTMLStream & xs, Layout const & lay)
594 xs << html::StartTag(lay.htmltag(), lay.htmlattr());
598 void openTag(XHTMLStream & xs, Layout const & lay,
599 ParagraphParameters const & params)
601 // FIXME Are there other things we should handle here?
602 string const align = alignmentToCSS(params.align());
607 string attrs = lay.htmlattr() + " style='text-align: " + align + ";'";
608 xs << html::StartTag(lay.htmltag(), attrs);
612 inline void closeTag(XHTMLStream & xs, Layout const & lay)
614 xs << html::EndTag(lay.htmltag());
618 inline void openLabelTag(XHTMLStream & xs, Layout const & lay)
620 xs << html::StartTag(lay.htmllabeltag(), lay.htmllabelattr());
624 inline void closeLabelTag(XHTMLStream & xs, Layout const & lay)
626 xs << html::EndTag(lay.htmllabeltag());
630 inline void openItemTag(XHTMLStream & xs, Layout const & lay)
632 xs << html::StartTag(lay.htmlitemtag(), lay.htmlitemattr(), true);
636 void openItemTag(XHTMLStream & xs, Layout const & lay,
637 ParagraphParameters const & params)
639 // FIXME Are there other things we should handle here?
640 string const align = alignmentToCSS(params.align());
642 openItemTag(xs, lay);
645 string attrs = lay.htmlattr() + " style='text-align: " + align + ";'";
646 xs << html::StartTag(lay.htmlitemtag(), attrs);
650 inline void closeItemTag(XHTMLStream & xs, Layout const & lay)
652 xs << html::EndTag(lay.htmlitemtag());
655 // end of convenience functions
657 ParagraphList::const_iterator searchParagraphHtml(
658 ParagraphList::const_iterator p,
659 ParagraphList::const_iterator const & pend)
661 for (++p; p != pend && p->layout().latextype == LATEX_PARAGRAPH; ++p)
668 ParagraphList::const_iterator searchEnvironmentHtml(
669 ParagraphList::const_iterator const pstart,
670 ParagraphList::const_iterator const & pend)
672 ParagraphList::const_iterator p = pstart;
673 Layout const & bstyle = p->layout();
674 size_t const depth = p->params().depth();
675 for (++p; p != pend; ++p) {
676 Layout const & style = p->layout();
677 // It shouldn't happen that e.g. a section command occurs inside
678 // a quotation environment, at a higher depth, but as of 6/2009,
679 // it can happen. We pretend that it's just at lowest depth.
680 if (style.latextype == LATEX_COMMAND)
682 // If depth is down, we're done
683 if (p->params().depth() < depth)
685 // If depth is up, we're not done
686 if (p->params().depth() > depth)
688 // Now we know we are at the same depth
689 if (style.latextype == LATEX_PARAGRAPH
690 || style.latexname() != bstyle.latexname())
697 ParagraphList::const_iterator makeParagraphs(Buffer const & buf,
699 OutputParams const & runparams,
701 ParagraphList::const_iterator const & pbegin,
702 ParagraphList::const_iterator const & pend)
704 ParagraphList::const_iterator const begin = text.paragraphs().begin();
705 ParagraphList::const_iterator par = pbegin;
706 for (; par != pend; ++par) {
707 Layout const & lay = par->layout();
708 if (!lay.counter.empty())
709 buf.params().documentClass().counters().step(lay.counter, OutputUpdate);
710 // FIXME We should see if there's a label to be output and
711 // do something with it.
715 // If we are already in a paragraph, and this is the first one, then we
716 // do not want to open the paragraph tag.
717 // we also do not want to open it if the current layout does not permit
718 // multiple paragraphs.
719 bool const opened = runparams.html_make_pars &&
720 (par != pbegin || !runparams.html_in_par);
722 openTag(xs, lay, par->params());
723 docstring const deferred =
724 par->simpleLyXHTMLOnePar(buf, xs, runparams, text.outerFont(distance(begin, par)));
726 // We want to issue the closing tag if either:
727 // (i) We opened it, and either html_in_par is false,
728 // or we're not in the last paragraph, anyway.
729 // (ii) We didn't open it and html_in_par is true,
730 // but we are in the first par, and there is a next par.
731 ParagraphList::const_iterator nextpar = par;
733 bool const needclose =
734 (opened && (!runparams.html_in_par || nextpar != pend))
735 || (!opened && runparams.html_in_par && par == pbegin && nextpar != pend);
740 if (!deferred.empty()) {
741 xs << XHTMLStream::ESCAPE_NONE << deferred << html::CR();
748 ParagraphList::const_iterator makeBibliography(Buffer const & buf,
750 OutputParams const & runparams,
752 ParagraphList::const_iterator const & pbegin,
753 ParagraphList::const_iterator const & pend)
756 // Use TextClass::htmlTOCLayout() to figure out how we should look.
757 xs << html::StartTag("h2", "class='bibliography'")
758 << pbegin->layout().labelstring(false)
759 << html::EndTag("h2")
761 << html::StartTag("div", "class='bibliography'")
763 makeParagraphs(buf, xs, runparams, text, pbegin, pend);
764 xs << html::EndTag("div");
769 bool isNormalEnv(Layout const & lay)
771 return lay.latextype == LATEX_ENVIRONMENT
772 || lay.latextype == LATEX_BIB_ENVIRONMENT;
776 ParagraphList::const_iterator makeEnvironmentHtml(Buffer const & buf,
778 OutputParams const & runparams,
780 ParagraphList::const_iterator const & pbegin,
781 ParagraphList::const_iterator const & pend)
783 ParagraphList::const_iterator const begin = text.paragraphs().begin();
784 ParagraphList::const_iterator par = pbegin;
785 Layout const & bstyle = par->layout();
786 depth_type const origdepth = pbegin->params().depth();
788 // open tag for this environment
792 // we will on occasion need to remember a layout from before.
793 Layout const * lastlay = 0;
795 while (par != pend) {
796 Layout const & style = par->layout();
797 // the counter only gets stepped if we're in some kind of list,
798 // or if it's the first time through.
799 // note that enum, etc, are handled automatically.
800 // FIXME There may be a bug here about user defined enumeration
801 // types. If so, then we'll need to take the counter and add "i",
802 // "ii", etc, as with enum.
803 Counters & cnts = buf.params().documentClass().counters();
804 docstring const & cntr = style.counter;
805 if (!style.counter.empty()
806 && (par == pbegin || !isNormalEnv(style))
807 && cnts.hasCounter(cntr)
809 cnts.step(cntr, OutputUpdate);
810 ParagraphList::const_iterator send;
811 // this will be positive, if we want to skip the initial word
812 // (if it's been taken for the label).
815 switch (style.latextype) {
816 case LATEX_ENVIRONMENT:
817 case LATEX_LIST_ENVIRONMENT:
818 case LATEX_ITEM_ENVIRONMENT: {
819 // There are two possiblities in this case.
820 // One is that we are still in the environment in which we
821 // started---which we will be if the depth is the same.
822 if (par->params().depth() == origdepth) {
823 LASSERT(bstyle == style, /* */);
825 closeItemTag(xs, *lastlay);
829 bool const labelfirst = style.htmllabelfirst();
831 openItemTag(xs, style, par->params());
834 if (style.labeltype != LABEL_NO_LABEL &&
835 style.htmllabeltag() != "NONE") {
836 if (isNormalEnv(style)) {
837 // in this case, we print the label only for the first
838 // paragraph (as in a theorem).
840 docstring const lbl =
841 pbegin->params().labelString();
843 openLabelTag(xs, style);
845 closeLabelTag(xs, style);
849 } else { // some kind of list
850 if (style.labeltype == LABEL_MANUAL) {
851 openLabelTag(xs, style);
852 sep = par->firstWordLyXHTML(xs, runparams);
853 closeLabelTag(xs, style);
857 openLabelTag(xs, style);
858 xs << par->params().labelString();
859 closeLabelTag(xs, style);
863 } // end label output
866 openItemTag(xs, style, par->params());
868 par->simpleLyXHTMLOnePar(buf, xs, runparams,
869 text.outerFont(distance(begin, par)), sep);
872 // We may not want to close the tag yet, in particular:
873 // If we're not at the end...
875 // and are doing items...
876 && !isNormalEnv(style)
877 // and if the depth has changed...
878 && par->params().depth() != origdepth) {
879 // then we'll save this layout for later, and close it when
880 // we get another item.
883 closeItemTag(xs, style);
886 // The other possibility is that the depth has increased, in which
887 // case we need to recurse.
889 send = searchEnvironmentHtml(par, pend);
890 par = makeEnvironmentHtml(buf, xs, runparams, text, par, send);
894 case LATEX_PARAGRAPH:
895 send = searchParagraphHtml(par, pend);
896 par = makeParagraphs(buf, xs, runparams, text, par, send);
899 case LATEX_BIB_ENVIRONMENT:
902 par = makeParagraphs(buf, xs, runparams, text, par, send);
912 closeItemTag(xs, *lastlay);
913 closeTag(xs, bstyle);
919 void makeCommand(Buffer const & buf,
921 OutputParams const & runparams,
923 ParagraphList::const_iterator const & pbegin)
925 Layout const & style = pbegin->layout();
926 if (!style.counter.empty())
927 buf.params().documentClass().counters().step(style.counter, OutputUpdate);
929 openTag(xs, style, pbegin->params());
931 // Label around sectioning number:
932 // FIXME Probably need to account for LABEL_MANUAL
933 if (style.labeltype != LABEL_NO_LABEL) {
934 openLabelTag(xs, style);
935 xs << pbegin->params().labelString();
936 closeLabelTag(xs, style);
937 // Otherwise the label might run together with the text
938 xs << from_ascii(" ");
941 ParagraphList::const_iterator const begin = text.paragraphs().begin();
942 pbegin->simpleLyXHTMLOnePar(buf, xs, runparams,
943 text.outerFont(distance(begin, pbegin)));
948 } // end anonymous namespace
951 void xhtmlParagraphs(Text const & text,
954 OutputParams const & runparams)
956 ParagraphList const & paragraphs = text.paragraphs();
957 if (runparams.par_begin == runparams.par_end) {
958 runparams.par_begin = 0;
959 runparams.par_end = paragraphs.size();
961 pit_type bpit = runparams.par_begin;
962 pit_type const epit = runparams.par_end;
963 LASSERT(bpit < epit, /* */);
965 OutputParams ourparams = runparams;
966 ParagraphList::const_iterator const pend =
967 (epit == (int) paragraphs.size()) ?
968 paragraphs.end() : paragraphs.constIterator(epit);
969 while (bpit < epit) {
970 ParagraphList::const_iterator par = paragraphs.constIterator(bpit);
971 if (par->params().startOfAppendix()) {
972 // We want to reset the counter corresponding to toplevel sectioning
974 buf.masterBuffer()->params().documentClass().getTOCLayout();
975 docstring const cnt = lay.counter;
978 buf.masterBuffer()->params().documentClass().counters();
982 Layout const & style = par->layout();
983 ParagraphList::const_iterator const lastpar = par;
984 ParagraphList::const_iterator send;
986 switch (style.latextype) {
987 case LATEX_COMMAND: {
988 // The files with which we are working never have more than
989 // one paragraph in a command structure.
991 // if (ourparams.html_in_par)
992 // fix it so we don't get sections inside standard, e.g.
993 // note that we may then need to make runparams not const, so we
994 // can communicate that back.
995 // FIXME Maybe this fix should be in the routines themselves, in case
996 // they are called from elsewhere.
997 makeCommand(buf, xs, ourparams, text, par);
1001 case LATEX_ENVIRONMENT:
1002 case LATEX_LIST_ENVIRONMENT:
1003 case LATEX_ITEM_ENVIRONMENT: {
1004 // FIXME Same fix here.
1005 send = searchEnvironmentHtml(par, pend);
1006 par = makeEnvironmentHtml(buf, xs, ourparams, text, par, send);
1009 case LATEX_BIB_ENVIRONMENT: {
1010 // FIXME Same fix here.
1011 send = searchEnvironmentHtml(par, pend);
1012 par = makeBibliography(buf, xs, ourparams, text, par, send);
1015 case LATEX_PARAGRAPH:
1016 send = searchParagraphHtml(par, pend);
1017 par = makeParagraphs(buf, xs, ourparams, text, par, send);
1020 bpit += distance(lastpar, par);
1025 string alignmentToCSS(LyXAlignment align)
1028 case LYX_ALIGN_BLOCK:
1029 // we are NOT going to use text-align: justify!!
1030 case LYX_ALIGN_LEFT:
1032 case LYX_ALIGN_RIGHT:
1034 case LYX_ALIGN_CENTER: