react-html-parser icon indicating copy to clipboard operation
react-html-parser copied to clipboard

Request: Transform option to add a classname or id to each parsed

Open GeorgeWL opened this issue 6 years ago • 5 comments

I have seen instances where it was useful to have, and using the transformer feels like a much cleaner way than manually transforming the input string with string manipulation.

GeorgeWL avatar Jun 27 '19 10:06 GeorgeWL

I could use this functionality as well

farhanjiwani avatar Aug 30 '19 15:08 farhanjiwani

Still looking for a solution to this.

carlitosz avatar Jan 14 '20 09:01 carlitosz

Shouldn't it be simple as

  1. Read existing classname, using the parser
  2. Append user-defined options.append.className
  3. done

GeorgeWL avatar Jan 14 '20 10:01 GeorgeWL

I'm currently having problems with the parser itself, returning 'classname' instead of 'className' like the original string passed into it.

earthnoob avatar May 23 '20 17:05 earthnoob

@earthnoob this is resolved here https://github.com/wrakky/react-html-parser/issues/29#issuecomment-333414171

vishalashank avatar Jun 07 '20 02:06 vishalashank