Did you skip over the last paragraph?
If you can defer the repayment of the loan until after death, capital gains are eliminated.