storybook-addon-html icon indicating copy to clipboard operation
storybook-addon-html copied to clipboard

feat: add `removeComments` parameter

Open dgonzalezr opened this issue 2 years ago • 1 comments

The removeComments parameter will remove all the HTML comments (if set to true) or only the want matching a regular expression provided. Eg:

export const parameters = {
  html: {
    removeComments: true, // default: false
  },
};
export const parameters = {
  html: {
    // Remove only lit HTML comments, eg: `<!--?lit$117057236$-->`
    removeComments: /<!--(.lit.*?)-->/g, 
  },
};

This change will complement a previous PR #66 created before.

dgonzalezr avatar Sep 23 '22 13:09 dgonzalezr

@jeanfredrik would you mind please to take a look when you have time? Thank you 🙂

dgonzalezr avatar Oct 15 '22 06:10 dgonzalezr

Very interested in this update - will be a big improvement on our implementation for Adobe's Spectrum design system docs. If I can help in any way, please reach out!

castastrophe avatar Nov 10 '22 17:11 castastrophe

We've added this feature in version 5.0.2. Thanks for the idea and the contributions!

jeanfredrik avatar Nov 11 '22 16:11 jeanfredrik

We've added this feature in version 5.0.2. Thanks for the idea and the contributions!

Thank you @jeanfredrik 🙌🏻

dgonzalezr avatar Nov 13 '22 09:11 dgonzalezr