Resolve batch query and only replace red links

Change-Id: I16d154a416d607047d77181d4a01fb74f2a8d143
Merge "Resolve batch query and only replace red links"