This is a cleaner fix to #10643 than the reverted commit 7fe8c92. Styles are not stripped, but with this change they will not interfere with inline parsing. Closes #11246.
7fe8c92