You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At Shopify, we are working on a small library to optimize our current HTML rewriting implementation and wish to use lol-html. We want to define a number of rewrite steps and execute them in a single lol-html pass. By doing this, we can avoid unnecessary traversals the current implementation suffers from.
We're wrapping lol-html in a Ruby gem, and looks something like:
In order to execute this in one pass, we needed access to the StartTag::raw and EndTag::raw method in order to track the position where we will later make the string injections / replacements.
Questions
Is using StartTag::raw and EndTag::raw a reasonable way to go about this, order does lol-html provide another way to do something similar?
Would lol-html be open to providing a pub method to expose the positions offset of StartTag and EndTag, or something similar to allow for single-pass rewriting?
Background
At Shopify, we are working on a small library to optimize our current HTML rewriting implementation and wish to use lol-html. We want to define a number of rewrite steps and execute them in a single lol-html pass. By doing this, we can avoid unnecessary traversals the current implementation suffers from.
We're wrapping lol-html in a Ruby gem, and looks something like:
In order to execute this in one pass, we needed access to the
StartTag::raw
andEndTag::raw
method in order to track the position where we will later make the string injections / replacements.Questions
StartTag::raw
andEndTag::raw
a reasonable way to go about this, order doeslol-html
provide another way to do something similar?lol-html
be open to providing a pub method to expose the positions offset ofStartTag
andEndTag
, or something similar to allow for single-pass rewriting?cc: @gmalette
Thanks!
The text was updated successfully, but these errors were encountered: