create js to process subtitle