Avoid error when stripped inline markup in code listings has attributes.

Also simplified logic in a predicate.