fix: avoid writing nonexistent tag references in preserve style