https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116792
--- Comment #18 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by David Malcolm <dmalc...@gcc.gnu.org>: https://gcc.gnu.org/g:0fb30003867635965e2305a4e6f4ac19c2b54225 commit r16-2765-g0fb30003867635965e2305a4e6f4ac19c2b54225 Author: David Malcolm <dmalc...@redhat.com> Date: Mon Aug 4 10:45:31 2025 -0400 diagnostics: avoid stray trailing space in html sink in sarif-replay [PR116792] For the common case where a diagnostic has no metadata, sarif-replay's html output was adding a stray space followed by an empty <div> for the metadata. Fixed thusly. gcc/ChangeLog: PR diagnostics/116792 * diagnostics/html-sink.cc (html_builder::make_element_for_diagnostic): Don't add the metadata element if it's empty. (html_builder::make_element_for_metadata): Return null rather than an empty element. gcc/testsuite/ChangeLog: PR diagnostics/116792 * gcc.dg/plugin/diagnostic-test-graphs-html.py: Remove trailing space from expected text of message. * sarif-replay.dg/2.1.0-valid/embedded-links-check-html.py: Likewise. * sarif-replay.dg/2.1.0-valid/graphs-check-html.py: Likewise. Signed-off-by: David Malcolm <dmalc...@redhat.com>