Pergunta

Given an HTML email, I'm using the following to strip down to just the text:

  body = body.gsub(/\\r\\n?/, "\n");
  body = body.gsub(/\\n\\n?/, "\n");
  body = simple_format(body)
  body = strip_tags(body)

But I'm now seeing that one tag gets passed this:

<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">

Which outputs like so:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

Any ideas why?

Nenhuma solução correta

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top