Skip to content

Commit d8382c9

Browse files
markmcdcopybara-github
authored andcommitted
Exclude image captions from auto-linking API symbols.
Currently we are processing back-ticks inside of `![image](/url.png "caption \`symbol\`")`, but this breaks the markdown, and probably the author's expectation too. PiperOrigin-RevId: 488842017
1 parent 33c391b commit d8382c9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/tensorflow_docs/api_generator/reference_resolver.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,9 @@ def one_ref(match):
297297
'</pre>'),
298298
IgnoreLineInBlock('```', '```'),
299299
IgnoreLineInBlock(
300-
'<pre class="devsite-click-to-copy prettyprint lang-py">', '</pre>')
300+
'<pre class="devsite-click-to-copy prettyprint lang-py">',
301+
'</pre>'),
302+
IgnoreLineInBlock('![', ')'), # Don't replace within image's caption
301303
]
302304

303305
for line in string.splitlines():

0 commit comments

Comments
 (0)