- bool madelabel = false;
- if (isNormalEnv(style)) {
- // in this case, we print the label only for the first
- // paragraph (as in a theorem).
- item_tag_opened = openItemTag(os, style);
- if (par == pbegin && style.htmllabeltag() != "NONE") {
- docstring const lbl =
- pbegin->expandLabel(style, buf.params(), false);
- if (!lbl.empty()) {
- bool const label_tag_opened = openLabelTag(os, style);
- os << lbl;
- if (label_tag_opened)
- closeLabelTag(os, style);
+ if (!labelfirst)
+ openItemTag(xs, style, par->params());
+
+ // label output
+ if (style.labeltype != LABEL_NO_LABEL &&
+ style.htmllabeltag() != "NONE") {
+ if (isNormalEnv(style)) {
+ // in this case, we print the label only for the first
+ // paragraph (as in a theorem).
+ if (par == pbegin) {
+ docstring const lbl =
+ pbegin->params().labelString();
+ if (!lbl.empty()) {
+ openLabelTag(xs, style);
+ xs << lbl;
+ closeLabelTag(xs, style);
+ }
+ xs.cr();
+ }
+ } else { // some kind of list
+ if (style.labeltype == LABEL_MANUAL) {
+ openLabelTag(xs, style);
+ sep = par->firstWordLyXHTML(xs, runparams);
+ closeLabelTag(xs, style);
+ xs.cr();
+ }
+ else {
+ openLabelTag(xs, style);
+ xs << par->params().labelString();
+ closeLabelTag(xs, style);
+ xs.cr();