Skip to content

Weaver code generation breaks HTML links. #751

@marcalff

Description

@marcalff

This is an example of generated code (in opentelemetry-cpp):

/**
 * Time disk spent activated
 * <p>
 * The real elapsed time ("wall clock") used in the I/O path (time from operations running in
 * parallel are not counted). Measured as: <ul> <li>Linux: Field 13 from <a
 * href="https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats">procfs-diskstats</a></li>
 *   <li>Windows: The complement of
 * <a
 * href="https://learn.microsoft.com/archive/blogs/askcore/windows-performance-monitor-disk-counters-explained#windows-performance-monitor-disk-counters-explained">"Disk%
 * Idle Time"</a> performance counter: @code uptime * (100 - "Disk\% Idle Time") / 100 @endcode</li>
 * </ul>
 * <p>
 * counter
 */

This causes at build time (when using -Wdocumentation):

In file included from /home/runner/work/opentelemetry-cpp/opentelemetry-cpp/examples/common/metrics_foo_library/foo_library.cc:26:
/home/runner/work/opentelemetry-cpp/opentelemetry-cpp/api/include/opentelemetry/semconv/incubating/system_metrics.h:279:2: error: HTML start tag prematurely ended, expected attribute name or '>' [-Werror,-Wdocumentation]
  279 |  * href="https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats">procfs-diskstats</a></li>
      |  ^
/home/runner/work/opentelemetry-cpp/opentelemetry-cpp/api/include/opentelemetry/semconv/incubating/system_metrics.h:278:75: note: HTML tag started here
  278 |  * parallel are not counted). Measured as: <ul> <li>Linux: Field 13 from <a
      |                                                                           ^

The problem here is that when a link is generated in some text, as in:

text before <a href="https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats">procfs-diskstats</a> text after

when the text is later reformatted and added in a comment section (using *), the html link is broken.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions