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

Basic HTML & Text breaking h2o templates #61

Open
OAFCROB opened this issue Jan 15, 2013 · 2 comments
Open

Basic HTML & Text breaking h2o templates #61

OAFCROB opened this issue Jan 15, 2013 · 2 comments

Comments

@OAFCROB
Copy link

OAFCROB commented Jan 15, 2013

I've been using h2o templates to build up a website. However, I have been building the page normally as I would do and just putting in a terms and conditions page which has a lot of text and basic html characters etc...

However, when I reach a certain number of characters it breaks with the error logs stating

Unclose tag, expecting endblock --- Triggered from /var/www/public_html/config/lib/h2o/parser.php:98

If I reduce the text of the file back down it works, does anyone have any ideas of what is going on and how we can fix this issue.

@OAFCROB
Copy link
Author

OAFCROB commented Jan 16, 2013

I've found a work around to my issue, but I'm not overly sure what is causing the issue when I had the following code in the template it broke but when I've seperated this out into a seperate include file, it works fine.

*Note this is a unordered list within another unordered list.

code

@brunobraga
Copy link

Also facing this issue (any long HTML, like 1500 lines).... but amazingly enough, it happens on PHP 5.2 but not on PHP 5.4... so my advice is: upgrade PHP... if that is not an option, push the contents of the terms and conditions as a variable to be replaced by the template system, that works just fine for me.

Eg.

 $values["terms_and_conditions_html"] =file_get_contents(dirname(__FILE__).'/tpl/terms_and_conditions.html');

Then, from the tamplate:

{{ terms_and_conditions_html }}

That works because the parser does not need to go through the whole HTML looking for filters and tags.

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