Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: zero attr #274

Merged
merged 2 commits into from
May 8, 2024
Merged

fix: zero attr #274

merged 2 commits into from
May 8, 2024

Conversation

nobkd
Copy link
Collaborator

@nobkd nobkd commented May 6, 2024

closes #248 with b94f03b

You can see this example errors, if not for the change in render.js. Just undo that change and run bun test to see sth like this:

See error log
41 |             ret += `${str.substring(lastIdx, i)}&#x${getCodePoint(str, i).toString(16)};`;
42 |             // Increase by 1 if we have a surrogate pair
43 |             lastIdx = xmlReplacer.lastIndex += Number((char & 0xfc00) === 0xd800);
44 |         }
45 |     }
46 |     return ret + str.substr(lastIdx);
                      ^
TypeError: str.substr is not a function. (In 'str.substr(lastIdx)', 'str.substr' is undefined)
      at encodeXML (/home/nobkd/<pth>/nue/node_modules/entities/lib/esm/escape.js:46:18)
      at /home/nobkd/<pth>/nue/node_modules/dom-serializer/lib/esm/index.js:49:27
      at map (:1:21)
      at formatAttributes (/home/nobkd/<pth>/nue/node_modules/dom-serializer/lib/esm/index.js:38:12)
      at renderTag (/home/nobkd/<pth>/nue/node_modules/dom-serializer/lib/esm/index.js:142:21)
      at render (/home/nobkd/<pth>/nue/node_modules/dom-serializer/lib/esm/index.js:89:19)
      at render (/home/nobkd/<pth>/nue/node_modules/dom-serializer/lib/esm/index.js:89:19)
      at render (/home/nobkd/<pth>/nue/packages/nuejs/src/render.js:364:23)
      at runTests (/home/nobkd/<pth>/nue/packages/nuejs/test/render.test.js:8:18)
      at /home/nobkd/<pth>/nue/packages/nuejs/test/render.test.js:146:3

test falsy values with b918eb2 (test for something like #193 fixed by a3b29f5)

@nobkd nobkd requested a review from tipiirai May 6, 2024 22:38
@tipiirai tipiirai merged commit 1d52eee into nuejs:master May 8, 2024
3 checks passed
@tipiirai
Copy link
Contributor

tipiirai commented May 8, 2024

Thanks!

@nobkd nobkd deleted the fix/zero-attr branch May 8, 2024 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Syntax error
2 participants