Excellent thanks Ben I think I will submit this to the Codemirror people as well as it seems to be a problem with quite a few components. Although interestingly enough it works fine in articles and modules. Many thanks for that - was quite a headache that one. Saen