Skip to content

Conversation

MattiasBuelens
Copy link
Contributor

@MattiasBuelens MattiasBuelens commented Jul 5, 2024

On one of our JavaDoc pages (THEOplayerConfig.html), we noticed a broken link in the Nested Class Summary.

The Java source looks like this:

package com.theoplayer.android.api;

/**
 * The THEOplayer Configuration API.
 */
public interface THEOplayerConfig {
    /**
     * The builder for {@link THEOplayerConfig}.
     */
    class Builder { }
}

The rendered HTML for the Nested Class Summary looks like this:

<h3>Nested Class Summary</h3>
<div class="memberSummary">
    <table>
        <caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption>
        <tr>
            <th class="colFirst" scope="col">Modifier and Type</th>
            <th class="colSecond" scope="col">Class</th>
            <th class="colLast" scope="col">Description</th>
        </tr>

        <tr class="altColor">
            <td class="colFirst"><code>public class</code></td>
            <th class="colSecond" scope="row"><code><a href="THEOplayerConfig.Builder.html">THEOplayerConfig.Builder</a></span></code>
            </th>
            <td class="colLast"><p>The builder for <a href=com/theoplayer/android/api/THEOplayerConfig.html>THEOplayerConfig</a>.</p></td>
        </tr>

    </table>
</div>

The link to THEOplayerConfig is rendered as:

<a href=com/theoplayer/android/api/THEOplayerConfig.html>THEOplayerConfig</a>

However, the link should just point to the current page:

<a href=THEOplayerConfig.html>THEOplayerConfig</a>

It turns out the JavaDoc renderer was passing the wrong relative node to htmlForContentNodes(). This PR fixes that, and now the link renders correctly. 😄

Copy link
Collaborator

@whyoleg whyoleg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM

@whyoleg whyoleg merged commit 3aa646a into Kotlin:master Aug 2, 2024
@MattiasBuelens MattiasBuelens deleted the fix-links-in-nested-class-summary branch August 2, 2024 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants