simple-html-tokenizer
simple-html-tokenizer copied to clipboard
how to rebuild the html string
When i got data by tokenize
, how to rebuild the html string?
I don't understand the question, can you explain what you are trying to do?
I can get the structural data from html string by tokenize
, then how to generate html string by structural data?
@rwjblue I think the question was more about how to construct HTML string from parsed tokens. And this https://github.com/tildeio/simple-html-tokenizer/blob/v0.1.1/lib/simple-html-tokenizer/generator.js#L27 looks exactly what @purple-force needs.
Do we have generators in latest version?
No, it was removed in https://github.com/tildeio/simple-html-tokenizer/commit/01479fe883cee3ead68079ec0f576cdcfc1e96fd
hey @rwjblue thanks for answer. Any particular reason to remove this part? I am right now trying to use this tokenizer to parse and modify given HTML snippet. Am I doing it wrong (wrong tool to use) or it is still valid idea, and I just need to implement generator of HTML from tokens tree on my own?