Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting doctype etc. #4

Open
garak opened this issue Dec 27, 2017 · 2 comments
Open

Getting doctype etc. #4

garak opened this issue Dec 27, 2017 · 2 comments

Comments

@garak
Copy link

garak commented Dec 27, 2017

Given a text like "lorem ipsum dolor sit amet" and calling truncate_letters, I'm getting the following as result:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><body>lorem ipsum</body>

I don't want any doctype added, nor additional html and/or body tags

@garak
Copy link
Author

garak commented Dec 27, 2017

It looks like this could be solved by merging #3

@alexwilson
Copy link
Contributor

Hey, sorry I'm late to the party here.
Yeah, this is a weird one. For the original use-case, we actually were running things through a parser which would remove the HTML tags as part of a nested doc.

I'll see if we can merge this in.

gmichard added a commit to gmichard/twig-truncate-extension that referenced this issue May 5, 2020
@see bluetel#4 Fix this issue

> Since PHP 5.4.0 and Libxml 2.6.0, you may also use the options parameter

@see https://www.php.net/manual/en/domdocument.loadhtml.php Requires PHP 5.4.0 or more
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants