Commit a9c4d2f9 by ibaker Committed by Oliver Woodman

Ensure javadoc fix applies to Android links with anchors

This means is-external=true is removed and target=_top is
set on the <a> tag.

Without this, javadoc links to framework docs with anchors are
currently broken when viewed in the "frame view" on
exoplayer.dev/doc/reference/

Before this change:
https://developer.android.com/reference/android/media/MediaDrm.html?is-external=true#getKeyRequest-byte:A-byte:A-java.lang.String-int-java.util.HashMap-

With this change:
https://developer.android.com/reference/android/media/MediaDrm.html#getKeyRequest-byte:A-byte:A-java.lang.String-int-java.util.HashMap-

PiperOrigin-RevId: 304136858
parent c75f3f77
Showing with 2 additions and 2 deletions
...@@ -15,8 +15,8 @@ ext.fixJavadoc = { ...@@ -15,8 +15,8 @@ ext.fixJavadoc = {
def javadocPath = "${project.buildDir}/docs/javadoc" def javadocPath = "${project.buildDir}/docs/javadoc"
// Fix external Android links to target the top frame. // Fix external Android links to target the top frame.
def androidRoot = "https://developer.android.com/reference/" def androidRoot = "https://developer.android.com/reference/"
def androidLink = "<a href=\"(${androidRoot}.*?)\\?is-external=true\"" def androidLink = "<a href=\"(${androidRoot}.*?)\\?is-external=true(.*)\""
def androidFixed = "<a href=\"\\1\" target=\"_top\"" def androidFixed = "<a href=\"\\1\\2\" target=\"_top\""
ant.replaceregexp(match:androidLink, replace:androidFixed, flags:'g') { ant.replaceregexp(match:androidLink, replace:androidFixed, flags:'g') {
fileset(dir: "${javadocPath}", includes: "**/*.html") fileset(dir: "${javadocPath}", includes: "**/*.html")
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment