Bug Tracker

Modify

Ticket #10670 (closed bug: fixed)

Opened 2 years ago

Last modified 2 years ago

rnoshimcache probably not constructed correctly

Reported by: anonymous Owned by: rwaldron
Priority: high Milestone: 1.7.1
Component: manipulation Version: git
Keywords: Cc:
Blocking: Blocked by:

Description

Although this doesn't directly break anything (as far as I know), I would like to mention the following:

rnoshimcache is constructed with the following code:

rnoshimcache = new RegExp("<(?:" + nodeNames.replace(" ", "|") + ")", "i"),

But this only replaces one space with a |. As a result, rnoshimcache is:

/<(?:abbr|article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video)/i

This does not make much sense since it allows for either "abbr" or "all other elements with spaces in between".

I think all spaces should be replaced like:

rnoshimcache = new RegExp("<(?:" + nodeNames.replace(/ /g, "|") + ")", "i"),

Change History

comment:1 Changed 2 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to duplicate

I think that explains #10667 so I'll close this one as a dup. Many thanks for figuring this out!

comment:2 Changed 2 years ago by dmethvin

Duplicate of #10667.

comment:3 Changed 2 years ago by timmywil

  • Priority changed from undecided to high
  • Resolution duplicate deleted
  • Status changed from closed to reopened
  • Component changed from unfiled to manipulation
  • Milestone changed from None to 1.7.1

These are not dupes. rwaldron has pending fixes for this issue tho.

comment:4 Changed 2 years ago by timmywil

  • Owner set to rwaldron
  • Status changed from reopened to assigned

comment:5 Changed 2 years ago by Rick Waldron

  • Status changed from assigned to closed
  • Resolution set to fixed

Fix busted rnoshimcache. Correctly clone detached unknown elems. Fixes #10667, #10670.

  • \s => |, Removes 4 bytes from gzipped build

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.