Recorder: Don't generate selectors with attributes containing `\n`

This commit is contained in:
Michael Mintz 2021-10-27 23:56:09 -04:00
parent 2913f31bdb
commit 5ec078a26b
1 changed files with 3 additions and 1 deletions

View File

@ -37,7 +37,9 @@ var cssPathByAttribute = function(el, attr) {
while (el !== null && el.nodeType === Node.ELEMENT_NODE) {
var selector = el.nodeName.toLowerCase();
if (el.hasAttribute(attr) &&
el.getAttribute(attr).length > 0) {
el.getAttribute(attr).length > 0 &&
!el.getAttribute(attr).includes('\n'))
{
the_attr = el.getAttribute(attr);
if (the_attr.includes('"'))
the_attr = the_attr.replace('"', '\\"');