diff --git a/src/main/resources/org/eolang/lints/critical/pos-without-line.xsl b/src/main/resources/org/eolang/lints/critical/pos-without-line.xsl
index 483555a98..00c601685 100644
--- a/src/main/resources/org/eolang/lints/critical/pos-without-line.xsl
+++ b/src/main/resources/org/eolang/lints/critical/pos-without-line.xsl
@@ -25,7 +25,7 @@
critical
Object
-
+
have the "@pos" attribute, but the "@line" attribute is absent
diff --git a/src/main/resources/org/eolang/lints/misc/duplicate-names-in-diff-context.xsl b/src/main/resources/org/eolang/lints/misc/duplicate-names-in-diff-context.xsl
index c8de375c7..879f4043c 100644
--- a/src/main/resources/org/eolang/lints/misc/duplicate-names-in-diff-context.xsl
+++ b/src/main/resources/org/eolang/lints/misc/duplicate-names-in-diff-context.xsl
@@ -5,6 +5,7 @@
-->
+
@@ -23,9 +24,9 @@
warning
- Object "
-
- " has the same name as
+ Object
+
+ has the same name as
diff --git a/src/test/resources/org/eolang/lints/packs/single/duplicate-names-in-diff-context/escapes-name-in-defect-message.yaml b/src/test/resources/org/eolang/lints/packs/single/duplicate-names-in-diff-context/escapes-name-in-defect-message.yaml
new file mode 100644
index 000000000..2ce4e437a
--- /dev/null
+++ b/src/test/resources/org/eolang/lints/packs/single/duplicate-names-in-diff-context/escapes-name-in-defect-message.yaml
@@ -0,0 +1,20 @@
+# SPDX-FileCopyrightText: Copyright (c) 2016-2026 Objectionary.com
+# SPDX-License-Identifier: MIT
+---
+# yamllint disable rule:line-length
+sheets:
+ - /org/eolang/lints/misc/duplicate-names-in-diff-context.xsl
+asserts:
+ - /defects[count(defect[@severity='warning'])=1]
+ - /defects/defect[contains(normalize-space(), 'Object "foo\x22bar" has the same name as')]
+document: |
+
diff --git a/src/test/resources/org/eolang/lints/packs/single/pos-without-line/escapes-name-in-defect-message.yaml b/src/test/resources/org/eolang/lints/packs/single/pos-without-line/escapes-name-in-defect-message.yaml
new file mode 100644
index 000000000..f6f027343
--- /dev/null
+++ b/src/test/resources/org/eolang/lints/packs/single/pos-without-line/escapes-name-in-defect-message.yaml
@@ -0,0 +1,13 @@
+# SPDX-FileCopyrightText: Copyright (c) 2016-2026 Objectionary.com
+# SPDX-License-Identifier: MIT
+---
+# yamllint disable rule:line-length
+sheets:
+ - /org/eolang/lints/critical/pos-without-line.xsl
+asserts:
+ - /defects[count(defect[@severity='critical'])=1]
+ - /defects/defect[normalize-space()='Object "foo\x22bar" have the "@pos" attribute, but the "@line" attribute is absent']
+document: |
+