From: Thibaut Cuvelier Date: Mon, 9 Jan 2023 00:50:05 +0000 (+0100) Subject: LyXHTML: avoid using v/align HTML attributes in tables, they are deprecated (like... X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=9ae793c6070cf31acd2e8f531b184fd6fc4a9279;p=features.git LyXHTML: avoid using v/align HTML attributes in tables, they are deprecated (like most attributes for td). Also implement alignment at character in CSS. --- diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 265a0165f8..1ec96da115 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -3798,7 +3798,7 @@ docstring Tabular::xmlRow(XMLStream & xs, const row_type row, OutputParams const if (output_format == XmlOutputFormat::XHTML) { // In HTML5, prefer to use CSS instead of attributes for alignment // (align and valign). - style << getHAlignAsCssAttribute(cell) << " " + style << getHAlignAsCssAttribute(cell) << "; " << getVAlignAsCssAttribute(cell); } else { // In DocBook, both for HTML and CALS tables, stick to attributes. @@ -3825,9 +3825,11 @@ docstring Tabular::xmlRow(XMLStream & xs, const row_type row, OutputParams const if (is_xhtml_table) { const std::vector styles = computeCssStylePerCell(row, c, cell); - std::string attr_str_prefix = "style='" ; + std::string attr_str_prefix = "style='" + style.str(); + if (!styles.empty()) + attr_str_prefix += "; "; for (auto it = styles.begin(); it != styles.end(); ++it) { - attr << *it; + attr_str_prefix += *it; if (it != styles.end() - 1) attr_str_prefix += "; "; }