<table><tr><td style="">marten created this revision.<br />Restricted Application added a project: Plasma.<br />Restricted Application added a subscriber: plasma-devel.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D7820" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>Viewing the clang(1) man page shows spurious floating point numbers, either "0.0", "3.5" or "7.0", scattered throughout the page:</p>

<p><a href="https://phabricator.kde.org/F3910985" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;" rel="noreferrer">F3910985: clang-manpage-DX.png</a></p>

<p>These appear to be generated by the ".RS" line within a macro, as in the decompressed clang.1.bz2 man page source:</p>

<p>.de1 INDENT<br />
.\" .rstReportMargin pre:<br />
. RS \\$1<br />
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]<br />
. nr rst2man-indent-level +1<br />
.\" .rstReportMargin post:<br />
..</p>

<p>where the macro parameter to .INDENT is the spurious floating point number that appears.</p>

<p>When the .RS is seen in the REQ_RS case in scan_request(), if there are arguments scan_expression() is called to read the first argument.  Unfortunately, scan_expression() simply sees the "\\$1" text and does not attempt to expand it as a macro argument.  Since this string does not match any of the syntax known to scan_expression() the argument is ignored, the scan pointer is not advanced and the argument is output as if it were normal text.</p>

<p>This change recognises the "\\$1" syntax in scan_expression() and uses scan_escape_direct() to parse it.  The string value is then converted to a number.  It is only possible to return an integer (rounded) because scan_expression() only handles integers, but at least something approximate is returned and the argument is skipped and not output.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Built kio_man with this change, verified correct output of this man page and others.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R320 KIO Extras</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D7820" rel="noreferrer">https://phabricator.kde.org/D7820</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>man/man2html.cpp</div></div></div><br /><div><strong>To: </strong>marten, Plasma<br /><strong>Cc: </strong>plasma-devel, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart<br /></div>