Skip to content

Fix multiline hyperlink renders #4307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 11, 2022
Merged

Conversation

daymxn
Copy link
Member

@daymxn daymxn commented Nov 10, 2022

Per b/256180692, this PR fixes an issue where multiline @see blocks were leaking HTML into the final output for documentation.

This occurs due to an upstream issue with Dokka (see Kotlin/dokka#2665), where line breaks inside of @see tags break the generated Javadoc. This also prevents hyperlinks from being utilized in @see blocks. Thankfully, this issue only occurs in two places throughout our codebase (at least on the public API, which is what matters for doc generation).

One instance was resolved by providing a direct reference to the object- as it just so happens to be present on our classpath (and as such, a hyperlink is not needed).

The remaining instance was solved in three ways:

  1. We reduce the link to a shorthand variant (thanks dynamic links!) as to keep everything on one line
  2. We provide text to be present in the link (as this is usually generated from the package-list, but can't occur here as it's an external reference outside the scope of Java)
  3. We provide a new FiresiteTransform method to handle the remaining leakage, and patch it up as expected.

The reason for keeping the link on one line and then implementing a transform versus just implementing one to handle the multiline issue is so that we can keep this state to a single issue; hyperlinks not working. Versus being bound to two separate issues; hyperlinks not working AND newlines breaking the output. So should Dockka only fix one of the issues, it will not break our transform.

@daymxn daymxn requested review from vkryachko and rlazo November 10, 2022 21:11
@daymxn daymxn self-assigned this Nov 10, 2022
@github-actions
Copy link
Contributor

buildSrc Test Results

18 tests   18 ✔️  1m 20s ⏱️
  4 suites    0 💤
  4 files      0

Results for commit ae0a7fa.

@github-actions
Copy link
Contributor

Unit Test Results

   395 files  ±0     395 suites  ±0   19m 40s ⏱️ +10s
4 730 tests ±0  4 708 ✔️ +2  22 💤 ±0  0  - 2 
4 746 runs  ±0  4 724 ✔️ +2  22 💤 ±0  0  - 2 

Results for commit ae0a7fa. ± Comparison against base commit 0ba9bc3.

@google-oss-bot
Copy link
Contributor

Size Report 1

Affected Products

  • firebase-firestore

    TypeBase (0ba9bc3)Merge (798713f)Diff
    aar1.31 MB1.31 MB-3 B (-0.0%)
    apk (release)3.35 MB3.35 MB+4 B (+0.0%)
  • firebase-firestore-ktx

    TypeBase (0ba9bc3)Merge (798713f)Diff
    apk (release)4.29 MB4.29 MB+4 B (+0.0%)
  • firebase-perf

    TypeBase (0ba9bc3)Merge (798713f)Diff
    aar313 kB313 kB+8 B (+0.0%)
    apk (release)2.48 MB2.48 MB-12 B (-0.0%)
  • firebase-perf-ktx

    TypeBase (0ba9bc3)Merge (798713f)Diff
    apk (release)3.41 MB3.41 MB-140 B (-0.0%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/t3NDq7Y2Hw.html

@daymxn daymxn merged commit d719e10 into master Nov 11, 2022
@daymxn daymxn deleted the daymon-fix-multiline-hyperlink-renders branch November 11, 2022 01:32
davidmotson pushed a commit that referenced this pull request Nov 28, 2022
* Replace trace hyperlink with direct link

* Replace timestamp link with non multiline variant

* Add transform to rectify hyperlink bugs in see blocks
@firebase firebase locked and limited conversation to collaborators Dec 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants