html-to-text / node-html-to-text

Advanced html to text converter
Other
1.61k stars 223 forks source link

Should not remove server and/or templating tags #59

Open srcspider opened 9 years ago

srcspider commented 9 years ago

Given the following,

<p>Hello, <?php echo $name  ?></p>

It makes no sense to strip out the <?php ... ?> part.

This applies to other template styles, such as <% ... %> or shorthand styles <?= ... ?>.


Simplest solution to this would probably to have tag suffice/prefix pair exclusion rules. eg. [ ['<%', '%>'], [ '<?', '?>' ] ...

mlegenhausen commented 9 years ago

The problem is I need to strip out all content that is not usable for a text representation. This includes PHP tags which would normally interpreted by your PHP engine. I would suggest to escape all php tags, cause you want them to be displayed instead of interpreted.

srcspider commented 9 years ago

I actually want them to be interpreted.