Refactor copy-code-snippets
Refactor copy-code-snippets

- Simplify the finding what code to copy by traversing up the table, and
  then moving downwards to the `pre` block.

cllns/refills,thoughtbot/refills,smithdamen/refills,DropsOfSerenity/refills,DropsOfSerenity/refills,tranc99/refills,tranc99/refills,dydx/refills,dydx/refills,mehdroid/refills,mehdroid/refills,cllns/refills,smithdamen/refills,mehdroid/refills,DropsOfSerenity/refills,thoughtbot/refills,greyhwndz/refills,greyhwndz/refills,smithdamen/refills,dydx/refills,cllns/refills,mehdroid/refills,tranc99/refills,hlogmans/refills,greyhwndz/refills,cllns/refills,DropsOfSerenity/refills,hlogmans/refills,dydx/refills,greyhwndz/refills,thoughtbot/refills,tranc99/refills,hlogmans/refills,thoughtbot/refills,smithdamen/refills,hlogmans/refills