diff options
author | Paul Wicking <paul.wicking@qt.io> | 2022-08-17 15:51:51 +0200 |
---|---|---|
committer | Paul Wicking <paul.wicking@qt.io> | 2022-08-18 15:11:21 +0200 |
commit | 1bc41bf8fb204e3d87f9de439159f28093ca3fd8 (patch) | |
tree | 2c389cae4381375488f603f6a1f1245863d1dfb3 /tests | |
parent | c1347a9db31fb233ac08eb0af6bd7e5769b99fc4 (diff) | |
download | qttools-1bc41bf8fb204e3d87f9de439159f28093ca3fd8.tar.gz |
QDoc: Add support for en-dash and em-dash
This patch modifies the DocParser such that QDoc will now treat two
consecutive hyphen characters (--) as markup that outputs an en dash
character, and three hyphens (---) as markup for an em dash.
As the rules governing use of en dashes and em dashes are defined by
style guides and not grammar, QDoc is left generally permissive of
their use. However, code blocks and content that is monospaced (passed
to the \c-command), must be left untouched, as otherwise, errors,
such as the mangling of the decrement operator in code snippets, could
occur.
Also ensure that the HTML QDoc generates uses the correct HTML entity
codes.
Of course, not feature of QDoc is complete without documentation.
Even though it strictly speaking isn't a command, due to the
organization of content in the QDoc manual, add documentation for en
dash and em dash sequences to the markup command section.
[ChangeLog][QDoc][QDoc now interprets -- as en dash, and --- as em dash.]
Fixes: QTBUG-105729
Change-Id: I2b6d547dcd9d8b4f1d9348f2596c7b0abc28d039
Reviewed-by: Luca Di Sera <luca.disera@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Diffstat (limited to 'tests')
18 files changed, 305 insertions, 1 deletions
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/crossmodule/testtype-members.html b/tests/auto/qdoc/generatedoutput/expected_output/crossmodule/testtype-members.html index 62c652118..b1fd053df 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/crossmodule/testtype-members.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/crossmodule/testtype-members.html @@ -17,6 +17,8 @@ <li class="fn"><span class="name"><b><a href="testqdoc-test.html#operator-eq">operator=</a></b></span>(TestQDoc::Test &&) : TestQDoc::Test &</li> <li class="fn"><span class="name"><b><a href="testqdoc-test.html#funcPtr">funcPtr</a></b></span>(bool, const char *) : void (*)(bool)</li> <li class="fn"><span class="name"><b><a href="testqdoc-test.html#inlineFunction">inlineFunction</a></b></span>()</li> +<li class="fn"><span class="name"><b><a href="testqdoc-test.html#methodWithEmDashInItsDocs">methodWithEmDashInItsDocs</a></b></span>()</li> +<li class="fn"><span class="name"><b><a href="testqdoc-test.html#methodWithEnDashInItsDocs">methodWithEnDashInItsDocs</a></b></span>()</li> <li class="fn"><span class="name"><b><a href="testtype.html#nothing">nothing</a></b></span>()</li> <li class="fn"><span class="name"><b><a href="testqdoc-test.html#overload">overload</a></b></span>()</li> <li class="fn"><span class="name"><b><a href="testqdoc-test.html#overload-1">overload</a></b></span>(bool)</li> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-test.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-test.xml index 1ff665f19..e2621fda3 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-test.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-test.xml @@ -132,6 +132,60 @@ </db:methodsynopsis> <db:para>An inline function, documented using the \fn QDoc command.</db:para> </db:section> +<db:section xml:id="methodWithEmDashInItsDocs"> +<db:title>Test::void methodWithEmDashInItsDocs()</db:title> +<db:methodsynopsis> +<db:void/> +<db:methodname>methodWithEmDashInItsDocs</db:methodname> +<db:void/> +<db:synopsisinfo role="meta">plain</db:synopsisinfo> +<db:synopsisinfo role="signature">void methodWithEmDashInItsDocs()</db:synopsisinfo> +<db:synopsisinfo role="access">public</db:synopsisinfo> +<db:synopsisinfo role="status">active</db:synopsisinfo> +<db:synopsisinfo role="threadsafeness">unspecified</db:synopsisinfo> +</db:methodsynopsis> +<db:para>This method has em dashes in its documentation—as you'll find represented by <db:code>---</db:code> in the sources—here and there. The important bit to note is that when passed e.g. to the \c command, the three hyphens are processed as input to the command and not replaced by an em dash.</db:para> +<db:para>-----------------------------------------------------------------------</db:para> +<db:para>People can still add a bunch of dashes, though, without QDoc replacing them all with a series of em dashes.</db:para> +<db:para>—You can also start a new paragraph with an em dash, if you want to.</db:para> +<db:section> +<db:title>See Also</db:title> +<db:para><db:emphasis>See also </db:emphasis> +<db:simplelist type="vert" role="see-also"> +<db:member><db:link xlink:href="testqdoc-test.xml#methodWithEnDashInItsDocs">methodWithEnDashInItsDocs</db:link></db:member> +</db:simplelist> +</db:para> +</db:section> +</db:section> +<db:section xml:id="methodWithEnDashInItsDocs"> +<db:title>Test::void methodWithEnDashInItsDocs()</db:title> +<db:methodsynopsis> +<db:void/> +<db:methodname>methodWithEnDashInItsDocs</db:methodname> +<db:void/> +<db:synopsisinfo role="meta">plain</db:synopsisinfo> +<db:synopsisinfo role="signature">void methodWithEnDashInItsDocs()</db:synopsisinfo> +<db:synopsisinfo role="access">public</db:synopsisinfo> +<db:synopsisinfo role="status">active</db:synopsisinfo> +<db:synopsisinfo role="threadsafeness">unspecified</db:synopsisinfo> +</db:methodsynopsis> +<db:para>This method has en dashes in its documentation – as you'll find represented by <db:code>--</db:code> in the sources – here and there. The important bit to note is that when passed e.g. to the \c command, the two hyphens are processed as input to the command and not replaced by an en dash. This also applies to code blocks, where otherwise, the decrement operator would get completely borked:</db:para> +<db:programlisting language="cpp">for (int i = 42; i &gt; 0; --i) + // Do something cool during countdown. +</db:programlisting> +<db:para>...as it would be silly if this would output –i instead of <db:code>--i</db:code>.</db:para> +<db:para>-----------------------------------------------------------------------</db:para> +<db:para>It still allows people to add a bunch of dashes, though, without replacing them all with a series of en dashes. Of course, they might want to use the \hr command instead, like this:</db:para> +<db:para>– You can also start a new paragraph with an en dash, if you want to.</db:para> +<db:section> +<db:title>See Also</db:title> +<db:para><db:emphasis>See also </db:emphasis> +<db:simplelist type="vert" role="see-also"> +<db:member><db:link xlink:href="">methodWithEnDashInItsDocs</db:link></db:member> +</db:simplelist> +</db:para> +</db:section> +</db:section> <db:section xml:id="someFunction"> <db:title>Test::int someFunction(<db:emphasis>int</db:emphasis>, int <db:emphasis>v</db:emphasis> = 0)</db:title> <db:methodsynopsis> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/dontdocument/dontdocument.qhp b/tests/auto/qdoc/generatedoutput/expected_output/dontdocument/dontdocument.qhp index 863a9385c..ea65e2673 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/dontdocument/dontdocument.qhp +++ b/tests/auto/qdoc/generatedoutput/expected_output/dontdocument/dontdocument.qhp @@ -39,6 +39,8 @@ <keyword name="documentMe" id="CrossModuleRef::documentMe" ref="crossmoduleref.html#documentMe"/> <keyword name="funcPtr" id="Test::funcPtr" ref="testqdoc-test.html#funcPtr"/> <keyword name="inlineFunction" id="Test::inlineFunction" ref="testqdoc-test.html#inlineFunction"/> + <keyword name="methodWithEmDashInItsDocs" id="Test::methodWithEmDashInItsDocs" ref="testqdoc-test.html#methodWithEmDashInItsDocs"/> + <keyword name="methodWithEnDashInItsDocs" id="Test::methodWithEnDashInItsDocs" ref="testqdoc-test.html#methodWithEnDashInItsDocs"/> <keyword name="obsoleteMember" id="Test::obsoleteMember" ref="testqdoc-test-obsolete.html#obsoleteMember"/> <keyword name="operator++" id="Test::operator++" ref="testqdoc-test-obsolete.html#operator-2b-2b"/> <keyword name="operator--" id="Test::operator--" ref="testqdoc-test-obsolete.html#operator--"/> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-test.webxml b/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-test.webxml index cc10b9fda..1ca66b6fc 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-test.webxml +++ b/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-test.webxml @@ -38,6 +38,29 @@ <brief>An inline function, documented using the \fn QDoc command.</brief> </description> </function> + <function name="methodWithEmDashInItsDocs" fullname="TestQDoc::Test::methodWithEmDashInItsDocs" href="testqdoc-test.html#methodWithEmDashInItsDocs" status="active" access="public" location="testcpp.h" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void methodWithEmDashInItsDocs()"> + <description> + <para>This method has em dashes in its documentation—as you'll find represented by <teletype type="highlighted">---</teletype> in the sources—here and there. The important bit to note is that when passed e.g. to the \c command, the three hyphens are processed as input to the command and not replaced by an em dash.</para> + <para>-----------------------------------------------------------------------</para> + <para>People can still add a bunch of dashes, though, without QDoc replacing them all with a series of em dashes.</para> + <para>—You can also start a new paragraph with an em dash, if you want to.</para> + <see-also> + <link raw="methodWithEnDashInItsDocs" href="testqdoc-test.html#methodWithEnDashInItsDocs" type="function">methodWithEnDashInItsDocs</link> + </see-also> + </description> + </function> + <function name="methodWithEnDashInItsDocs" fullname="TestQDoc::Test::methodWithEnDashInItsDocs" href="testqdoc-test.html#methodWithEnDashInItsDocs" status="active" access="public" location="testcpp.h" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void methodWithEnDashInItsDocs()"> + <description> + <para>This method has en dashes in its documentation – as you'll find represented by <teletype type="highlighted">--</teletype> in the sources – here and there. The important bit to note is that when passed e.g. to the \c command, the two hyphens are processed as input to the command and not replaced by an en dash. This also applies to code blocks, where otherwise, the decrement operator would get completely borked:</para> + <code>for (int i = 42; i > 0; --i) + // Do something cool during countdown.</code> + <para>...as it would be silly if this would output –i instead of <teletype type="highlighted">--i</teletype>.</para> + <para>-----------------------------------------------------------------------</para> + <para>It still allows people to add a bunch of dashes, though, without replacing them all with a series of en dashes. Of course, they might want to use the \hr command instead, like this:</para> + <para>– You can also start a new paragraph with an en dash, if you want to.</para> + <see-also>methodWithEnDashInItsDocs</see-also> + </description> + </function> <function name="obsoleteMember" fullname="TestQDoc::Test::obsoleteMember" href="testqdoc-test-obsolete.html#obsoleteMember" status="deprecated" access="public" location="testcpp.h" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void obsoleteMember()"> <description> <para>Use <link raw="someFunction()" href="testqdoc-test.html#someFunction" type="function">someFunction()</link> instead.</para> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/ignoresince/testqdoc-test.html b/tests/auto/qdoc/generatedoutput/expected_output/ignoresince/testqdoc-test.html index 19f03ff51..51e4c8554 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/ignoresince/testqdoc-test.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/ignoresince/testqdoc-test.html @@ -50,6 +50,8 @@ target_link_libraries(mytarget PRIVATE Qt6::QDocTest)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> TestQDoc::Test &</td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#operator-eq">operator=</a></b>(TestQDoc::Test &&<i>other</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void (*)(bool) </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#funcPtr">funcPtr</a></b>(bool <i>b</i>, const char *<i>s</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#inlineFunction">inlineFunction</a></b>()</td></tr> +<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#methodWithEmDashInItsDocs">methodWithEmDashInItsDocs</a></b>()</td></tr> +<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#methodWithEnDashInItsDocs">methodWithEnDashInItsDocs</a></b>()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#someFunction">someFunction</a></b>(int, int <i>v</i> = 0)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#someFunctionDefaultArg">someFunctionDefaultArg</a></b>(int <i>i</i>, bool <i>b</i> = false)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#virtualFun">virtualFun</a></b>()</td></tr> @@ -102,6 +104,26 @@ target_link_libraries(mytarget PRIVATE Qt6::QDocTest)</td></tr> <h3 class="fn" id="inlineFunction"><span class="type">void</span> Test::<span class="name">inlineFunction</span>()</h3> <p>An inline function, documented using the \fn QDoc command.</p> <!-- @@@inlineFunction --> +<!-- $$$methodWithEmDashInItsDocs[overload1]$$$methodWithEmDashInItsDocs --> +<h3 class="fn" id="methodWithEmDashInItsDocs"><span class="type">void</span> Test::<span class="name">methodWithEmDashInItsDocs</span>()</h3> +<p>This method has em dashes in its documentation—as you'll find represented by <code>---</code> in the sources—here and there. The important bit to note is that when passed e.g. to the \c command, the three hyphens are processed as input to the command and not replaced by an em dash.</p> +<p>-----------------------------------------------------------------------</p> +<p>People can still add a bunch of dashes, though, without QDoc replacing them all with a series of em dashes.</p> +<p>—You can also start a new paragraph with an em dash, if you want to.</p> +<p><b>See also </b><a href="testqdoc-test.html#methodWithEnDashInItsDocs">methodWithEnDashInItsDocs</a>.</p> +<!-- @@@methodWithEmDashInItsDocs --> +<!-- $$$methodWithEnDashInItsDocs[overload1]$$$methodWithEnDashInItsDocs --> +<h3 class="fn" id="methodWithEnDashInItsDocs"><span class="type">void</span> Test::<span class="name">methodWithEnDashInItsDocs</span>()</h3> +<p>This method has en dashes in its documentation – as you'll find represented by <code>--</code> in the sources – here and there. The important bit to note is that when passed e.g. to the \c command, the two hyphens are processed as input to the command and not replaced by an en dash. This also applies to code blocks, where otherwise, the decrement operator would get completely borked:</p> +<pre class="cpp"><span class="keyword">for</span> (<span class="type">int</span> i <span class="operator">=</span> <span class="number">42</span>; i <span class="operator">></span> <span class="number">0</span>; <span class="operator">-</span><span class="operator">-</span>i) + <span class="comment">// Do something cool during countdown.</span></pre> +<p>...as it would be silly if this would output –i instead of <code>--i</code>.</p> +<p>-----------------------------------------------------------------------</p> +<p>It still allows people to add a bunch of dashes, though, without replacing them all with a series of en dashes. Of course, they might want to use the \hr command instead, like this:</p> +<hr /> +<p>– You can also start a new paragraph with an en dash, if you want to.</p> +<p><b>See also </b>methodWithEnDashInItsDocs.</p> +<!-- @@@methodWithEnDashInItsDocs --> <!-- $$$someFunction[overload1]$$$someFunctionintint --> <h3 class="fn" id="someFunction"><code>[since Test 1.0] </code><span class="type">int</span> Test::<span class="name">someFunction</span>(<span class="type">int</span>, <span class="type">int</span> <i>v</i> = 0)</h3> <p>Function that takes a parameter <i>v</i>. Also returns the value of <i>v</i>.</p> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/properties/testcpp.index b/tests/auto/qdoc/generatedoutput/expected_output/properties/testcpp.index index 7d0681242..5a6c80244 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/properties/testcpp.index +++ b/tests/auto/qdoc/generatedoutput/expected_output/properties/testcpp.index @@ -33,6 +33,8 @@ <parameter type="const char *" name="s" default=""/> </function> <function name="inlineFunction" fullname="TestQDoc::Test::inlineFunction" href="testqdoc-test.html#inlineFunction" status="active" access="public" location="testcpp.h" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" brief="An inline function, documented using the \fn QDoc command" signature="void inlineFunction()"/> + <function name="methodWithEmDashInItsDocs" fullname="TestQDoc::Test::methodWithEmDashInItsDocs" href="testqdoc-test.html#methodWithEmDashInItsDocs" status="active" access="public" location="testcpp.h" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void methodWithEmDashInItsDocs()"/> + <function name="methodWithEnDashInItsDocs" fullname="TestQDoc::Test::methodWithEnDashInItsDocs" href="testqdoc-test.html#methodWithEnDashInItsDocs" status="active" access="public" location="testcpp.h" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void methodWithEnDashInItsDocs()"/> <function name="obsoleteMember" fullname="TestQDoc::Test::obsoleteMember" href="testqdoc-test-obsolete.html#obsoleteMember" status="deprecated" access="public" location="testcpp.h" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void obsoleteMember()"/> <function name="operator++" fullname="TestQDoc::Test::operator++" href="testqdoc-test-obsolete.html#operator-2b-2b" status="deprecated" access="public" location="testcpp.h" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="TestQDoc::Test &" signature="TestQDoc::Test & operator++()"/> <function name="operator--" fullname="TestQDoc::Test::operator--" href="testqdoc-test-obsolete.html#operator--" status="deprecated" access="public" location="testcpp.h" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="TestQDoc::Test &" signature="TestQDoc::Test & operator--()"/> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/properties/testqdoc-testderived-members.html b/tests/auto/qdoc/generatedoutput/expected_output/properties/testqdoc-testderived-members.html index 969a7a097..1b44180f9 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/properties/testqdoc-testderived-members.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/properties/testqdoc-testderived-members.html @@ -26,11 +26,13 @@ <li class="fn"><span class="name"><b><a href="testqdoc-testderived.html#bindableProp-prop">bindableProp</a></b></span>() : QBindable<QString></li> <li class="fn"><span class="name"><b><a href="testqdoc-testderived.html#boolProp-prop">boolProp</a></b></span>() : bool</li> <li class="fn"><span class="name"><b><a href="testqdoc-test.html#funcPtr">funcPtr</a></b></span>(bool, const char *) : void (*)(bool)</li> -</ul></td><td class="topAlign"><ul> <li class="fn"><span class="name"><b><a href="testqdoc-testderived.html#intProp-prop">getInt</a></b></span>() : int *</li> +</ul></td><td class="topAlign"><ul> <li class="fn"><span class="name"><b><a href="testqdoc-testderived.html#id">id</a></b></span>() : int</li> <li class="fn"><span class="name"><b><a href="testqdoc-test.html#inlineFunction">inlineFunction</a></b></span>()</li> <li class="fn"><span class="name"><b><a href="testqdoc-testderived.html#invokeMe">invokeMe</a></b></span>() const</li> +<li class="fn"><span class="name"><b><a href="testqdoc-test.html#methodWithEmDashInItsDocs">methodWithEmDashInItsDocs</a></b></span>()</li> +<li class="fn"><span class="name"><b><a href="testqdoc-test.html#methodWithEnDashInItsDocs">methodWithEnDashInItsDocs</a></b></span>()</li> <li class="fn"><span class="name"><b><a href="testqdoc-testderived.html#name-prop">name</a></b></span>() const : const QString *</li> <li class="fn"><span class="name"><b><a href="testqdoc-test.html#overload">overload</a></b></span>()</li> <li class="fn"><span class="name"><b><a href="testqdoc-test.html#overload-1">overload</a></b></span>(bool)</li> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/scopedenum-docbook/testqdoc-test.xml b/tests/auto/qdoc/generatedoutput/expected_output/scopedenum-docbook/testqdoc-test.xml index 94c3d99d1..8ad796926 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/scopedenum-docbook/testqdoc-test.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/scopedenum-docbook/testqdoc-test.xml @@ -229,6 +229,60 @@ </db:methodsynopsis> <db:para>An inline function, documented using the \fn QDoc command.</db:para> </db:section> +<db:section xml:id="methodWithEmDashInItsDocs"> +<db:title>Test::void methodWithEmDashInItsDocs()</db:title> +<db:methodsynopsis> +<db:void/> +<db:methodname>methodWithEmDashInItsDocs</db:methodname> +<db:void/> +<db:synopsisinfo role="meta">plain</db:synopsisinfo> +<db:synopsisinfo role="signature">void methodWithEmDashInItsDocs()</db:synopsisinfo> +<db:synopsisinfo role="access">public</db:synopsisinfo> +<db:synopsisinfo role="status">active</db:synopsisinfo> +<db:synopsisinfo role="threadsafeness">unspecified</db:synopsisinfo> +</db:methodsynopsis> +<db:para>This method has em dashes in its documentation—as you'll find represented by <db:code>---</db:code> in the sources—here and there. The important bit to note is that when passed e.g. to the \c command, the three hyphens are processed as input to the command and not replaced by an em dash.</db:para> +<db:para>-----------------------------------------------------------------------</db:para> +<db:para>People can still add a bunch of dashes, though, without QDoc replacing them all with a series of em dashes.</db:para> +<db:para>—You can also start a new paragraph with an em dash, if you want to.</db:para> +<db:section> +<db:title>See Also</db:title> +<db:para><db:emphasis>See also </db:emphasis> +<db:simplelist type="vert" role="see-also"> +<db:member><db:link xlink:href="testqdoc-test.xml#methodWithEnDashInItsDocs">methodWithEnDashInItsDocs</db:link></db:member> +</db:simplelist> +</db:para> +</db:section> +</db:section> +<db:section xml:id="methodWithEnDashInItsDocs"> +<db:title>Test::void methodWithEnDashInItsDocs()</db:title> +<db:methodsynopsis> +<db:void/> +<db:methodname>methodWithEnDashInItsDocs</db:methodname> +<db:void/> +<db:synopsisinfo role="meta">plain</db:synopsisinfo> +<db:synopsisinfo role="signature">void methodWithEnDashInItsDocs()</db:synopsisinfo> +<db:synopsisinfo role="access">public</db:synopsisinfo> +<db:synopsisinfo role="status">active</db:synopsisinfo> +<db:synopsisinfo role="threadsafeness">unspecified</db:synopsisinfo> +</db:methodsynopsis> +<db:para>This method has en dashes in its documentation – as you'll find represented by <db:code>--</db:code> in the sources – here and there. The important bit to note is that when passed e.g. to the \c command, the two hyphens are processed as input to the command and not replaced by an en dash. This also applies to code blocks, where otherwise, the decrement operator would get completely borked:</db:para> +<db:programlisting language="cpp">for (int i = 42; i &gt; 0; --i) + // Do something cool during countdown. +</db:programlisting> +<db:para>...as it would be silly if this would output –i instead of <db:code>--i</db:code>.</db:para> +<db:para>-----------------------------------------------------------------------</db:para> +<db:para>It still allows people to add a bunch of dashes, though, without replacing them all with a series of en dashes. Of course, they might want to use the \hr command instead, like this:</db:para> +<db:para>– You can also start a new paragraph with an en dash, if you want to.</db:para> +<db:section> +<db:title>See Also</db:title> +<db:para><db:emphasis>See also </db:emphasis> +<db:simplelist type="vert" role="see-also"> +<db:member><db:link xlink:href="">methodWithEnDashInItsDocs</db:link></db:member> +</db:simplelist> +</db:para> +</db:section> +</db:section> <db:section xml:id="someFunction"> <db:title>Test::int someFunction(<db:emphasis>int</db:emphasis>, int <db:emphasis>v</db:emphasis> = 0)</db:title> <db:methodsynopsis> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/scopedenum/testqdoc-test.html b/tests/auto/qdoc/generatedoutput/expected_output/scopedenum/testqdoc-test.html index 82fea5bd3..13e1604e7 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/scopedenum/testqdoc-test.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/scopedenum/testqdoc-test.html @@ -52,6 +52,8 @@ target_link_libraries(mytarget PRIVATE Qt6::QDocTest)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> TestQDoc::Test &</td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#operator-eq">operator=</a></b>(TestQDoc::Test &&<i>other</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void (*)(bool) </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#funcPtr">funcPtr</a></b>(bool <i>b</i>, const char *<i>s</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#inlineFunction">inlineFunction</a></b>()</td></tr> +<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#methodWithEmDashInItsDocs">methodWithEmDashInItsDocs</a></b>()</td></tr> +<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#methodWithEnDashInItsDocs">methodWithEnDashInItsDocs</a></b>()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#someFunction">someFunction</a></b>(int, int <i>v</i> = 0)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#someFunctionDefaultArg">someFunctionDefaultArg</a></b>(int <i>i</i>, bool <i>b</i> = false)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#virtualFun">virtualFun</a></b>()</td></tr> @@ -122,6 +124,26 @@ target_link_libraries(mytarget PRIVATE Qt6::QDocTest)</td></tr> <h3 class="fn" id="inlineFunction"><span class="type">void</span> Test::<span class="name">inlineFunction</span>()</h3> <p>An inline function, documented using the \fn QDoc command.</p> <!-- @@@inlineFunction --> +<!-- $$$methodWithEmDashInItsDocs[overload1]$$$methodWithEmDashInItsDocs --> +<h3 class="fn" id="methodWithEmDashInItsDocs"><span class="type">void</span> Test::<span class="name">methodWithEmDashInItsDocs</span>()</h3> +<p>This method has em dashes in its documentation—as you'll find represented by <code>---</code> in the sources—here and there. The important bit to note is that when passed e.g. to the \c command, the three hyphens are processed as input to the command and not replaced by an em dash.</p> +<p>-----------------------------------------------------------------------</p> +<p>People can still add a bunch of dashes, though, without QDoc replacing them all with a series of em dashes.</p> +<p>—You can also start a new paragraph with an em dash, if you want to.</p> +<p><b>See also </b><a href="testqdoc-test.html#methodWithEnDashInItsDocs">methodWithEnDashInItsDocs</a>.</p> +<!-- @@@methodWithEmDashInItsDocs --> +<!-- $$$methodWithEnDashInItsDocs[overload1]$$$methodWithEnDashInItsDocs --> +<h3 class="fn" id="methodWithEnDashInItsDocs"><span class="type">void</span> Test::<span class="name">methodWithEnDashInItsDocs</span>()</h3> +<p>This method has en dashes in its documentation – as you'll find represented by <code>--</code> in the sources – here and there. The important bit to note is that when passed e.g. to the \c command, the two hyphens are processed as input to the command and not replaced by an en dash. This also applies to code blocks, where otherwise, the decrement operator would get completely borked:</p> +<pre class="cpp"><span class="keyword">for</span> (<span class="type">int</span> i <span class="operator">=</span> <span class="number">42</span>; i <span class="operator">></span> <span class="number">0</span>; <span class="operator">-</span><span class="operator">-</span>i) + <span class="comment">// Do something cool during countdown.</span></pre> +<p>...as it would be silly if this would output –i instead of <code>--i</code>.</p> +<p>-----------------------------------------------------------------------</p> +<p>It still allows people to add a bunch of dashes, though, without replacing them all with a series of en dashes. Of course, they might want to use the \hr command instead, like this:</p> +<hr /> +<p>– You can also start a new paragraph with an en dash, if you want to.</p> +<p><b>See also </b>methodWithEnDashInItsDocs.</p> +<!-- @@@methodWithEnDashInItsDocs --> <!-- $$$someFunction[overload1]$$$someFunctionintint --> <h3 class="fn" id="someFunction"><span class="type">int</span> Test::<span class="name">someFunction</span>(<span class="type">int</span>, <span class="type">int</span> <i>v</i> = 0)</h3> <p>Function that takes a parameter <i>v</i>. Also returns the value of <i>v</i>.</p> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/template/testqdoc-test.html b/tests/auto/qdoc/generatedoutput/expected_output/template/testqdoc-test.html index b945d3675..ddaf16b95 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/template/testqdoc-test.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/template/testqdoc-test.html @@ -52,6 +52,8 @@ target_link_libraries(mytarget PRIVATE Qt6::QDocTest)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> TestQDoc::Test &</td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#operator-eq">operator=</a></b>(TestQDoc::Test &&<i>other</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void (*)(bool) </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#funcPtr">funcPtr</a></b>(bool <i>b</i>, const char *<i>s</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#inlineFunction">inlineFunction</a></b>()</td></tr> +<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#methodWithEmDashInItsDocs">methodWithEmDashInItsDocs</a></b>()</td></tr> +<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#methodWithEnDashInItsDocs">methodWithEnDashInItsDocs</a></b>()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#someFunction">someFunction</a></b>(int, int <i>v</i> = 0)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#someFunctionDefaultArg">someFunctionDefaultArg</a></b>(int <i>i</i>, bool <i>b</i> = false)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#virtualFun">virtualFun</a></b>()</td></tr> @@ -113,6 +115,26 @@ target_link_libraries(mytarget PRIVATE Qt6::QDocTest)</td></tr> <h3 class="fn" id="inlineFunction"><span class="type">void</span> Test::<span class="name">inlineFunction</span>()</h3> <p>An inline function, documented using the \fn QDoc command.</p> <!-- @@@inlineFunction --> +<!-- $$$methodWithEmDashInItsDocs[overload1]$$$methodWithEmDashInItsDocs --> +<h3 class="fn" id="methodWithEmDashInItsDocs"><span class="type">void</span> Test::<span class="name">methodWithEmDashInItsDocs</span>()</h3> +<p>This method has em dashes in its documentation—as you'll find represented by <code>---</code> in the sources—here and there. The important bit to note is that when passed e.g. to the \c command, the three hyphens are processed as input to the command and not replaced by an em dash.</p> +<p>-----------------------------------------------------------------------</p> +<p>People can still add a bunch of dashes, though, without QDoc replacing them all with a series of em dashes.</p> +<p>—You can also start a new paragraph with an em dash, if you want to.</p> +<p><b>See also </b><a href="testqdoc-test.html#methodWithEnDashInItsDocs">methodWithEnDashInItsDocs</a>.</p> +<!-- @@@methodWithEmDashInItsDocs --> +<!-- $$$methodWithEnDashInItsDocs[overload1]$$$methodWithEnDashInItsDocs --> +<h3 class="fn" id="methodWithEnDashInItsDocs"><span class="type">void</span> Test::<span class="name">methodWithEnDashInItsDocs</span>()</h3> +<p>This method has en dashes in its documentation – as you'll find represented by <code>--</code> in the sources – here and there. The important bit to note is that when passed e.g. to the \c command, the two hyphens are processed as input to the command and not replaced by an en dash. This also applies to code blocks, where otherwise, the decrement operator would get completely borked:</p> +<pre class="cpp"><span class="keyword">for</span> (<span class="type">int</span> i <span class="operator">=</span> <span class="number">42</span>; i <span class="operator">></span> <span class="number">0</span>; <span class="operator">-</span><span class="operator">-</span>i) + <span class="comment">// Do something cool during countdown.</span></pre> +<p>...as it would be silly if this would output –i instead of <code>--i</code>.</p> +<p>-----------------------------------------------------------------------</p> +<p>It still allows people to add a bunch of dashes, though, without replacing them all with a series of en dashes. Of course, they might want to use the \hr command instead, like this:</p> +<hr /> +<p>– You can also start a new paragraph with an en dash, if you want to.</p> +<p><b>See also </b>methodWithEnDashInItsDocs.</p> +<!-- @@@methodWithEnDashInItsDocs --> <!-- $$$someFunction[overload1]$$$someFunctionintint --> <h3 class="fn" id="someFunction"><span class="type">int</span> Test::<span class="name">someFunction</span>(<span class="type">int</span>, <span class="type">int</span> <i>v</i> = 0)</h3> <p>Function that takes a parameter <i>v</i>. Also returns the value of <i>v</i>.</p> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/test.qhp b/tests/auto/qdoc/generatedoutput/expected_output/test.qhp index b1b1670cd..ebfea03b0 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/test.qhp +++ b/tests/auto/qdoc/generatedoutput/expected_output/test.qhp @@ -128,6 +128,8 @@ <keyword name="int" id="QML.int" ref="qml-int.html"/> <keyword name="itsHappening" id="DocTest::itsHappening" ref="qml-qdoc-test-doctest.html#itsHappening-signal"/> <keyword name="maximum" id="ProgressBar::maximum" ref="qml-uicomponents-progressbar.html#maximum-prop"/> + <keyword name="methodWithEmDashInItsDocs" id="Test::methodWithEmDashInItsDocs" ref="testqdoc-test.html#methodWithEmDashInItsDocs"/> + <keyword name="methodWithEnDashInItsDocs" id="Test::methodWithEnDashInItsDocs" ref="testqdoc-test.html#methodWithEnDashInItsDocs"/> <keyword name="minimum" id="ProgressBar::minimum" ref="qml-uicomponents-progressbar.html#minimum-prop"/> <keyword name="name" id="AbstractParent::name" ref="qml-qdoc-test-abstractparent.html#name-method"/> <keyword name="name" id="AbstractParent::name" ref="qml-qdoc-test-abstractparent.html#name-prop"/> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/testcpp.index b/tests/auto/qdoc/generatedoutput/expected_output/testcpp.index index f2adc6c1f..8f814f37c 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/testcpp.index +++ b/tests/auto/qdoc/generatedoutput/expected_output/testcpp.index @@ -32,6 +32,8 @@ <parameter type="const char *" name="s" default=""/> </function> <function name="inlineFunction" fullname="TestQDoc::Test::inlineFunction" href="testqdoc-test.html#inlineFunction" status="active" access="public" location="testcpp.h" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" brief="An inline function, documented using the \fn QDoc command" signature="void inlineFunction()"/> + <function name="methodWithEmDashInItsDocs" fullname="TestQDoc::Test::methodWithEmDashInItsDocs" href="testqdoc-test.html#methodWithEmDashInItsDocs" status="active" access="public" location="testcpp.h" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void methodWithEmDashInItsDocs()"/> + <function name="methodWithEnDashInItsDocs" fullname="TestQDoc::Test::methodWithEnDashInItsDocs" href="testqdoc-test.html#methodWithEnDashInItsDocs" status="active" access="public" location="testcpp.h" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void methodWithEnDashInItsDocs()"/> <function name="obsoleteMember" fullname="TestQDoc::Test::obsoleteMember" href="testqdoc-test-obsolete.html#obsoleteMember" status="deprecated" access="public" location="testcpp.h" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void obsoleteMember()"/> <function name="operator++" fullname="TestQDoc::Test::operator++" href="testqdoc-test-obsolete.html#operator-2b-2b" status="deprecated" access="public" location="testcpp.h" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="TestQDoc::Test &" signature="TestQDoc::Test & operator++()"/> <function name="operator--" fullname="TestQDoc::Test::operator--" href="testqdoc-test-obsolete.html#operator--" status="deprecated" access="public" location="testcpp.h" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="TestQDoc::Test &" signature="TestQDoc::Test & operator--()"/> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test-members.html b/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test-members.html index 47a084d27..fc136570e 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test-members.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test-members.html @@ -17,6 +17,8 @@ <li class="fn"><span class="name"><b><a href="testqdoc-test.html#operator-eq">operator=</a></b></span>(TestQDoc::Test &&) : TestQDoc::Test &</li> <li class="fn"><span class="name"><b><a href="testqdoc-test.html#funcPtr">funcPtr</a></b></span>(bool, const char *) : void (*)(bool)</li> <li class="fn"><span class="name"><b><a href="testqdoc-test.html#inlineFunction">inlineFunction</a></b></span>()</li> +<li class="fn"><span class="name"><b><a href="testqdoc-test.html#methodWithEmDashInItsDocs">methodWithEmDashInItsDocs</a></b></span>()</li> +<li class="fn"><span class="name"><b><a href="testqdoc-test.html#methodWithEnDashInItsDocs">methodWithEnDashInItsDocs</a></b></span>()</li> <li class="fn"><span class="name"><b><a href="testqdoc-test.html#overload">overload</a></b></span>()</li> <li class="fn"><span class="name"><b><a href="testqdoc-test.html#overload-1">overload</a></b></span>(bool)</li> <li class="fn"><span class="name"><b><a href="testqdoc-test.html#someFunction">someFunction</a></b></span>(int, int) : int</li> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test.html b/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test.html index 356084958..7b047ee39 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test.html @@ -50,6 +50,8 @@ target_link_libraries(mytarget PRIVATE Qt6::QDocTest)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> TestQDoc::Test &</td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#operator-eq">operator=</a></b>(TestQDoc::Test &&<i>other</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void (*)(bool) </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#funcPtr">funcPtr</a></b>(bool <i>b</i>, const char *<i>s</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#inlineFunction">inlineFunction</a></b>()</td></tr> +<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#methodWithEmDashInItsDocs">methodWithEmDashInItsDocs</a></b>()</td></tr> +<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#methodWithEnDashInItsDocs">methodWithEnDashInItsDocs</a></b>()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#someFunction">someFunction</a></b>(int, int <i>v</i> = 0)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#someFunctionDefaultArg">someFunctionDefaultArg</a></b>(int <i>i</i>, bool <i>b</i> = false)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#virtualFun">virtualFun</a></b>()</td></tr> @@ -102,6 +104,26 @@ target_link_libraries(mytarget PRIVATE Qt6::QDocTest)</td></tr> <h3 class="fn" id="inlineFunction"><span class="type">void</span> Test::<span class="name">inlineFunction</span>()</h3> <p>An inline function, documented using the \fn QDoc command.</p> <!-- @@@inlineFunction --> +<!-- $$$methodWithEmDashInItsDocs[overload1]$$$methodWithEmDashInItsDocs --> +<h3 class="fn" id="methodWithEmDashInItsDocs"><span class="type">void</span> Test::<span class="name">methodWithEmDashInItsDocs</span>()</h3> +<p>This method has em dashes in its documentation—as you'll find represented by <code>---</code> in the sources—here and there. The important bit to note is that when passed e.g. to the \c command, the three hyphens are processed as input to the command and not replaced by an em dash.</p> +<p>-----------------------------------------------------------------------</p> +<p>People can still add a bunch of dashes, though, without QDoc replacing them all with a series of em dashes.</p> +<p>—You can also start a new paragraph with an em dash, if you want to.</p> +<p><b>See also </b><a href="testqdoc-test.html#methodWithEnDashInItsDocs">methodWithEnDashInItsDocs</a>.</p> +<!-- @@@methodWithEmDashInItsDocs --> +<!-- $$$methodWithEnDashInItsDocs[overload1]$$$methodWithEnDashInItsDocs --> +<h3 class="fn" id="methodWithEnDashInItsDocs"><span class="type">void</span> Test::<span class="name">methodWithEnDashInItsDocs</span>()</h3> +<p>This method has en dashes in its documentation – as you'll find represented by <code>--</code> in the sources – here and there. The important bit to note is that when passed e.g. to the \c command, the two hyphens are processed as input to the command and not replaced by an en dash. This also applies to code blocks, where otherwise, the decrement operator would get completely borked:</p> +<pre class="cpp"><span class="keyword">for</span> (<span class="type">int</span> i <span class="operator">=</span> <span class="number">42</span>; i <span class="operator">></span> <span class="number">0</span>; <span class="operator">-</span><span class="operator">-</span>i) + <span class="comment">// Do something cool during countdown.</span></pre> +<p>...as it would be silly if this would output –i instead of <code>--i</code>.</p> +<p>-----------------------------------------------------------------------</p> +<p>It still allows people to add a bunch of dashes, though, without replacing them all with a series of en dashes. Of course, they might want to use the \hr command instead, like this:</p> +<hr /> +<p>– You can also start a new paragraph with an en dash, if you want to.</p> +<p><b>See also </b>methodWithEnDashInItsDocs.</p> +<!-- @@@methodWithEnDashInItsDocs --> <!-- $$$someFunction[overload1]$$$someFunctionintint --> <h3 class="fn" id="someFunction"><span class="type">int</span> Test::<span class="name">someFunction</span>(<span class="type">int</span>, <span class="type">int</span> <i>v</i> = 0)</h3> <p>Function that takes a parameter <i>v</i>. Also returns the value of <i>v</i>.</p> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-testderived-members.html b/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-testderived-members.html index be85e8146..1312856c2 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-testderived-members.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-testderived-members.html @@ -18,6 +18,8 @@ <li class="fn"><span class="name"><b><a href="testqdoc-test.html#operator-eq">operator=</a></b></span>(TestQDoc::Test &&) : TestQDoc::Test &</li> <li class="fn"><span class="name"><b><a href="testqdoc-test.html#funcPtr">funcPtr</a></b></span>(bool, const char *) : void (*)(bool)</li> <li class="fn"><span class="name"><b><a href="testqdoc-test.html#inlineFunction">inlineFunction</a></b></span>()</li> +<li class="fn"><span class="name"><b><a href="testqdoc-test.html#methodWithEmDashInItsDocs">methodWithEmDashInItsDocs</a></b></span>()</li> +<li class="fn"><span class="name"><b><a href="testqdoc-test.html#methodWithEnDashInItsDocs">methodWithEnDashInItsDocs</a></b></span>()</li> <li class="fn"><span class="name"><b><a href="testqdoc-test.html#overload">overload</a></b></span>()</li> <li class="fn"><span class="name"><b><a href="testqdoc-test.html#overload-1">overload</a></b></span>(bool)</li> <li class="fn"><span class="name"><b><a href="testqdoc-test.html#someFunction">someFunction</a></b></span>(int, int) : int</li> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/testtagfile.tags b/tests/auto/qdoc/generatedoutput/expected_output/testtagfile.tags index 7cb8447aa..891909786 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/testtagfile.tags +++ b/tests/auto/qdoc/generatedoutput/expected_output/testtagfile.tags @@ -200,6 +200,20 @@ </member> <member kind="function" protection="public" virtualness="non" static="no"> <type>void</type> + <name>methodWithEmDashInItsDocs</name> + <anchorfile>testqdoc-test.html</anchorfile> + <anchor>methodWithEmDashInItsDocs</anchor> + <arglist>()</arglist> + </member> + <member kind="function" protection="public" virtualness="non" static="no"> + <type>void</type> + <name>methodWithEnDashInItsDocs</name> + <anchorfile>testqdoc-test.html</anchorfile> + <anchor>methodWithEnDashInItsDocs</anchor> + <arglist>()</arglist> + </member> + <member kind="function" protection="public" virtualness="non" static="no"> + <type>void</type> <name>obsoleteMember</name> <anchorfile>testqdoc-test-obsolete.html</anchorfile> <anchor>obsoleteMember</anchor> diff --git a/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp b/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp index a01181399..3bb0e6b07 100644 --- a/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp +++ b/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp @@ -168,6 +168,59 @@ void Test::someFunctionDefaultArg(int i, bool b = false) \deprecated */ +/*! + This method has en dashes in its documentation -- as you'll find + represented by \c{--} in the sources -- here and there. The important bit + to note is that when passed e.g. to the \\c command, the two hyphens are + processed as input to the command and not replaced by an en dash. This also + applies to code blocks, where otherwise, the decrement operator would get + completely borked: + + \code + for (int i = 42; i > 0; --i) + // Do something cool during countdown. + \endcode + + ...as it would be silly if this would output --i instead of \c {--i}. + + ----------------------------------------------------------------------- + + It still allows people to add a bunch of dashes, though, without replacing + them all with a series of en dashes. Of course, they might want to use the + \\hr command instead, like this: + \hr + + -- You can also start a new paragraph with an en dash, if you want to. + + //! Self-referencing \sa-command for tests. + \sa methodWithEnDashInItsDocs +*/ +void Test::methodWithEnDashInItsDocs() +{ + // Nothing to see here. +} + +/*! + This method has em dashes in its documentation---as you'll find + represented by \c{---} in the sources---here and there. The important bit + to note is that when passed e.g. to the \\c command, the three hyphens are + processed as input to the command and not replaced by an em dash. + + ----------------------------------------------------------------------- + + People can still add a bunch of dashes, though, without QDoc replacing + them all with a series of em dashes. + + ---You can also start a new paragraph with an em dash, if you want to. + + \sa methodWithEnDashInItsDocs + +*/ +void Test::methodWithEmDashInItsDocs() +{ + // Woah! Look at that! +} + // Documented below with an \fn command. Unnecessary but we support it, and it's used. int Test::someFunction(int, int v) { diff --git a/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.h b/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.h index a34115ae1..40fa677a2 100644 --- a/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.h +++ b/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.h @@ -50,6 +50,8 @@ using Specialized = Struct<int, T>; void obsoleteMember(); void anotherObsoleteMember(); void deprecatedMember(); + void methodWithEnDashInItsDocs(); + void methodWithEmDashInItsDocs(); void func(bool) {}; //! [funcPtr] void (*funcPtr(bool b, const char *s))(bool) { |