intend to add a parsing onMenuClick and onmenuclick

4 views
Skip to first unread message

Alex Wu

unread,
Feb 22, 2017, 5:47:27 PM2/22/17
to pagespeed-dev
I intend to add keywords to html parsing: onMenuClick and onmenuclick (both have javascript code). Is there a way to add a keyword in case-insensitive way for html parser?

Otto van der Schaaf

unread,
Feb 23, 2017, 6:44:15 AM2/23/17
to Alex Wu, pagespeed-dev
Not adding a keyword, but instead inspecting Attribute::name_str() may be the easiest way to achieve what you want:

// Returns the HTML keyword enum.  If this attribute name is not
// recognized, returns HtmlName::kNotAKeyword, and you can examine
// name_str().

If you must add those two as keywords, this looks like a good starting point:

  // HtmlName's should be normally constructed using HtmlParse::MakeName
  // Returns the keyword enumeration for this HTML Name.  Note that
  // keyword lookup is case-insensitive.


Otto


On Wed, Feb 22, 2017 at 11:47 PM Alex Wu <yw9...@gmail.com> wrote:
I intend to add keywords to html parsing: onMenuClick and onmenuclick (both have javascript code). Is there a way to add a keyword in case-insensitive way for html parser?

--
You received this message because you are subscribed to the Google Groups "pagespeed-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pagespeed-de...@googlegroups.com.
To post to this group, send email to pagesp...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pagespeed-dev/39b7324e-b92d-4616-b00e-dcdeacc75a0b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alex Wu

unread,
Feb 23, 2017, 2:18:59 PM2/23/17
to pagespeed-dev, yw9...@gmail.com
Great. I'll give a try.

Alex
Reply all
Reply to author
Forward
0 new messages