mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-07 02:28:35 +00:00
Rename-XHTMLStream-to-XMLStream #3.
Fix paragraph id in xHTML output to the pre-refactoring status. Tested on math manual (plus minus nonessential newlines). Slightly modified patch from Thibaut Cuvelier.
This commit is contained in:
parent
dda35d2afd
commit
ebcaa5b1db
@ -161,15 +161,18 @@ namespace {
|
||||
// convenience functions
|
||||
|
||||
inline void openParTag(XMLStream & xs, Layout const & lay,
|
||||
std::string parlabel)
|
||||
const std::string & parlabel)
|
||||
{
|
||||
xs << xml::ParTag(lay.htmltag(), lay.htmlattr(), parlabel);
|
||||
string attrs = lay.htmlattr();
|
||||
if (!parlabel.empty())
|
||||
attrs += " id='" + parlabel + "'";
|
||||
xs << xml::ParTag(lay.htmltag(), attrs);
|
||||
}
|
||||
|
||||
|
||||
void openParTag(XMLStream & xs, Layout const & lay,
|
||||
ParagraphParameters const & params,
|
||||
std::string parlabel)
|
||||
const std::string & parlabel)
|
||||
{
|
||||
// FIXME Are there other things we should handle here?
|
||||
string const align = alignmentToCSS(params.align());
|
||||
@ -178,7 +181,9 @@ void openParTag(XMLStream & xs, Layout const & lay,
|
||||
return;
|
||||
}
|
||||
string attrs = lay.htmlattr() + " style='text-align: " + align + ";'";
|
||||
xs << xml::ParTag(lay.htmltag(), attrs, parlabel);
|
||||
if (!parlabel.empty())
|
||||
attrs += " id='" + parlabel + "'";
|
||||
xs << xml::ParTag(lay.htmltag(), attrs);
|
||||
}
|
||||
|
||||
|
||||
|
@ -247,15 +247,12 @@ struct CompTag
|
||||
|
||||
|
||||
/// A special case of StartTag, used exclusively for tags that wrap paragraphs.
|
||||
/// parid is only used for HTML output; XML is supposed to use attr for this. TODO: REMOVE PARID.
|
||||
/// parid is only used for HTML output; XML is supposed to use attr for this.
|
||||
struct ParTag : public StartTag
|
||||
{
|
||||
///
|
||||
explicit ParTag(std::string const & tag, const std::string & attr): StartTag(tag, from_utf8(attr)) {}
|
||||
///
|
||||
explicit ParTag(std::string const & tag, const std::string & attr, const std::string & parid):
|
||||
StartTag(tag, from_utf8(attr + (parid.empty() ? (" id='" + parid + "'") : ""))) {}
|
||||
///
|
||||
~ParTag() {}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user