Synthesis of pendant polymers for organic electronics