<!-- This DocBook file was created by LyX 2.4.0~RC1.devel
See https://www.lyx.org/ for more information -->
<article xml:lang="en-US" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:xi="http://www.w3.org/2001/XInclude" version="5.2">
+<info>
<title>Test: InsetInfo</title>
+<date>2023-10-08</date>
+</info>
<para>Véase la <emphasis><phrase role="localized">User's Guide</phrase></emphasis> o <emphasis><phrase role="localized">Additional Features</phrase></emphasis> para más detalles.</para>
</article>
\ No newline at end of file
std::tuple<std::vector<docstring>, std::vector<docstring>, std::vector<docstring>>
Paragraph::simpleDocBookOnePar(Buffer const & buf,
- OutputParams const & runparams,
- Font const & outerfont,
- pos_type initial,
- bool is_last_par,
- bool ignore_fonts) const
+ OutputParams const & runparams,
+ Font const & outerfont,
+ pos_type initial,
+ bool is_last_par,
+ bool ignore_fonts) const
{
// Return values: segregation of the content of this paragraph.
std::vector<docstring> prependedParagraphs; // Anything that must be output before the main tag of this paragraph.
}
}
}
+ rp.lastid = id();
// State variables for the main loop.
auto xs = new XMLStream(os); // XMLStream has no copy constructor: to create a new object, the only solution
break;
}
- xml::openTag(xs, "date", "role=\"" + role + "\"", "inline");
+ // A db:date cannot be nested within a db:date. This case typically happens when the document class defines a
+ // Date layout. In this case, avoid outputting a new db:date. This means that InsetInfo cannot add a role on top
+ // of the previous db:date, hence add it as a comment. (Another solution would be an XML processing instruction,
+ // but this case is not common enough.) Adding the role to the already output tag might have consequences for
+ // some document classes where the layout already has a role or uses the same role for another purpose.
+ const bool isWithinDate = buffer().getParFromID(rp.lastid).top().paragraph().layout().docbooktag() == "date";
+
+ if (!isWithinDate)
+ xml::openTag(xs, "date", "role=\"" + role + "\"", "inline");
+ else
+ xs << XMLStream::ESCAPE_NONE << from_ascii(std::string("<!-- ") + role + " -->");
xs << qstring_to_ucs4(parseDate(buffer(), params_).toString(Qt::ISODate));
- xml::closeTag(xs, "date", "inline");
+ if (!isWithinDate)
+ xml::closeTag(xs, "date", "inline");
break;
}
}
// DocBook has no specific element for time, so use a date.
- xml::openTag(xs, "date", "(role=\"" + role + "\"", "inline");
+ // See the discussion above (DATE_INFO, MODDATE_INFO, and FIXDATE_INFO) for a discussion about the choices that
+ // have been made.
+ const bool isWithinDate = buffer().getParFromID(rp.lastid).top().paragraph().layout().docbooktag() == "date";
+
+ if (!isWithinDate)
+ xml::openTag(xs, "date", "role=\"" + role + "\"", "inline");
+ else
+ xs << XMLStream::ESCAPE_NONE << from_ascii(std::string("<!-- ") + role + " -->");
xs << qstring_to_ucs4(parseTime(buffer(), params_).toString(Qt::ISODate));
- xml::closeTag(xs, "date", "inline");
+ if (!isWithinDate)
+ xml::closeTag(xs, "date", "inline");
break;
}