node-html-to-text icon indicating copy to clipboard operation
node-html-to-text copied to clipboard

Should not remove server and/or templating tags

Open srcspider opened this issue 10 years ago • 2 comments

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. [ ['<%', '%>'], [ '<?', '?>' ] ...

srcspider avatar Jun 18 '15 12:06 srcspider

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.

mlegenhausen avatar Jun 22 '15 14:06 mlegenhausen

I actually want them to be interpreted.

srcspider avatar Jun 23 '15 07:06 srcspider