}
+string const & InsetLayout::htmltag() const
+{
+ if (htmltag_.empty())
+ htmltag_ = "span";
+ return htmltag_;
+}
+
+
string const & InsetLayout::htmlattr() const
{
if (htmlattr_.empty())
{
if (!htmldefaultstyle_.empty())
return;
- if (!htmltag_.empty()) {
- docstring const mainfontCSS = font_.asCSS();
- if (!mainfontCSS.empty())
- htmldefaultstyle_ =
- from_ascii(htmltag() + "." + defaultCSSClass() + " {\n") +
- mainfontCSS + from_ascii("\n}\n");
- }
+ docstring const mainfontCSS = font_.asCSS();
+ if (!mainfontCSS.empty())
+ htmldefaultstyle_ =
+ from_ascii(htmltag() + "." + defaultCSSClass() + " {\n") +
+ mainfontCSS + from_ascii("\n}\n");
/*
At present, we do not have default tags, etc, for the label.
if (labelfont_ == font_)
docstring const labelfontCSS = labelfont_.asCSS();
if (!labelfontCSS.empty())
htmldefaultstyle_ +=
-. from_ascii(htmllabeltag() + "." + defaultCSSLabelClass() + " {\n") +
- labelfontCSS + from_ascii("\n}\n");
+ from_ascii(htmllabeltag() + "." + defaultCSSLabelClass() + " {\n") +
+ labelfontCSS + from_ascii("\n}\n");
*/
}
+
docstring InsetLayout::htmlstyle() const
{
if (!htmlstyle_.empty() && !htmlforcecss_)
return htmlstyle_;
- if (htmldefaultstyle_.empty())
+ if (htmldefaultstyle_.empty())
makeDefaultCSS();
docstring retval = htmldefaultstyle_;
if (!htmlstyle_.empty())
- retval += '\n' + htmlstyle_;
+ retval += '\n' + htmlstyle_ + '\n';
return retval;
}
///
docstring counter() const { return counter_; }
///
- std::string const & htmltag() const { return htmltag_; }
+ std::string const & htmltag() const;
///
std::string const & htmlattr() const;
///
docstring counter_;
///
docstring preamble_;
- /// The tag enclosing all the material in this inset. Default is none.
- std::string htmltag_;
+ /// The tag enclosing all the material in this inset. Default is "span".
+ mutable std::string htmltag_;
/// Additional attributes for inclusion with the start tag. Default (if
/// a tag is provided) is: class="name".
mutable std::string htmlattr_;