I was recently generating some pages from data dump content, and noticed something problematic: links to Amazon books/products in the data dump HTML are still rewritten to use Stack Overflow's affiliate redirect, instead of the original link the user provided. For example:
<p>A bit more specific, it's Local Common Subexpression Elimination. An algorithm is given in <a href="http://rads.stackoverflow.com/amzn/click/0321486811" rel="nofollow">Dragon Book</a>
You can see this Data Explorer query to confirm; there are many times more
rads.stackoverflow.com URLs in dumped post bodies than
Given that one of the main purposes of the data dump is to be an archival resource in the event that Stack Exchange goes away, it is suboptimal for these links to depend on Stack. Could this be fixed?
I realize that this could a custom rebake of every post to do properly, but y'all are smart.
It is still possible to get the original URLs from the markdown source in the PostHistory table. However, I have had difficulty using this approach in bulk because of edge cases in Stack's markdown renderer that don't match the libraries I have available in other languages. Including a WASM-compiled version of the render in the data dump would also be an acceptable solution. 😉