Hi,
I never noticed before this but yes, according to this (and my own testing seems to confirm it is true) it does _replace_ the list of valid attributes.
You will need to add the attributes you want allowed on "pre" in the code above (ex. for "class": $extra = 'pre[class|lang|line|escaped|style|width|highlight]';) or just use "*" if you want to allow all attributes (ex: $extra = 'pre[*]';)
For reference, by default "pre" gets its list of valid attributes from the "default rule set" defined here
Edit: more specifically, the default attributes for "pre" seem to come from the "@" rule which states: "[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|"
+ "onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|"
+ "onkeydown|onkeyup]"