qdoc: The \br macro is promoted to a qdoc command

The \br macro, which is used to insert a line break in the output
text, is now promoted to be a qdoc command. For html, it outputs a
<br/>. For DITA XML it does nothing.

Task Nr: QTBUG-26435

Change-Id: Ie0542c9053f68473ccaa2f50ace74baa30f78dd0
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
bb10
Martin Smith 2012-07-05 10:44:34 +02:00 committed by Qt by Nokia
parent b4ed287dc3
commit 0915f189e2
5 changed files with 14 additions and 0 deletions

View File

@ -174,6 +174,7 @@ static const struct {
{ "AnnotatedList", Atom::AnnotatedList },
{ "AutoLink", Atom::AutoLink },
{ "BaseName", Atom::BaseName },
{ "br", Atom::BR},
{ "BriefLeft", Atom::BriefLeft },
{ "BriefRight", Atom::BriefRight },
{ "C", Atom::C },

View File

@ -61,6 +61,7 @@ public:
AnnotatedList,
AutoLink,
BaseName,
BR,
BriefLeft,
BriefRight,
C,

View File

@ -1277,6 +1277,9 @@ int DitaXmlGenerator::generateAtom(const Atom *atom,
}
}
break;
case Atom::BR:
// DITA XML can't do <br>
break;
case Atom::HR: //<p outputclass="horizontal-rule" />
writeStartTag(DT_p);
xmlWriter().writeAttribute("outputclass","horizontal-rule");

View File

@ -82,6 +82,7 @@ enum {
CMD_BADCODE,
CMD_BASENAME,
CMD_BOLD,
CMD_BR,
CMD_BRIEF,
CMD_C,
CMD_CAPTION,
@ -199,6 +200,7 @@ static struct {
{ "badcode", CMD_BADCODE, 0 },
{ "basename", CMD_BASENAME, 0 }, // ### don't document for now
{ "bold", CMD_BOLD, 0 },
{ "br", CMD_BR, 0 },
{ "brief", CMD_BRIEF, 0 },
{ "c", CMD_C, 0 },
{ "caption", CMD_CAPTION, 0 },
@ -644,6 +646,10 @@ void DocParser::parse(const QString& source,
leavePara();
insertBaseName(getArgument());
break;
case CMD_BR:
leavePara();
append(Atom::BR);
break;
case CMD_BOLD:
location().warning(tr("'\\bold' is deprecated. Use '\\b'"));
case CMD_B:

View File

@ -760,6 +760,9 @@ int HtmlGenerator::generateAtom(const Atom *atom,
}
}
break;
case Atom::BR:
out() << "<br />\n";
break;
case Atom::HR:
out() << "<hr />\n";
break;