Closed goofy-code closed 1 year ago
Nice idea! Would it make more sense to add a parameter like transform
that just takes the HTML string and let's you transform it however you want by returning a new string? Then you could apply string replacements or even parse and traverse the HTML?
@jeanfredrik that's an even better idea ;-)
I've created a new PR for that: https://github.com/whitespace-se/storybook-addon-html/pull/83
Great, thank you!
This option allows replacing any part of the code by providing one or multiple search patterns.
It would cover any need for cleaning code produced by various frameworks or internal stuff which shouldn't be exposed to the addon tab.